Skip to content

Commit

Permalink
Storage/STG95 Files OAuth - full data plane support (#5759)
Browse files Browse the repository at this point in the history
* File OAuth

* Remove comment

* update test record
  • Loading branch information
microzchang authored Jul 10, 2024
1 parent f8130a2 commit a4333f3
Show file tree
Hide file tree
Showing 9 changed files with 260 additions and 77 deletions.
2 changes: 1 addition & 1 deletion sdk/storage/assets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "cpp",
"TagPrefix": "cpp/storage",
"Tag": "cpp/storage_75931731d9"
"Tag": "cpp/storage_8eb3907e27"
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "2024-08-04";
constexpr static const char* ApiVersion = "2024-11-04";
} // namespace _detail
namespace Models {
/**
Expand Down Expand Up @@ -138,6 +138,27 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
*/
SmbSettings Settings;
};
/**
* @brief Valid value is backup.
*/
class ShareTokenIntent final {
public:
/** Constructs a new ShareTokenIntent instance */
ShareTokenIntent() = default;
/** Constructs a new ShareTokenIntent from a string. */
explicit ShareTokenIntent(std::string value) : m_value(std::move(value)) {}
/** Compares with another ShareTokenIntent. */
bool operator==(const ShareTokenIntent& other) const { return m_value == other.m_value; }
/** Compares with another ShareTokenIntent. */
bool operator!=(const ShareTokenIntent& other) const { return !(*this == other); }
/** Converts the value to a string. */
const std::string& ToString() const { return m_value; }
/** Constant value of type ShareTokenIntent: Backup */
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareTokenIntent Backup;

private:
std::string m_value;
};
/**
* @brief Response type for #Azure::Storage::Files::Shares::ShareServiceClient::SetProperties.
*/
Expand Down Expand Up @@ -747,27 +768,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
*/
DateTime LastModified;
};
/**
* @brief Valid value is backup.
*/
class ShareTokenIntent final {
public:
/** Constructs a new ShareTokenIntent instance */
ShareTokenIntent() = default;
/** Constructs a new ShareTokenIntent from a string. */
explicit ShareTokenIntent(std::string value) : m_value(std::move(value)) {}
/** Compares with another ShareTokenIntent. */
bool operator==(const ShareTokenIntent& other) const { return m_value == other.m_value; }
/** Compares with another ShareTokenIntent. */
bool operator!=(const ShareTokenIntent& other) const { return !(*this == other); }
/** Converts the value to a string. */
const std::string& ToString() const { return m_value; }
/** Constant value of type ShareTokenIntent: Backup */
AZ_STORAGE_FILES_SHARES_DLLEXPORT const static ShareTokenIntent Backup;

private:
std::string m_value;
};
/**
* @brief Response type for #Azure::Storage::Files::Shares::ShareClient::CreatePermission.
*/
Expand Down Expand Up @@ -2061,6 +2061,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct SetServicePropertiesOptions final
{
Models::ShareServiceProperties ShareServiceProperties;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::SetServicePropertiesResult> SetProperties(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2069,6 +2070,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
const Core::Context& context);
struct GetServicePropertiesOptions final
{
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::ShareServiceProperties> GetProperties(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2081,6 +2083,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
Nullable<std::string> Marker;
Nullable<int32_t> MaxResults;
Nullable<Models::ListSharesIncludeFlags> Include;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::_detail::ListSharesResponse> ListSharesSegment(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2098,6 +2101,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
Nullable<Models::ShareProtocols> EnabledProtocols;
Nullable<Models::ShareRootSquash> RootSquash;
Nullable<bool> EnableSnapshotVirtualDirectoryAccess;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::CreateShareResult> Create(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2108,6 +2112,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
Nullable<std::string> Sharesnapshot;
Nullable<std::string> LeaseId;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::ShareProperties> GetProperties(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2119,6 +2124,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
Nullable<std::string> Sharesnapshot;
Nullable<Models::DeleteSnapshotsOption> DeleteSnapshots;
Nullable<std::string> LeaseId;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::DeleteShareResult> Delete(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2130,6 +2136,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
Nullable<int32_t> Duration;
Nullable<std::string> ProposedLeaseId;
Nullable<std::string> Sharesnapshot;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::_detail::AcquireShareLeaseResult> AcquireLease(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2140,6 +2147,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::string LeaseId;
Nullable<std::string> Sharesnapshot;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::_detail::ReleaseShareLeaseResult> ReleaseLease(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2151,6 +2159,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
std::string LeaseId;
Nullable<std::string> ProposedLeaseId;
Nullable<std::string> Sharesnapshot;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::_detail::ChangeShareLeaseResult> ChangeLease(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2161,6 +2170,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::string LeaseId;
Nullable<std::string> Sharesnapshot;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::_detail::RenewShareLeaseResult> RenewLease(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2172,6 +2182,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
Nullable<int32_t> BreakPeriod;
Nullable<std::string> LeaseId;
Nullable<std::string> Sharesnapshot;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::_detail::BreakShareLeaseResult> BreakLease(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2181,6 +2192,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct CreateShareSnapshotOptions final
{
std::map<std::string, std::string> Metadata;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::CreateShareSnapshotResult> CreateSnapshot(
Core::Http::_internal::HttpPipeline& pipeline,
Expand Down Expand Up @@ -2214,6 +2226,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
Nullable<std::string> LeaseId;
Nullable<Models::ShareRootSquash> RootSquash;
Nullable<bool> EnableSnapshotVirtualDirectoryAccess;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::SetSharePropertiesResult> SetProperties(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2224,6 +2237,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::map<std::string, std::string> Metadata;
Nullable<std::string> LeaseId;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::SetShareMetadataResult> SetMetadata(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2233,6 +2247,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct GetShareAccessPolicyOptions final
{
Nullable<std::string> LeaseId;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::ShareAccessPolicy> GetAccessPolicy(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2243,6 +2258,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
{
std::vector<Models::SignedIdentifier> ShareAcl;
Nullable<std::string> LeaseId;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::SetShareAccessPolicyResult> SetAccessPolicy(
Core::Http::_internal::HttpPipeline& pipeline,
Expand All @@ -2252,6 +2268,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
struct GetShareStatisticsOptions final
{
Nullable<std::string> LeaseId;
Nullable<Models::ShareTokenIntent> FileRequestIntent;
};
static Response<Models::ShareStatistics> GetStatistics(
Core::Http::_internal::HttpPipeline& pipeline,
Expand Down
Loading

0 comments on commit a4333f3

Please sign in to comment.