diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/rest_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/rest_client.hpp index 79878e13f8..8cf70b3eb8 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/rest_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/rest_client.hpp @@ -99,6 +99,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Nullable EncryptionScope; Nullable CreatedOn; Nullable ExpiresOn; + Nullable EncryptionContext; std::string ETag; }; /** @@ -412,6 +413,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { Nullable LeaseDuration; Nullable ExpiryOptions; Nullable ExpiresOn; + Nullable EncryptionContext; }; static Response Create( Core::Http::_internal::HttpPipeline& pipeline, diff --git a/sdk/storage/azure-storage-files-datalake/src/rest_client.cpp b/sdk/storage/azure-storage-files-datalake/src/rest_client.cpp index ff40ae8d81..6aaf59f61b 100644 --- a/sdk/storage/azure-storage-files-datalake/src/rest_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/rest_client.cpp @@ -126,6 +126,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { vectorElement2.ExpiresOn = var0["expiryTime"].get(); } + if (var0.count("EncryptionContext") != 0) + { + vectorElement2.EncryptionContext = var0["EncryptionContext"].get(); + } if (var0.count("etag") != 0) { vectorElement2.ETag = var0["etag"].get(); @@ -297,6 +301,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { { request.SetHeader("x-ms-expiry-time", options.ExpiresOn.Value()); } + if (options.EncryptionContext.HasValue() && !options.EncryptionContext.Value().empty()) + { + request.SetHeader("x-ms-encryption-context", options.EncryptionContext.Value()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) diff --git a/sdk/storage/azure-storage-files-datalake/swagger/README.md b/sdk/storage/azure-storage-files-datalake/swagger/README.md index 467d8e1890..55560fbfb6 100644 --- a/sdk/storage/azure-storage-files-datalake/swagger/README.md +++ b/sdk/storage/azure-storage-files-datalake/swagger/README.md @@ -234,6 +234,7 @@ directive: $.Path.properties["contentLength"]["x-ms-client-name"] = "FileSize"; $.Path.properties["isDirectory"]["x-ms-client-default"] = false; $.Path.properties["EncryptionScope"]["x-nullable"] = true; + $.Path.properties["EncryptionContext"]["x-nullable"] = true; $.Path.properties["creationTime"] = {"type": "string", "x-ms-client-name": "CreatedOn", "x-nullable": true}; $.Path.properties["expiryTime"] = {"type": "string", "x-ms-client-name": "ExpiresOn", "x-nullable": true}; $.Path.properties["etag"] = {"type": "string", "x-ms-format": "string", "x-ms-client-default": "", "x-ms-client-name": "ETag"}; diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/rest_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/rest_client.hpp index 78c2d8b5f0..3319678ce7 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/rest_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/rest_client.hpp @@ -31,7 +31,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * The version used for the operations to Azure storage services. */ - constexpr static const char* ApiVersion = "2021-12-02"; + constexpr static const char* ApiVersion = "2022-11-02"; } // namespace _detail namespace Models { /** @@ -627,6 +627,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { */ DateTime LastModified; }; + /** + * @brief Valid value is backup. + */ + class ShareTokenIntent final { + public: + ShareTokenIntent() = default; + explicit ShareTokenIntent(std::string value) : m_value(std::move(value)) {} + bool operator==(const ShareTokenIntent& other) const { return m_value == other.m_value; } + bool operator!=(const ShareTokenIntent& other) const { return !(*this == other); } + const std::string& ToString() const { return m_value; } + AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareTokenIntent Backup; + + private: + std::string m_value; + }; /** * @brief Response type for #Azure::Storage::Files::Shares::ShareClient::CreatePermission. */ @@ -1942,6 +1957,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { struct CreateSharePermissionOptions final { Models::_detail::SharePermission SharePermission; + Nullable FileRequestIntent; }; static Response CreatePermission( Core::Http::_internal::HttpPipeline& pipeline, @@ -1951,6 +1967,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { struct GetSharePermissionOptions final { std::string FilePermissionKey; + Nullable FileRequestIntent; }; static Response GetPermission( Core::Http::_internal::HttpPipeline& pipeline, @@ -2012,6 +2029,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { public: struct CreateDirectoryOptions final { + Nullable AllowTrailingDot; std::map Metadata; Nullable FilePermission; Nullable FilePermissionKey; @@ -2019,6 +2037,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FileCreationTime; Nullable FileLastWriteTime; Nullable FileChangeTime; + Nullable FileRequestIntent; }; static Response Create( Core::Http::_internal::HttpPipeline& pipeline, @@ -2027,7 +2046,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context); struct GetDirectoryPropertiesOptions final { + Nullable AllowTrailingDot; Nullable Sharesnapshot; + Nullable FileRequestIntent; }; static Response GetProperties( Core::Http::_internal::HttpPipeline& pipeline, @@ -2036,6 +2057,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context); struct DeleteDirectoryOptions final { + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response Delete( Core::Http::_internal::HttpPipeline& pipeline, @@ -2050,6 +2073,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FileCreationTime; Nullable FileLastWriteTime; Nullable FileChangeTime; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response SetProperties( Core::Http::_internal::HttpPipeline& pipeline, @@ -2059,6 +2084,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { struct SetDirectoryMetadataOptions final { std::map Metadata; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response SetMetadata( Core::Http::_internal::HttpPipeline& pipeline, @@ -2073,6 +2100,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable MaxResults; Nullable Include; Nullable IncludeExtendedInfo; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response ListFilesAndDirectoriesSegment( @@ -2086,6 +2115,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable MaxResults; Nullable Sharesnapshot; Nullable Recursive; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response ListHandles( Core::Http::_internal::HttpPipeline& pipeline, @@ -2098,6 +2129,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable Sharesnapshot; std::string HandleId; Nullable Recursive; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response ForceCloseHandles( Core::Http::_internal::HttpPipeline& pipeline, @@ -2118,6 +2151,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FilePermission; Nullable FilePermissionKey; std::map Metadata; + Nullable AllowTrailingDot; + Nullable AllowSourceTrailingDot; + Nullable FileRequestIntent; }; static Response Rename( Core::Http::_internal::HttpPipeline& pipeline, @@ -2129,6 +2165,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { public: struct CreateFileOptions final { + Nullable AllowTrailingDot; int64_t FileContentLength = int64_t(); Nullable FileContentType; Nullable FileContentEncoding; @@ -2144,6 +2181,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FileLastWriteTime; Nullable FileChangeTime; Nullable LeaseId; + Nullable FileRequestIntent; }; static Response Create( Core::Http::_internal::HttpPipeline& pipeline, @@ -2152,9 +2190,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context); struct DownloadFileOptions final { + Nullable AllowTrailingDot; Nullable Range; Nullable RangeGetContentMD5; Nullable LeaseId; + Nullable FileRequestIntent; }; static Response Download( Core::Http::_internal::HttpPipeline& pipeline, @@ -2163,8 +2203,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context); struct GetFilePropertiesOptions final { + Nullable AllowTrailingDot; Nullable Sharesnapshot; Nullable LeaseId; + Nullable FileRequestIntent; }; static Response GetProperties( Core::Http::_internal::HttpPipeline& pipeline, @@ -2173,7 +2215,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context); struct DeleteFileOptions final { + Nullable AllowTrailingDot; Nullable LeaseId; + Nullable FileRequestIntent; }; static Response Delete( Core::Http::_internal::HttpPipeline& pipeline, @@ -2196,6 +2240,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FileLastWriteTime; Nullable FileChangeTime; Nullable LeaseId; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response SetHttpHeaders( Core::Http::_internal::HttpPipeline& pipeline, @@ -2206,6 +2252,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::map Metadata; Nullable LeaseId; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response SetMetadata( Core::Http::_internal::HttpPipeline& pipeline, @@ -2216,6 +2264,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { Nullable Duration; Nullable ProposedLeaseId; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response AcquireLease( Core::Http::_internal::HttpPipeline& pipeline, @@ -2225,6 +2275,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { struct ReleaseFileLeaseOptions final { std::string LeaseId; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response ReleaseLease( Core::Http::_internal::HttpPipeline& pipeline, @@ -2235,6 +2287,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::string LeaseId; Nullable ProposedLeaseId; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response ChangeLease( Core::Http::_internal::HttpPipeline& pipeline, @@ -2244,6 +2298,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { struct BreakFileLeaseOptions final { Nullable LeaseId; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response BreakLease( Core::Http::_internal::HttpPipeline& pipeline, @@ -2257,6 +2313,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable> ContentMD5; Nullable LeaseId; Nullable FileLastWrittenMode; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response UploadRange( Core::Http::_internal::HttpPipeline& pipeline, @@ -2275,6 +2333,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable LeaseId; Nullable CopySourceAuthorization; Nullable FileLastWrittenMode; + Nullable AllowTrailingDot; + Nullable AllowSourceTrailingDot; }; static Response UploadRangeFromUri( Core::Http::_internal::HttpPipeline& pipeline, @@ -2287,6 +2347,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable Prevsharesnapshot; Nullable Range; Nullable LeaseId; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response GetRangeList( Core::Http::_internal::HttpPipeline& pipeline, @@ -2307,6 +2369,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FileChangeTime; Nullable SetArchiveAttribute; Nullable LeaseId; + Nullable AllowTrailingDot; + Nullable AllowSourceTrailingDot; + Nullable FileRequestIntent; }; static Response StartCopy( Core::Http::_internal::HttpPipeline& pipeline, @@ -2317,6 +2382,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::string CopyId; Nullable LeaseId; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response AbortCopy( Core::Http::_internal::HttpPipeline& pipeline, @@ -2328,6 +2395,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable Marker; Nullable MaxResults; Nullable Sharesnapshot; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response ListHandles( Core::Http::_internal::HttpPipeline& pipeline, @@ -2339,6 +2408,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable Marker; Nullable Sharesnapshot; std::string HandleId; + Nullable AllowTrailingDot; + Nullable FileRequestIntent; }; static Response ForceCloseHandles( Core::Http::_internal::HttpPipeline& pipeline, @@ -2360,6 +2431,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { Nullable FilePermissionKey; std::map Metadata; Nullable FileContentType; + Nullable AllowTrailingDot; + Nullable AllowSourceTrailingDot; + Nullable FileRequestIntent; }; static Response Rename( Core::Http::_internal::HttpPipeline& pipeline, diff --git a/sdk/storage/azure-storage-files-shares/src/rest_client.cpp b/sdk/storage/azure-storage-files-shares/src/rest_client.cpp index 746db51fe0..83c3c74282 100644 --- a/sdk/storage/azure-storage-files-shares/src/rest_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/rest_client.cpp @@ -106,6 +106,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const ShareRootSquash ShareRootSquash::RootSquash("RootSquash"); const ShareRootSquash ShareRootSquash::AllSquash("AllSquash"); const DeleteSnapshotsOption DeleteSnapshotsOption::Include("include"); + const ShareTokenIntent ShareTokenIntent::Backup("backup"); FileAttributes::FileAttributes(const std::string& value) { const std::string delimiter = " | "; @@ -312,7 +313,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.SetHeader("Content-Length", std::to_string(requestBody.Length())); request.GetUrl().AppendQueryParameter("restype", "service"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -332,7 +333,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("restype", "service"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); (void)options; auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); @@ -564,7 +565,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { _internal::UrlEncodeQueryParameter( ListSharesIncludeFlagsToString(options.Include.Value()))); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -917,7 +918,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-access-tier", options.AccessTier.Value().ToString()); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.EnabledProtocols.HasValue() && !options.EnabledProtocols.Value().ToString().empty()) { @@ -952,7 +953,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.GetUrl().AppendQueryParameter( "sharesnapshot", _internal::UrlEncodeQueryParameter(options.Sharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -1054,7 +1055,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.GetUrl().AppendQueryParameter( "sharesnapshot", _internal::UrlEncodeQueryParameter(options.Sharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.DeleteSnapshots.HasValue() && !options.DeleteSnapshots.Value().ToString().empty()) { request.SetHeader("x-ms-delete-snapshots", options.DeleteSnapshots.Value().ToString()); @@ -1090,7 +1091,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-proposed-lease-id", options.ProposedLeaseId.Value()); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1124,7 +1125,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1161,7 +1162,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-proposed-lease-id", options.ProposedLeaseId.Value()); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1195,7 +1196,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1233,7 +1234,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( @@ -1266,7 +1267,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-meta-" + p.first, p.second); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -1300,7 +1301,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.SetHeader("Content-Length", std::to_string(requestBody.Length())); request.GetUrl().AppendQueryParameter("restype", "share"); request.GetUrl().AppendQueryParameter("comp", "filepermission"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -1325,7 +1331,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-file-permission-key", options.FilePermissionKey); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1351,7 +1362,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("restype", "share"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.Quota.HasValue()) { request.SetHeader("x-ms-share-quota", std::to_string(options.Quota.Value())); @@ -1394,7 +1405,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-meta-" + p.first, p.second); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -1420,7 +1431,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("restype", "share"); request.GetUrl().AppendQueryParameter("comp", "acl"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -1567,7 +1578,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.SetHeader("Content-Length", std::to_string(requestBody.Length())); request.GetUrl().AppendQueryParameter("restype", "share"); request.GetUrl().AppendQueryParameter("comp", "acl"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -1594,7 +1605,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("restype", "share"); request.GetUrl().AppendQueryParameter("comp", "stats"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -1665,11 +1676,16 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("restype", "directory"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } for (const auto& p : options.Metadata) { request.SetHeader("x-ms-meta-" + p.first, p.second); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.FilePermission.HasValue() && !options.FilePermission.Value().empty()) { request.SetHeader("x-ms-file-permission", options.FilePermission.Value()); @@ -1694,6 +1710,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-file-change-time", options.FileChangeTime.Value()); } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -1743,12 +1764,22 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url); request.GetUrl().AppendQueryParameter("restype", "directory"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( "sharesnapshot", _internal::UrlEncodeQueryParameter(options.Sharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1804,8 +1835,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto request = Core::Http::Request(Core::Http::HttpMethod::Delete, url); request.GetUrl().AppendQueryParameter("restype", "directory"); - request.SetHeader("x-ms-version", "2021-12-02"); - (void)options; + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -1824,7 +1864,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("restype", "directory"); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.FilePermission.HasValue() && !options.FilePermission.Value().empty()) { request.SetHeader("x-ms-file-permission", options.FilePermission.Value()); @@ -1849,6 +1889,16 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-file-change-time", options.FileChangeTime.Value()); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1904,7 +1954,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-meta-" + p.first, p.second); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -1948,7 +2008,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.GetUrl().AppendQueryParameter( "maxresults", std::to_string(options.MaxResults.Value())); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.Include.HasValue() && !ListFilesIncludeFlagsToString(options.Include.Value()).empty()) { @@ -1962,6 +2022,16 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.SetHeader( "x-ms-file-extended-info", options.IncludeExtendedInfo.Value() ? "true" : "false"); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2331,7 +2401,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-recursive", options.Recursive.Value() ? "true" : "false"); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2503,7 +2583,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-recursive", options.Recursive.Value() ? "true" : "false"); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2531,7 +2621,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("restype", "directory"); request.GetUrl().AppendQueryParameter("comp", "rename"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (!options.RenameSource.empty()) { request.SetHeader("x-ms-file-rename-source", options.RenameSource); @@ -2583,6 +2673,22 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-meta-" + p.first, p.second); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.AllowSourceTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-source-allow-trailing-dot", + options.AllowSourceTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -2618,7 +2724,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context) { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); - request.SetHeader("x-ms-version", "2021-12-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + request.SetHeader("x-ms-version", "2022-11-02"); request.SetHeader("x-ms-content-length", std::to_string(options.FileContentLength)); request.SetHeader("x-ms-type", "file"); if (options.FileContentType.HasValue() && !options.FileContentType.Value().empty()) @@ -2680,6 +2791,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -2728,7 +2844,12 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context) { auto request = Core::Http::Request(Core::Http::HttpMethod::Get, url, false); - request.SetHeader("x-ms-version", "2021-12-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + request.SetHeader("x-ms-version", "2022-11-02"); if (options.Range.HasValue() && !options.Range.Value().empty()) { request.SetHeader("x-ms-range", options.Range.Value()); @@ -2742,6 +2863,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (!(httpStatusCode == Core::Http::HttpStatusCode::Ok @@ -2898,16 +3024,26 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context) { auto request = Core::Http::Request(Core::Http::HttpMethod::Head, url); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } if (options.Sharesnapshot.HasValue() && !options.Sharesnapshot.Value().empty()) { request.GetUrl().AppendQueryParameter( "sharesnapshot", _internal::UrlEncodeQueryParameter(options.Sharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3031,11 +3167,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context) { auto request = Core::Http::Request(Core::Http::HttpMethod::Delete, url); - request.SetHeader("x-ms-version", "2021-12-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -3053,7 +3199,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("comp", "properties"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.FileContentLength.HasValue()) { request.SetHeader("x-ms-content-length", std::to_string(options.FileContentLength.Value())); @@ -3113,6 +3259,16 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3167,11 +3323,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-meta-" + p.first, p.second); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3201,7 +3367,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-proposed-lease-id", options.ProposedLeaseId.Value()); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -3229,7 +3405,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3260,7 +3446,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-proposed-lease-id", options.ProposedLeaseId.Value()); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3288,7 +3484,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -3325,7 +3531,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("Content-MD5", Core::Convert::Base64Encode(options.ContentMD5.Value())); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -3336,6 +3542,16 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.SetHeader( "x-ms-file-last-write-time", options.FileLastWrittenMode.Value().ToString()); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -3402,7 +3618,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { "x-ms-source-if-none-match-crc64", Core::Convert::Base64Encode(options.SourceIfNoneMatchCrc64.Value())); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); @@ -3419,6 +3635,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.SetHeader( "x-ms-file-last-write-time", options.FileLastWrittenMode.Value().ToString()); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.AllowSourceTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-source-allow-trailing-dot", + options.AllowSourceTrailingDot.Value() ? "true" : "false"); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Created) @@ -3462,7 +3689,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { "prevsharesnapshot", _internal::UrlEncodeQueryParameter(options.Prevsharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.Range.HasValue() && !options.Range.Value().empty()) { request.SetHeader("x-ms-range", options.Range.Value()); @@ -3471,6 +3698,16 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3576,7 +3813,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { const Core::Context& context) { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); for (const auto& p : options.Metadata) { request.SetHeader("x-ms-meta-" + p.first, p.second); @@ -3629,6 +3866,22 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.AllowSourceTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-source-allow-trailing-dot", + options.AllowSourceTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Accepted) @@ -3658,11 +3911,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { "copyid", _internal::UrlEncodeQueryParameter(options.CopyId)); } request.SetHeader("x-ms-copy-action", "abort"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (options.LeaseId.HasValue() && !options.LeaseId.Value().empty()) { request.SetHeader("x-ms-lease-id", options.LeaseId.Value()); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::NoContent) @@ -3695,7 +3958,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { request.GetUrl().AppendQueryParameter( "sharesnapshot", _internal::UrlEncodeQueryParameter(options.Sharesnapshot.Value())); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3863,7 +4136,17 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-handle-id", options.HandleId); } - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) @@ -3890,7 +4173,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto request = Core::Http::Request(Core::Http::HttpMethod::Put, url); request.GetUrl().AppendQueryParameter("comp", "rename"); - request.SetHeader("x-ms-version", "2021-12-02"); + request.SetHeader("x-ms-version", "2022-11-02"); if (!options.RenameSource.empty()) { request.SetHeader("x-ms-file-rename-source", options.RenameSource); @@ -3946,6 +4229,22 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { request.SetHeader("x-ms-content-type", options.FileContentType.Value()); } + if (options.AllowTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-allow-trailing-dot", options.AllowTrailingDot.Value() ? "true" : "false"); + } + if (options.AllowSourceTrailingDot.HasValue()) + { + request.SetHeader( + "x-ms-source-allow-trailing-dot", + options.AllowSourceTrailingDot.Value() ? "true" : "false"); + } + if (options.FileRequestIntent.HasValue() + && !options.FileRequestIntent.Value().ToString().empty()) + { + request.SetHeader("x-ms-file-request-intent", options.FileRequestIntent.Value().ToString()); + } auto pRawResponse = pipeline.Send(request, context); auto httpStatusCode = pRawResponse->GetStatusCode(); if (httpStatusCode != Core::Http::HttpStatusCode::Ok) diff --git a/sdk/storage/azure-storage-files-shares/swagger/README.md b/sdk/storage/azure-storage-files-shares/swagger/README.md index d35b2a83fb..1ba2ae6de5 100644 --- a/sdk/storage/azure-storage-files-shares/swagger/README.md +++ b/sdk/storage/azure-storage-files-shares/swagger/README.md @@ -9,7 +9,7 @@ package-name: azure-storage-files-shares namespace: Azure::Storage::Files::Shares output-folder: generated clear-output-folder: true -input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/storage/data-plane/Microsoft.FileStorage/preview/2021-12-02/file.json +input-file: https://raw.githubusercontent.com/Azure/azure-rest-api-specs/main/specification/storage/data-plane/Microsoft.FileStorage/preview/2022-11-02/file.json ``` ## ModelFour Options @@ -79,13 +79,13 @@ directive: "name": "ApiVersion", "modelAsString": false }, - "enum": ["2021-12-02"], + "enum": ["2022-11-02"], "description": "The version used for the operations to Azure storage services." }; - from: swagger-document where: $.parameters transform: > - $.ApiVersionParameter.enum[0] = "2021-12-02"; + $.ApiVersionParameter.enum[0] = "2022-11-02"; ``` ### Rename Operations @@ -222,6 +222,7 @@ directive: $.ShareEnabledProtocols["x-ms-enum"]["values"] = [{"value": "SMB", "name": "Smb"},{"value": "NFS", "name": "Nfs"}]; delete $.FileChangeTime.format; $.FileLastWriteTimeMode["x-ms-enum"]["values"] = [{"value": "now", "name": "Now"},{"value": "preserve", "name": "Preserve"}]; + $.FileRequestIntent["x-ms-enum"]["values"] = [{"value": "__placeHolder", "name": "__placeHolder"}, {"value": "backup", "name": "Backup"}]; - from: swagger-document where: $.definitions transform: >