From 705a87e39f406f254d287d50fb903d845e4b28ae Mon Sep 17 00:00:00 2001 From: Sean McCullough Date: Wed, 15 Apr 2020 09:59:13 -0700 Subject: [PATCH] Added Set Expiry swagger --- .../api/Azure.Storage.Blobs.netstandard2.0.cs | 6 +- .../src/Generated/BlobRestClient.cs | 370 ++++++++++++++++-- .../Azure.Storage.Blobs/swagger/readme.md | 19 + 3 files changed, 361 insertions(+), 34 deletions(-) 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 312e4f5e4371..56eb6a767a63 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 @@ -567,6 +567,7 @@ internal BlobItemProperties() { } public string DestinationSnapshot { get { throw null; } } public string EncryptionScope { get { throw null; } } public Azure.ETag? ETag { get { throw null; } } + public System.DateTimeOffset? ExpiresOn { get { throw null; } } public bool? IncrementalCopy { get { throw null; } } public bool? IsSealed { get { throw null; } } public System.DateTimeOffset? LastModified { get { throw null; } } @@ -621,6 +622,7 @@ public BlobProperties() { } public string EncryptionKeySha256 { get { throw null; } } public string EncryptionScope { get { throw null; } } public Azure.ETag ETag { get { throw null; } } + public System.DateTimeOffset ExpiresOn { get { throw null; } } public bool IsCurrentVersion { get { throw null; } } public bool IsIncrementalCopy { get { throw null; } } public bool IsSealed { get { throw null; } } @@ -698,13 +700,13 @@ public static partial class BlobsModelFactory [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Blobs.Models.BlobItem BlobItem(string name, bool deleted, Azure.Storage.Blobs.Models.BlobItemProperties properties, string snapshot, System.Collections.Generic.IDictionary metadata) { throw null; } public static Azure.Storage.Blobs.Models.BlobItem BlobItem(string name, bool deleted, Azure.Storage.Blobs.Models.BlobItemProperties properties, string snapshot = null, string versionId = null, bool? isCurrentVersion = default(bool?), System.Collections.Generic.IDictionary metadata = null, System.Collections.Generic.IDictionary tags = null) { throw null; } - public static Azure.Storage.Blobs.Models.BlobItemProperties BlobItemProperties(bool accessTierInferred, string copyProgress = null, string contentType = null, string contentEncoding = null, string contentLanguage = null, byte[] contentHash = null, string contentDisposition = null, string cacheControl = null, long? blobSequenceNumber = default(long?), Azure.Storage.Blobs.Models.BlobType? blobType = default(Azure.Storage.Blobs.Models.BlobType?), Azure.Storage.Blobs.Models.LeaseStatus? leaseStatus = default(Azure.Storage.Blobs.Models.LeaseStatus?), Azure.Storage.Blobs.Models.LeaseState? leaseState = default(Azure.Storage.Blobs.Models.LeaseState?), Azure.Storage.Blobs.Models.LeaseDurationType? leaseDuration = default(Azure.Storage.Blobs.Models.LeaseDurationType?), string copyId = null, Azure.Storage.Blobs.Models.CopyStatus? copyStatus = default(Azure.Storage.Blobs.Models.CopyStatus?), System.Uri copySource = null, long? contentLength = default(long?), string copyStatusDescription = null, bool? serverEncrypted = default(bool?), bool? incrementalCopy = default(bool?), string destinationSnapshot = null, int? remainingRetentionDays = default(int?), Azure.Storage.Blobs.Models.AccessTier? accessTier = default(Azure.Storage.Blobs.Models.AccessTier?), System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), Azure.Storage.Blobs.Models.ArchiveStatus? archiveStatus = default(Azure.Storage.Blobs.Models.ArchiveStatus?), string customerProvidedKeySha256 = null, string encryptionScope = null, bool? isSealed = default(bool?), Azure.ETag? eTag = default(Azure.ETag?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? copyCompletedOn = default(System.DateTimeOffset?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), System.DateTimeOffset? accessTierChangedOn = default(System.DateTimeOffset?)) { throw null; } + public static Azure.Storage.Blobs.Models.BlobItemProperties BlobItemProperties(bool accessTierInferred, string copyStatusDescription = null, string contentType = null, string contentEncoding = null, string contentLanguage = null, byte[] contentHash = null, string contentDisposition = null, string cacheControl = null, long? blobSequenceNumber = default(long?), Azure.Storage.Blobs.Models.BlobType? blobType = default(Azure.Storage.Blobs.Models.BlobType?), Azure.Storage.Blobs.Models.LeaseStatus? leaseStatus = default(Azure.Storage.Blobs.Models.LeaseStatus?), Azure.Storage.Blobs.Models.LeaseState? leaseState = default(Azure.Storage.Blobs.Models.LeaseState?), Azure.Storage.Blobs.Models.LeaseDurationType? leaseDuration = default(Azure.Storage.Blobs.Models.LeaseDurationType?), string copyId = null, Azure.Storage.Blobs.Models.CopyStatus? copyStatus = default(Azure.Storage.Blobs.Models.CopyStatus?), System.Uri copySource = null, string copyProgress = null, long? contentLength = default(long?), bool? serverEncrypted = default(bool?), bool? incrementalCopy = default(bool?), string destinationSnapshot = null, int? remainingRetentionDays = default(int?), Azure.Storage.Blobs.Models.AccessTier? accessTier = default(Azure.Storage.Blobs.Models.AccessTier?), System.DateTimeOffset? lastModified = default(System.DateTimeOffset?), Azure.Storage.Blobs.Models.ArchiveStatus? archiveStatus = default(Azure.Storage.Blobs.Models.ArchiveStatus?), string customerProvidedKeySha256 = null, string encryptionScope = null, System.DateTimeOffset? expiresOn = default(System.DateTimeOffset?), bool? isSealed = default(bool?), Azure.ETag? eTag = default(Azure.ETag?), System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? copyCompletedOn = default(System.DateTimeOffset?), System.DateTimeOffset? deletedOn = default(System.DateTimeOffset?), System.DateTimeOffset? accessTierChangedOn = default(System.DateTimeOffset?)) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Blobs.Models.BlobItemProperties BlobItemProperties(bool accessTierInferred, System.Uri copySource, string contentType, string contentEncoding, string contentLanguage, byte[] contentHash, string contentDisposition, string cacheControl, long? blobSequenceNumber, Azure.Storage.Blobs.Models.BlobType? blobType, Azure.Storage.Blobs.Models.LeaseStatus? leaseStatus, Azure.Storage.Blobs.Models.LeaseState? leaseState, Azure.Storage.Blobs.Models.LeaseDurationType? leaseDuration, string copyId, Azure.Storage.Blobs.Models.CopyStatus? copyStatus, long? contentLength, string copyProgress, string copyStatusDescription, bool? serverEncrypted, bool? incrementalCopy, string destinationSnapshot, int? remainingRetentionDays, Azure.Storage.Blobs.Models.AccessTier? accessTier, System.DateTimeOffset? lastModified, Azure.Storage.Blobs.Models.ArchiveStatus? archiveStatus, string customerProvidedKeySha256, Azure.ETag? eTag, System.DateTimeOffset? createdOn, System.DateTimeOffset? copyCompletedOn, System.DateTimeOffset? deletedOn, System.DateTimeOffset? accessTierChangedOn) { throw null; } public static Azure.Storage.Blobs.Models.BlobLease BlobLease(Azure.ETag eTag, System.DateTimeOffset lastModified, string leaseId) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Blobs.Models.BlobProperties BlobProperties(System.DateTimeOffset lastModified, Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration, Azure.Storage.Blobs.Models.LeaseState leaseState, Azure.Storage.Blobs.Models.LeaseStatus leaseStatus, long contentLength, string destinationSnapshot, Azure.ETag eTag, byte[] contentHash, string contentEncoding, string contentDisposition, string contentLanguage, bool isIncrementalCopy, string cacheControl, Azure.Storage.Blobs.Models.CopyStatus copyStatus, long blobSequenceNumber, System.Uri copySource, string acceptRanges, string copyProgress, int blobCommittedBlockCount, string copyId, bool isServerEncrypted, string copyStatusDescription, string encryptionKeySha256, System.DateTimeOffset copyCompletedOn, string accessTier, Azure.Storage.Blobs.Models.BlobType blobType, bool accessTierInferred, System.Collections.Generic.IDictionary metadata, string archiveStatus, System.DateTimeOffset createdOn, System.DateTimeOffset accessTierChangedOn, string contentType) { throw null; } - public static Azure.Storage.Blobs.Models.BlobProperties BlobProperties(System.DateTimeOffset lastModified, long contentLength, string contentType, Azure.ETag eTag, Azure.Storage.Blobs.Models.LeaseStatus leaseStatus, string contentEncoding, string contentDisposition, string contentLanguage, string cacheControl, long blobSequenceNumber, Azure.Storage.Blobs.Models.LeaseState leaseState, string acceptRanges, Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration, int blobCommittedBlockCount, string destinationSnapshot, bool isServerEncrypted, bool isIncrementalCopy, string encryptionKeySha256, Azure.Storage.Blobs.Models.CopyStatus copyStatus, string encryptionScope, System.Uri copySource, string accessTier, string copyProgress, bool accessTierInferred, string copyId, string archiveStatus, string copyStatusDescription, System.DateTimeOffset accessTierChangedOn, System.DateTimeOffset copyCompletedOn, string versionId, Azure.Storage.Blobs.Models.BlobType blobType, bool isCurrentVersion, System.Collections.Generic.IDictionary metadata, long tagCount, System.DateTimeOffset createdOn, bool isSealed, byte[] contentHash) { throw null; } + public static Azure.Storage.Blobs.Models.BlobProperties BlobProperties(System.DateTimeOffset lastModified, long contentLength, string contentType, Azure.ETag eTag, byte[] contentHash, Azure.Storage.Blobs.Models.LeaseStatus leaseStatus, string contentDisposition, string contentLanguage, string cacheControl, long blobSequenceNumber, string acceptRanges, Azure.Storage.Blobs.Models.LeaseState leaseState, int blobCommittedBlockCount, Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration, bool isServerEncrypted, string destinationSnapshot, string encryptionKeySha256, bool isIncrementalCopy, string encryptionScope, Azure.Storage.Blobs.Models.CopyStatus copyStatus, string accessTier, System.Uri copySource, bool accessTierInferred, string copyProgress, string archiveStatus, string copyId, System.DateTimeOffset accessTierChangedOn, string copyStatusDescription, string versionId, System.DateTimeOffset copyCompletedOn, bool isCurrentVersion, Azure.Storage.Blobs.Models.BlobType blobType, long tagCount, System.Collections.Generic.IDictionary metadata, System.DateTimeOffset expiresOn, System.DateTimeOffset createdOn, bool isSealed, string contentEncoding) { throw null; } public static Azure.Storage.Blobs.Models.BlobServiceStatistics BlobServiceStatistics(Azure.Storage.Blobs.Models.BlobGeoReplication geoReplication = null) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] public static Azure.Storage.Blobs.Models.BlobSnapshotInfo BlobSnapshotInfo(string snapshot, Azure.ETag eTag, System.DateTimeOffset lastModified, bool isServerEncrypted) { throw null; } diff --git a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs index 896ea129d6ad..3e6daf6e22ea 100644 --- a/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs +++ b/sdk/storage/Azure.Storage.Blobs/src/Generated/BlobRestClient.cs @@ -4605,6 +4605,10 @@ internal static Azure.Core.HttpMessage GetPropertiesAsync_CreateMessage( { _value.TagCount = long.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); } + if (response.Headers.TryGetValue("x-ms-expiry-time", out _header)) + { + _value.ExpiresOn = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); + } if (response.Headers.TryGetValue("x-ms-blob-sealed", out _header)) { _value.IsSealed = bool.Parse(_header); @@ -5648,6 +5652,169 @@ internal static Azure.Response UndeleteAsync_CreateResponse( } #endregion Blob.UndeleteAsync + #region Blob.SetExpiryAsync + /// + /// Sets the time a blob will expire and be deleted. + /// + /// The ClientDiagnostics instance used for operation reporting. + /// The pipeline used for sending requests. + /// The URL of the service account, container, or blob that is the targe of the desired operation. + /// Specifies the version of the operation to use for this request. + /// Required. Indicates mode of the expiry time + /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. + /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + /// The time to set the blob to expiry + /// Whether to invoke the operation asynchronously. The default value is true. + /// Operation name. + /// Cancellation token. + /// Azure.Response{Azure.Storage.Blobs.Models.BlobSetExpiryInternal} + public static async System.Threading.Tasks.ValueTask> SetExpiryAsync( + Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, + Azure.Core.Pipeline.HttpPipeline pipeline, + System.Uri resourceUri, + string version, + Azure.Storage.Blobs.Models.BlobExpiryOptions expiryOptions, + int? timeout = default, + string requestId = default, + string expiresOn = default, + bool async = true, + string operationName = "BlobClient.SetExpiry", + System.Threading.CancellationToken cancellationToken = default) + { + Azure.Core.Pipeline.DiagnosticScope _scope = clientDiagnostics.CreateScope(operationName); + try + { + _scope.AddAttribute("url", resourceUri); + _scope.Start(); + using (Azure.Core.HttpMessage _message = SetExpiryAsync_CreateMessage( + pipeline, + resourceUri, + version, + expiryOptions, + timeout, + requestId, + expiresOn)) + { + if (async) + { + // Send the request asynchronously if we're being called via an async path + await pipeline.SendAsync(_message, cancellationToken).ConfigureAwait(false); + } + else + { + // Send the request synchronously through the API that blocks if we're being called via a sync path + // (this is safe because the Task will complete before the user can call Wait) + pipeline.Send(_message, cancellationToken); + } + Azure.Response _response = _message.Response; + cancellationToken.ThrowIfCancellationRequested(); + return SetExpiryAsync_CreateResponse(clientDiagnostics, _response); + } + } + catch (System.Exception ex) + { + _scope.Failed(ex); + throw; + } + finally + { + _scope.Dispose(); + } + } + + /// + /// Create the Blob.SetExpiryAsync request. + /// + /// The pipeline used for sending requests. + /// The URL of the service account, container, or blob that is the targe of the desired operation. + /// Specifies the version of the operation to use for this request. + /// Required. Indicates mode of the expiry time + /// The timeout parameter is expressed in seconds. For more information, see Setting Timeouts for Blob Service Operations. + /// Provides a client-generated, opaque value with a 1 KB character limit that is recorded in the analytics logs when storage analytics logging is enabled. + /// The time to set the blob to expiry + /// The Blob.SetExpiryAsync Message. + internal static Azure.Core.HttpMessage SetExpiryAsync_CreateMessage( + Azure.Core.Pipeline.HttpPipeline pipeline, + System.Uri resourceUri, + string version, + Azure.Storage.Blobs.Models.BlobExpiryOptions expiryOptions, + int? timeout = default, + string requestId = default, + string expiresOn = default) + { + // Validation + if (resourceUri == null) + { + throw new System.ArgumentNullException(nameof(resourceUri)); + } + if (version == null) + { + throw new System.ArgumentNullException(nameof(version)); + } + + // Create the request + Azure.Core.HttpMessage _message = pipeline.CreateMessage(); + Azure.Core.Request _request = _message.Request; + + // Set the endpoint + _request.Method = Azure.Core.RequestMethod.Put; + _request.Uri.Reset(resourceUri); + _request.Uri.AppendQuery("comp", "expiry", escapeValue: false); + if (timeout != null) { _request.Uri.AppendQuery("timeout", timeout.Value.ToString(System.Globalization.CultureInfo.InvariantCulture)); } + + // Add request headers + _request.Headers.SetValue("x-ms-version", version); + _request.Headers.SetValue("x-ms-expiry-option", expiryOptions.ToString()); + if (requestId != null) { _request.Headers.SetValue("x-ms-client-request-id", requestId); } + if (expiresOn != null) { _request.Headers.SetValue("x-ms-expiry-time", expiresOn); } + + return _message; + } + + /// + /// Create the Blob.SetExpiryAsync response or throw a failure exception. + /// + /// The ClientDiagnostics instance to use. + /// The raw Response. + /// The Blob.SetExpiryAsync Azure.Response{Azure.Storage.Blobs.Models.BlobSetExpiryInternal}. + internal static Azure.Response SetExpiryAsync_CreateResponse( + Azure.Core.Pipeline.ClientDiagnostics clientDiagnostics, + Azure.Response response) + { + // Process the response + switch (response.Status) + { + case 200: + { + // Create the result + Azure.Storage.Blobs.Models.BlobSetExpiryInternal _value = new Azure.Storage.Blobs.Models.BlobSetExpiryInternal(); + + // Get response headers + string _header; + if (response.Headers.TryGetValue("ETag", out _header)) + { + _value.ETag = new Azure.ETag(_header); + } + if (response.Headers.TryGetValue("Last-Modified", out _header)) + { + _value.LastModified = System.DateTimeOffset.Parse(_header, System.Globalization.CultureInfo.InvariantCulture); + } + + // Create the response + return Response.FromValue(_value, response); + } + default: + { + // Create the result + System.Xml.Linq.XDocument _xml = System.Xml.Linq.XDocument.Load(response.ContentStream, System.Xml.Linq.LoadOptions.PreserveWhitespace); + Azure.Storage.Blobs.Models.StorageError _value = Azure.Storage.Blobs.Models.StorageError.FromXml(_xml.Root); + + throw _value.CreateException(clientDiagnostics, response); + } + } + } + #endregion Blob.SetExpiryAsync + #region Blob.SetHttpHeadersAsync /// /// The Set HTTP Headers operation sets system properties on the blob @@ -17142,6 +17309,99 @@ namespace Azure.Storage.Blobs.Models } #endregion enum strings BlobErrorCode +#region enum strings BlobExpiryOptions +namespace Azure.Storage.Blobs.Models +{ + /// + /// Required. Indicates mode of the expiry time + /// + internal readonly struct BlobExpiryOptions : System.IEquatable + { + /// + /// The BlobExpiryOptions value. + /// + private readonly string _value; + + /// + /// Initializes a new instance of the structure. + /// + /// The string value of the instance. + public BlobExpiryOptions(string value) { _value = value ?? throw new System.ArgumentNullException(nameof(value)); } + + /// + /// NeverExpire + /// + public static Azure.Storage.Blobs.Models.BlobExpiryOptions NeverExpire { get; } = new BlobExpiryOptions(@"NeverExpire"); + + /// + /// RelativeToCreation + /// + public static Azure.Storage.Blobs.Models.BlobExpiryOptions RelativeToCreation { get; } = new BlobExpiryOptions(@"RelativeToCreation"); + + /// + /// RelativeToNow + /// + public static Azure.Storage.Blobs.Models.BlobExpiryOptions RelativeToNow { get; } = new BlobExpiryOptions(@"RelativeToNow"); + + /// + /// Absolute + /// + public static Azure.Storage.Blobs.Models.BlobExpiryOptions Absolute { get; } = new BlobExpiryOptions(@"Absolute"); + + /// + /// Determines if two values are the same. + /// + /// The first to compare. + /// The second to compare. + /// True if and are the same; otherwise, false. + public static bool operator ==(Azure.Storage.Blobs.Models.BlobExpiryOptions left, Azure.Storage.Blobs.Models.BlobExpiryOptions right) => left.Equals(right); + + /// + /// Determines if two values are different. + /// + /// The first to compare. + /// The second to compare. + /// True if and are different; otherwise, false. + public static bool operator !=(Azure.Storage.Blobs.Models.BlobExpiryOptions left, Azure.Storage.Blobs.Models.BlobExpiryOptions right) => !left.Equals(right); + + /// + /// Converts a string to a . + /// + /// The string value to convert. + /// The BlobExpiryOptions value. + public static implicit operator BlobExpiryOptions(string value) => new Azure.Storage.Blobs.Models.BlobExpiryOptions(value); + + /// + /// Check if two instances are equal. + /// + /// The instance to compare to. + /// True if they're equal, false otherwise. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is Azure.Storage.Blobs.Models.BlobExpiryOptions other && Equals(other); + + /// + /// Check if two instances are equal. + /// + /// The instance to compare to. + /// True if they're equal, false otherwise. + public bool Equals(Azure.Storage.Blobs.Models.BlobExpiryOptions other) => string.Equals(_value, other._value, System.StringComparison.Ordinal); + + /// + /// Get a hash code for the . + /// + /// Hash code for the BlobExpiryOptions. + [System.ComponentModel.EditorBrowsable(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + + /// + /// Convert the to a string. + /// + /// String representation of the BlobExpiryOptions. + public override string ToString() => _value; + } +} +#endregion enum strings BlobExpiryOptions + #region class BlobGeoReplication namespace Azure.Storage.Blobs.Models { @@ -17599,6 +17859,11 @@ public partial class BlobItemProperties /// public string EncryptionScope { get; internal set; } + /// + /// Expiry-Time + /// + public System.DateTimeOffset? ExpiresOn { get; internal set; } + /// /// IsSealed /// @@ -17780,6 +18045,11 @@ internal static Azure.Storage.Blobs.Models.BlobItemProperties FromXml(System.Xml { _value.EncryptionScope = _child.Value; } + _child = element.Element(System.Xml.Linq.XName.Get("Expiry-Time", "")); + if (_child != null) + { + _value.ExpiresOn = System.DateTimeOffset.Parse(_child.Value, System.Globalization.CultureInfo.InvariantCulture); + } _child = element.Element(System.Xml.Linq.XName.Get("IsSealed", "")); if (_child != null) { @@ -17827,7 +18097,7 @@ public static partial class BlobsModelFactory /// public static BlobItemProperties BlobItemProperties( bool accessTierInferred, - string copyProgress = default, + string copyStatusDescription = default, string contentType = default, string contentEncoding = default, string contentLanguage = default, @@ -17842,8 +18112,8 @@ public static BlobItemProperties BlobItemProperties( string copyId = default, Azure.Storage.Blobs.Models.CopyStatus? copyStatus = default, System.Uri copySource = default, + string copyProgress = default, long? contentLength = default, - string copyStatusDescription = default, bool? serverEncrypted = default, bool? incrementalCopy = default, string destinationSnapshot = default, @@ -17853,6 +18123,7 @@ public static BlobItemProperties BlobItemProperties( Azure.Storage.Blobs.Models.ArchiveStatus? archiveStatus = default, string customerProvidedKeySha256 = default, string encryptionScope = default, + System.DateTimeOffset? expiresOn = default, bool? isSealed = default, Azure.ETag? eTag = default, System.DateTimeOffset? createdOn = default, @@ -17863,7 +18134,7 @@ public static BlobItemProperties BlobItemProperties( return new BlobItemProperties() { AccessTierInferred = accessTierInferred, - CopyProgress = copyProgress, + CopyStatusDescription = copyStatusDescription, ContentType = contentType, ContentEncoding = contentEncoding, ContentLanguage = contentLanguage, @@ -17878,8 +18149,8 @@ public static BlobItemProperties BlobItemProperties( CopyId = copyId, CopyStatus = copyStatus, CopySource = copySource, + CopyProgress = copyProgress, ContentLength = contentLength, - CopyStatusDescription = copyStatusDescription, ServerEncrypted = serverEncrypted, IncrementalCopy = incrementalCopy, DestinationSnapshot = destinationSnapshot, @@ -17889,6 +18160,7 @@ public static BlobItemProperties BlobItemProperties( ArchiveStatus = archiveStatus, CustomerProvidedKeySha256 = customerProvidedKeySha256, EncryptionScope = encryptionScope, + ExpiresOn = expiresOn, IsSealed = isSealed, ETag = eTag, CreatedOn = createdOn, @@ -18312,6 +18584,11 @@ public partial class BlobProperties /// public long TagCount { get; internal set; } + /// + /// The time this blob will expire. + /// + public System.DateTimeOffset ExpiresOn { get; internal set; } + /// /// If this blob has been sealed /// @@ -18339,39 +18616,40 @@ public static BlobProperties BlobProperties( long contentLength, string contentType, Azure.ETag eTag, + byte[] contentHash, Azure.Storage.Blobs.Models.LeaseStatus leaseStatus, - string contentEncoding, string contentDisposition, string contentLanguage, string cacheControl, long blobSequenceNumber, - Azure.Storage.Blobs.Models.LeaseState leaseState, string acceptRanges, - Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration, + Azure.Storage.Blobs.Models.LeaseState leaseState, int blobCommittedBlockCount, - string destinationSnapshot, + Azure.Storage.Blobs.Models.LeaseDurationType leaseDuration, bool isServerEncrypted, - bool isIncrementalCopy, + string destinationSnapshot, string encryptionKeySha256, - Azure.Storage.Blobs.Models.CopyStatus copyStatus, + bool isIncrementalCopy, string encryptionScope, - System.Uri copySource, + Azure.Storage.Blobs.Models.CopyStatus copyStatus, string accessTier, - string copyProgress, + System.Uri copySource, bool accessTierInferred, - string copyId, + string copyProgress, string archiveStatus, - string copyStatusDescription, + string copyId, System.DateTimeOffset accessTierChangedOn, - System.DateTimeOffset copyCompletedOn, + string copyStatusDescription, string versionId, - Azure.Storage.Blobs.Models.BlobType blobType, + System.DateTimeOffset copyCompletedOn, bool isCurrentVersion, - System.Collections.Generic.IDictionary metadata, + Azure.Storage.Blobs.Models.BlobType blobType, long tagCount, + System.Collections.Generic.IDictionary metadata, + System.DateTimeOffset expiresOn, System.DateTimeOffset createdOn, bool isSealed, - byte[] contentHash) + string contentEncoding) { return new BlobProperties() { @@ -18379,39 +18657,40 @@ public static BlobProperties BlobProperties( ContentLength = contentLength, ContentType = contentType, ETag = eTag, + ContentHash = contentHash, LeaseStatus = leaseStatus, - ContentEncoding = contentEncoding, ContentDisposition = contentDisposition, ContentLanguage = contentLanguage, CacheControl = cacheControl, BlobSequenceNumber = blobSequenceNumber, - LeaseState = leaseState, AcceptRanges = acceptRanges, - LeaseDuration = leaseDuration, + LeaseState = leaseState, BlobCommittedBlockCount = blobCommittedBlockCount, - DestinationSnapshot = destinationSnapshot, + LeaseDuration = leaseDuration, IsServerEncrypted = isServerEncrypted, - IsIncrementalCopy = isIncrementalCopy, + DestinationSnapshot = destinationSnapshot, EncryptionKeySha256 = encryptionKeySha256, - CopyStatus = copyStatus, + IsIncrementalCopy = isIncrementalCopy, EncryptionScope = encryptionScope, - CopySource = copySource, + CopyStatus = copyStatus, AccessTier = accessTier, - CopyProgress = copyProgress, + CopySource = copySource, AccessTierInferred = accessTierInferred, - CopyId = copyId, + CopyProgress = copyProgress, ArchiveStatus = archiveStatus, - CopyStatusDescription = copyStatusDescription, + CopyId = copyId, AccessTierChangedOn = accessTierChangedOn, - CopyCompletedOn = copyCompletedOn, + CopyStatusDescription = copyStatusDescription, VersionId = versionId, - BlobType = blobType, + CopyCompletedOn = copyCompletedOn, IsCurrentVersion = isCurrentVersion, - Metadata = metadata, + BlobType = blobType, TagCount = tagCount, + Metadata = metadata, + ExpiresOn = expiresOn, CreatedOn = createdOn, IsSealed = isSealed, - ContentHash = contentHash, + ContentEncoding = contentEncoding, }; } } @@ -18747,6 +19026,33 @@ public static BlobServiceStatistics BlobServiceStatistics( } #endregion class BlobServiceStatistics +#region class BlobSetExpiryInternal +namespace Azure.Storage.Blobs.Models +{ + /// + /// BlobSetExpiryInternal + /// + internal partial class BlobSetExpiryInternal + { + /// + /// The ETag contains a value that you can use to perform operations conditionally. If the request version is 2011-08-18 or newer, the ETag value will be in quotes. + /// + public Azure.ETag ETag { get; internal set; } + + /// + /// Returns the date and time the container was last modified. Any operation that modifies the blob, including an update of the blob's metadata or properties, changes the last-modified time of the blob. + /// + public System.DateTimeOffset LastModified { get; internal set; } + + /// + /// Prevent direct instantiation of BlobSetExpiryInternal instances. + /// You can use BlobsModelFactory.BlobSetExpiryInternal instead. + /// + internal BlobSetExpiryInternal() { } + } +} +#endregion class BlobSetExpiryInternal + #region class BlobSignedIdentifier namespace Azure.Storage.Blobs.Models { diff --git a/sdk/storage/Azure.Storage.Blobs/swagger/readme.md b/sdk/storage/Azure.Storage.Blobs/swagger/readme.md index 3e29e2b7c87f..97d50b05a60f 100644 --- a/sdk/storage/Azure.Storage.Blobs/swagger/readme.md +++ b/sdk/storage/Azure.Storage.Blobs/swagger/readme.md @@ -1428,6 +1428,25 @@ directive: $.put.responses["200"]["x-az-response-name"] = "AppendBlobSealInternal"; ``` +### Make BlobSetExpiryResult internal +``` yaml +directive: +- from: swagger-document + where: $["x-ms-paths"]["/{containerName}/{blob}?comp=expiry"] + transform: > + $.put.responses["200"]["x-az-public"] = false; + $.put.responses["200"]["x-az-response-name"] = "BlobSetExpiryInternal"; +``` + +### Make BlobExpiryOptions internal +``` yaml +directive: +- from: swagger-document + where: $.parameters + transform: > + $.BlobExpiryOptions["x-az-public"] = false; +``` + ### Treat the API version as a parameter instead of a constant ``` yaml directive: