Skip to content

Commit b613be3

Browse files
committed
Stg87 protocol layer (Azure#4374)
* storage stg87 protocol layer
1 parent e48cf92 commit b613be3

File tree

6 files changed

+436
-51
lines changed

6 files changed

+436
-51
lines changed

sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/rest_client.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
9999
Nullable<std::string> EncryptionScope;
100100
Nullable<std::string> CreatedOn;
101101
Nullable<std::string> ExpiresOn;
102+
Nullable<std::string> EncryptionContext;
102103
std::string ETag;
103104
};
104105
/**
@@ -412,6 +413,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
412413
Nullable<int64_t> LeaseDuration;
413414
Nullable<std::string> ExpiryOptions;
414415
Nullable<std::string> ExpiresOn;
416+
Nullable<std::string> EncryptionContext;
415417
};
416418
static Response<Models::CreatePathResult> Create(
417419
Core::Http::_internal::HttpPipeline& pipeline,

sdk/storage/azure-storage-files-datalake/src/rest_client.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
126126
{
127127
vectorElement2.ExpiresOn = var0["expiryTime"].get<std::string>();
128128
}
129+
if (var0.count("EncryptionContext") != 0)
130+
{
131+
vectorElement2.EncryptionContext = var0["EncryptionContext"].get<std::string>();
132+
}
129133
if (var0.count("etag") != 0)
130134
{
131135
vectorElement2.ETag = var0["etag"].get<std::string>();
@@ -297,6 +301,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake {
297301
{
298302
request.SetHeader("x-ms-expiry-time", options.ExpiresOn.Value());
299303
}
304+
if (options.EncryptionContext.HasValue() && !options.EncryptionContext.Value().empty())
305+
{
306+
request.SetHeader("x-ms-encryption-context", options.EncryptionContext.Value());
307+
}
300308
auto pRawResponse = pipeline.Send(request, context);
301309
auto httpStatusCode = pRawResponse->GetStatusCode();
302310
if (httpStatusCode != Core::Http::HttpStatusCode::Created)

sdk/storage/azure-storage-files-datalake/swagger/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,6 +234,7 @@ directive:
234234
$.Path.properties["contentLength"]["x-ms-client-name"] = "FileSize";
235235
$.Path.properties["isDirectory"]["x-ms-client-default"] = false;
236236
$.Path.properties["EncryptionScope"]["x-nullable"] = true;
237+
$.Path.properties["EncryptionContext"]["x-nullable"] = true;
237238
$.Path.properties["creationTime"] = {"type": "string", "x-ms-client-name": "CreatedOn", "x-nullable": true};
238239
$.Path.properties["expiryTime"] = {"type": "string", "x-ms-client-name": "ExpiresOn", "x-nullable": true};
239240
$.Path.properties["etag"] = {"type": "string", "x-ms-format": "string", "x-ms-client-default": "", "x-ms-client-name": "ETag"};

sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/rest_client.hpp

Lines changed: 75 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
3131
/**
3232
* The version used for the operations to Azure storage services.
3333
*/
34-
constexpr static const char* ApiVersion = "2021-12-02";
34+
constexpr static const char* ApiVersion = "2022-11-02";
3535
} // namespace _detail
3636
namespace Models {
3737
/**
@@ -627,6 +627,21 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
627627
*/
628628
DateTime LastModified;
629629
};
630+
/**
631+
* @brief Valid value is backup.
632+
*/
633+
class ShareTokenIntent final {
634+
public:
635+
ShareTokenIntent() = default;
636+
explicit ShareTokenIntent(std::string value) : m_value(std::move(value)) {}
637+
bool operator==(const ShareTokenIntent& other) const { return m_value == other.m_value; }
638+
bool operator!=(const ShareTokenIntent& other) const { return !(*this == other); }
639+
const std::string& ToString() const { return m_value; }
640+
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareTokenIntent Backup;
641+
642+
private:
643+
std::string m_value;
644+
};
630645
/**
631646
* @brief Response type for #Azure::Storage::Files::Shares::ShareClient::CreatePermission.
632647
*/
@@ -1942,6 +1957,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
19421957
struct CreateSharePermissionOptions final
19431958
{
19441959
Models::_detail::SharePermission SharePermission;
1960+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
19451961
};
19461962
static Response<Models::CreateSharePermissionResult> CreatePermission(
19471963
Core::Http::_internal::HttpPipeline& pipeline,
@@ -1951,6 +1967,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
19511967
struct GetSharePermissionOptions final
19521968
{
19531969
std::string FilePermissionKey;
1970+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
19541971
};
19551972
static Response<Models::_detail::SharePermission> GetPermission(
19561973
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2012,13 +2029,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
20122029
public:
20132030
struct CreateDirectoryOptions final
20142031
{
2032+
Nullable<bool> AllowTrailingDot;
20152033
std::map<std::string, std::string> Metadata;
20162034
Nullable<std::string> FilePermission;
20172035
Nullable<std::string> FilePermissionKey;
20182036
std::string FileAttributes;
20192037
Nullable<std::string> FileCreationTime;
20202038
Nullable<std::string> FileLastWriteTime;
20212039
Nullable<std::string> FileChangeTime;
2040+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
20222041
};
20232042
static Response<Models::CreateDirectoryResult> Create(
20242043
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2027,7 +2046,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
20272046
const Core::Context& context);
20282047
struct GetDirectoryPropertiesOptions final
20292048
{
2049+
Nullable<bool> AllowTrailingDot;
20302050
Nullable<std::string> Sharesnapshot;
2051+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
20312052
};
20322053
static Response<Models::DirectoryProperties> GetProperties(
20332054
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2036,6 +2057,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
20362057
const Core::Context& context);
20372058
struct DeleteDirectoryOptions final
20382059
{
2060+
Nullable<bool> AllowTrailingDot;
2061+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
20392062
};
20402063
static Response<Models::DeleteDirectoryResult> Delete(
20412064
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2050,6 +2073,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
20502073
Nullable<std::string> FileCreationTime;
20512074
Nullable<std::string> FileLastWriteTime;
20522075
Nullable<std::string> FileChangeTime;
2076+
Nullable<bool> AllowTrailingDot;
2077+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
20532078
};
20542079
static Response<Models::SetDirectoryPropertiesResult> SetProperties(
20552080
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2059,6 +2084,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
20592084
struct SetDirectoryMetadataOptions final
20602085
{
20612086
std::map<std::string, std::string> Metadata;
2087+
Nullable<bool> AllowTrailingDot;
2088+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
20622089
};
20632090
static Response<Models::SetDirectoryMetadataResult> SetMetadata(
20642091
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2073,6 +2100,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
20732100
Nullable<int32_t> MaxResults;
20742101
Nullable<Models::ListFilesIncludeFlags> Include;
20752102
Nullable<bool> IncludeExtendedInfo;
2103+
Nullable<bool> AllowTrailingDot;
2104+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
20762105
};
20772106
static Response<Models::_detail::ListFilesAndDirectoriesSegmentResponse>
20782107
ListFilesAndDirectoriesSegment(
@@ -2086,6 +2115,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
20862115
Nullable<int32_t> MaxResults;
20872116
Nullable<std::string> Sharesnapshot;
20882117
Nullable<bool> Recursive;
2118+
Nullable<bool> AllowTrailingDot;
2119+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
20892120
};
20902121
static Response<Models::_detail::ListHandlesResponse> ListHandles(
20912122
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2098,6 +2129,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
20982129
Nullable<std::string> Sharesnapshot;
20992130
std::string HandleId;
21002131
Nullable<bool> Recursive;
2132+
Nullable<bool> AllowTrailingDot;
2133+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
21012134
};
21022135
static Response<Models::_detail::ForceCloseDirectoryHandlesResult> ForceCloseHandles(
21032136
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2118,6 +2151,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
21182151
Nullable<std::string> FilePermission;
21192152
Nullable<std::string> FilePermissionKey;
21202153
std::map<std::string, std::string> Metadata;
2154+
Nullable<bool> AllowTrailingDot;
2155+
Nullable<bool> AllowSourceTrailingDot;
2156+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
21212157
};
21222158
static Response<Models::_detail::RenameDirectoryResult> Rename(
21232159
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2129,6 +2165,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
21292165
public:
21302166
struct CreateFileOptions final
21312167
{
2168+
Nullable<bool> AllowTrailingDot;
21322169
int64_t FileContentLength = int64_t();
21332170
Nullable<std::string> FileContentType;
21342171
Nullable<std::string> FileContentEncoding;
@@ -2144,6 +2181,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
21442181
Nullable<std::string> FileLastWriteTime;
21452182
Nullable<std::string> FileChangeTime;
21462183
Nullable<std::string> LeaseId;
2184+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
21472185
};
21482186
static Response<Models::CreateFileResult> Create(
21492187
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2152,9 +2190,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
21522190
const Core::Context& context);
21532191
struct DownloadFileOptions final
21542192
{
2193+
Nullable<bool> AllowTrailingDot;
21552194
Nullable<std::string> Range;
21562195
Nullable<bool> RangeGetContentMD5;
21572196
Nullable<std::string> LeaseId;
2197+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
21582198
};
21592199
static Response<Models::DownloadFileResult> Download(
21602200
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2163,8 +2203,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
21632203
const Core::Context& context);
21642204
struct GetFilePropertiesOptions final
21652205
{
2206+
Nullable<bool> AllowTrailingDot;
21662207
Nullable<std::string> Sharesnapshot;
21672208
Nullable<std::string> LeaseId;
2209+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
21682210
};
21692211
static Response<Models::FileProperties> GetProperties(
21702212
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2173,7 +2215,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
21732215
const Core::Context& context);
21742216
struct DeleteFileOptions final
21752217
{
2218+
Nullable<bool> AllowTrailingDot;
21762219
Nullable<std::string> LeaseId;
2220+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
21772221
};
21782222
static Response<Models::DeleteFileResult> Delete(
21792223
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2196,6 +2240,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
21962240
Nullable<std::string> FileLastWriteTime;
21972241
Nullable<std::string> FileChangeTime;
21982242
Nullable<std::string> LeaseId;
2243+
Nullable<bool> AllowTrailingDot;
2244+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
21992245
};
22002246
static Response<Models::SetFilePropertiesResult> SetHttpHeaders(
22012247
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2206,6 +2252,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
22062252
{
22072253
std::map<std::string, std::string> Metadata;
22082254
Nullable<std::string> LeaseId;
2255+
Nullable<bool> AllowTrailingDot;
2256+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
22092257
};
22102258
static Response<Models::SetFileMetadataResult> SetMetadata(
22112259
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2216,6 +2264,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
22162264
{
22172265
Nullable<int32_t> Duration;
22182266
Nullable<std::string> ProposedLeaseId;
2267+
Nullable<bool> AllowTrailingDot;
2268+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
22192269
};
22202270
static Response<Models::_detail::AcquireFileLeaseResult> AcquireLease(
22212271
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2225,6 +2275,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
22252275
struct ReleaseFileLeaseOptions final
22262276
{
22272277
std::string LeaseId;
2278+
Nullable<bool> AllowTrailingDot;
2279+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
22282280
};
22292281
static Response<Models::_detail::ReleaseFileLeaseResult> ReleaseLease(
22302282
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2235,6 +2287,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
22352287
{
22362288
std::string LeaseId;
22372289
Nullable<std::string> ProposedLeaseId;
2290+
Nullable<bool> AllowTrailingDot;
2291+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
22382292
};
22392293
static Response<Models::_detail::ChangeFileLeaseResult> ChangeLease(
22402294
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2244,6 +2298,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
22442298
struct BreakFileLeaseOptions final
22452299
{
22462300
Nullable<std::string> LeaseId;
2301+
Nullable<bool> AllowTrailingDot;
2302+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
22472303
};
22482304
static Response<Models::_detail::BreakFileLeaseResult> BreakLease(
22492305
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2257,6 +2313,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
22572313
Nullable<std::vector<uint8_t>> ContentMD5;
22582314
Nullable<std::string> LeaseId;
22592315
Nullable<Models::FileLastWrittenMode> FileLastWrittenMode;
2316+
Nullable<bool> AllowTrailingDot;
2317+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
22602318
};
22612319
static Response<Models::UploadFileRangeResult> UploadRange(
22622320
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2275,6 +2333,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
22752333
Nullable<std::string> LeaseId;
22762334
Nullable<std::string> CopySourceAuthorization;
22772335
Nullable<Models::FileLastWrittenMode> FileLastWrittenMode;
2336+
Nullable<bool> AllowTrailingDot;
2337+
Nullable<bool> AllowSourceTrailingDot;
22782338
};
22792339
static Response<Models::UploadFileRangeFromUriResult> UploadRangeFromUri(
22802340
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2287,6 +2347,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
22872347
Nullable<std::string> Prevsharesnapshot;
22882348
Nullable<std::string> Range;
22892349
Nullable<std::string> LeaseId;
2350+
Nullable<bool> AllowTrailingDot;
2351+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
22902352
};
22912353
static Response<Models::GetFileRangeListResult> GetRangeList(
22922354
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2307,6 +2369,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
23072369
Nullable<std::string> FileChangeTime;
23082370
Nullable<bool> SetArchiveAttribute;
23092371
Nullable<std::string> LeaseId;
2372+
Nullable<bool> AllowTrailingDot;
2373+
Nullable<bool> AllowSourceTrailingDot;
2374+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
23102375
};
23112376
static Response<Models::_detail::StartFileCopyResult> StartCopy(
23122377
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2317,6 +2382,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
23172382
{
23182383
std::string CopyId;
23192384
Nullable<std::string> LeaseId;
2385+
Nullable<bool> AllowTrailingDot;
2386+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
23202387
};
23212388
static Response<Models::AbortFileCopyResult> AbortCopy(
23222389
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2328,6 +2395,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
23282395
Nullable<std::string> Marker;
23292396
Nullable<int32_t> MaxResults;
23302397
Nullable<std::string> Sharesnapshot;
2398+
Nullable<bool> AllowTrailingDot;
2399+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
23312400
};
23322401
static Response<Models::_detail::ListHandlesResponse> ListHandles(
23332402
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2339,6 +2408,8 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
23392408
Nullable<std::string> Marker;
23402409
Nullable<std::string> Sharesnapshot;
23412410
std::string HandleId;
2411+
Nullable<bool> AllowTrailingDot;
2412+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
23422413
};
23432414
static Response<Models::_detail::ForceFileCloseHandlesResult> ForceCloseHandles(
23442415
Core::Http::_internal::HttpPipeline& pipeline,
@@ -2360,6 +2431,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
23602431
Nullable<std::string> FilePermissionKey;
23612432
std::map<std::string, std::string> Metadata;
23622433
Nullable<std::string> FileContentType;
2434+
Nullable<bool> AllowTrailingDot;
2435+
Nullable<bool> AllowSourceTrailingDot;
2436+
Nullable<Models::ShareTokenIntent> FileRequestIntent;
23632437
};
23642438
static Response<Models::_detail::RenameFileResult> Rename(
23652439
Core::Http::_internal::HttpPipeline& pipeline,

0 commit comments

Comments
 (0)