Skip to content

Commit

Permalink
convert ExpiresOn from string to DateTime.
Browse files Browse the repository at this point in the history
  • Loading branch information
microzchang committed Sep 13, 2022
1 parent 0fd902b commit 5ad319d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
Nullable<std::string> Acl;
Nullable<std::string> ProposedLeaseId;
Nullable<int64_t> LeaseDuration;
Nullable<std::string> ExpiresOn;
Nullable<DateTime> ExpiresOn;
};
static Response<Models::CreatePathResult> Create(
Core::Http::_internal::HttpPipeline& pipeline,
Expand Down
6 changes: 4 additions & 2 deletions sdk/storage/azure-storage-files-datalake/src/rest_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -274,9 +274,11 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
{
request.SetHeader("x-ms-lease-duration", std::to_string(options.LeaseDuration.Value()));
}
if (options.ExpiresOn.HasValue() && !options.ExpiresOn.Value().empty())
if (options.ExpiresOn.HasValue())
{
request.SetHeader("x-ms-expiry-time", options.ExpiresOn.Value());
request.SetHeader(
"x-ms-expiry-time",
options.ExpiresOn.Value().ToString(Azure::DateTime::DateFormat::Rfc1123));
}
auto pRawResponse = pipeline.Send(request, context);
auto httpStatusCode = pRawResponse->GetStatusCode();
Expand Down
1 change: 1 addition & 0 deletions sdk/storage/azure-storage-files-datalake/swagger/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ directive:
transform: >
$.Continuation["x-ms-client-name"] = "ContinuationToken";
$.EncryptionKeySha256["format"] = "byte";
$.PathExpiryTime["format"] = "date-time-rfc1123";
- from: swagger-document
where: $.definitions
transform: >
Expand Down

0 comments on commit 5ad319d

Please sign in to comment.