diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp index d8a4a1a6e..de8ba2713 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_directory_client.hpp @@ -126,7 +126,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { /** * @brief Deletes the directory. - * @param Recursive If "true", all paths beneath the directory will be deleted. If "false" and + * @param recursive If "true", all paths beneath the directory will be deleted. If "false" and * the directory is non-empty, an error occurs. * @param options Optional parameters to delete the directory the path points to. * @return Azure::Core::Response containing the information returned when @@ -134,7 +134,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * @remark This request is sent to dfs endpoint. */ Azure::Core::Response Delete( - bool Recursive, + bool recursive, const DeleteDirectoryOptions& options = DeleteDirectoryOptions()) const; /** diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp index beb1df2f0..0e679d1ad 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_file_system_client.hpp @@ -174,6 +174,6 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { m_pipeline(std::move(pipeline)) { } - friend class ServiceClient; + friend class DataLakeServiceClient; }; }}}} // namespace Azure::Storage::Files::DataLake diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp index 213195317..023239607 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_options.hpp @@ -21,7 +21,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { /** * @brief Service client options used to initalize ServiceClient. */ - struct ServiceClientOptions + struct DataLakeServiceClientOptions { std::vector> PerOperationPolicies; std::vector> PerRetryPolicies; diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp index 116d8c992..a3cfbdb86 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/datalake_service_client.hpp @@ -19,17 +19,17 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { class FileSystemClient; - class ServiceClient { + class DataLakeServiceClient { public: /** * @brief Create from connection string * @param connectionString Azure Storage connection string. * @param options Optional parameters used to initialize the client. - * @return ServiceClient + * @return DataLakeServiceClient */ - static ServiceClient CreateFromConnectionString( + static DataLakeServiceClient CreateFromConnectionString( const std::string& connectionString, - const ServiceClientOptions& options = ServiceClientOptions()); + const DataLakeServiceClientOptions& options = DataLakeServiceClientOptions()); /** * @brief Shared key authentication client. @@ -37,10 +37,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * @param credential The shared key credential used to initialize the client. * @param options Optional parameters used to initialize the client. */ - explicit ServiceClient( + explicit DataLakeServiceClient( const std::string& serviceUri, std::shared_ptr credential, - const ServiceClientOptions& options = ServiceClientOptions()); + const DataLakeServiceClientOptions& options = DataLakeServiceClientOptions()); /** * @brief Bearer token authentication client. @@ -48,22 +48,22 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * @param credential The client secret credential used to initialize the client. * @param options Optional parameters used to initialize the client. */ - explicit ServiceClient( + explicit DataLakeServiceClient( const std::string& serviceUri, std::shared_ptr credential, - const ServiceClientOptions& options = ServiceClientOptions()); + const DataLakeServiceClientOptions& options = DataLakeServiceClientOptions()); /** * @brief Anonymous/SAS/customized pipeline auth. * @param serviceUri The service URI this client's request targets. * @param options Optional parameters used to initialize the client. */ - explicit ServiceClient( + explicit DataLakeServiceClient( const std::string& serviceUri, - const ServiceClientOptions& options = ServiceClientOptions()); + const DataLakeServiceClientOptions& options = DataLakeServiceClientOptions()); /** - * @brief Create a FileSystemClient from current ServiceClient + * @brief Create a FileSystemClient from current DataLakeServiceClient * @param fileSystemName The name of the file system. * @return FileSystemClient */ diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp index 54b8bd6d5..641dac1b9 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/protocol/datalake_rest_client.hpp @@ -2411,7 +2411,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { const AppendDataOptions& appendDataOptions) { Azure::Core::Http::Request request( - Azure::Core::Http::HttpMethod::Patch, std::move(url), &bodyStream); + Azure::Core::Http::HttpMethod::Patch, url, &bodyStream); request.GetUrl().AppendQueryParameter(Details::c_QueryAction, "append"); if (appendDataOptions.Position.HasValue()) { diff --git a/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp b/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp index ae008244c..1a92ee8e5 100644 --- a/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp +++ b/sdk/storage/azure-storage-files-datalake/sample/datalake_getting_started.cpp @@ -19,7 +19,7 @@ void DataLakeGettingStarted() // Initializing a ServiceClient that can then initialize the FileSystemClient or list file // systems. - auto serviceClient = ServiceClient::CreateFromConnectionString(GetConnectionString()); + auto serviceClient = DataLakeServiceClient::CreateFromConnectionString(GetConnectionString()); // Initializing a FileSystemClient that can then initialize the PathClient, FileClient, // DirectoryClient. auto fileSystemClient diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp index f0d82378f..10eeb4aeb 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_directory_client.cpp @@ -184,7 +184,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { } Azure::Core::Response DirectoryClient::Delete( - bool Recursive, + bool recursive, const DeleteDirectoryOptions& options) const { Details::DataLakeRestClient::Path::DeleteOptions protocolLayerOptions; @@ -194,7 +194,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { protocolLayerOptions.IfNoneMatch = options.AccessConditions.IfNoneMatch; protocolLayerOptions.IfModifiedSince = options.AccessConditions.IfModifiedSince; protocolLayerOptions.IfUnmodifiedSince = options.AccessConditions.IfUnmodifiedSince; - protocolLayerOptions.RecursiveOptional = Recursive; + protocolLayerOptions.RecursiveOptional = recursive; return Details::DataLakeRestClient::Path::Delete( m_dfsUri, *m_pipeline, options.Context, protocolLayerOptions); } diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp index 99d4b9161..5f65541a2 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_service_client.cpp @@ -18,7 +18,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { namespace { - Blobs::BlobServiceClientOptions GetBlobServiceClientOptions(const ServiceClientOptions& options) + Blobs::BlobServiceClientOptions GetBlobServiceClientOptions( + const DataLakeServiceClientOptions& options) { Blobs::BlobServiceClientOptions blobOptions; for (const auto& p : options.PerOperationPolicies) @@ -51,28 +52,28 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { } } // namespace - ServiceClient ServiceClient::CreateFromConnectionString( + DataLakeServiceClient DataLakeServiceClient::CreateFromConnectionString( const std::string& connectionString, - const ServiceClientOptions& options) + const DataLakeServiceClientOptions& options) { auto parsedConnectionString = Azure::Storage::Details::ParseConnectionString(connectionString); auto serviceUri = std::move(parsedConnectionString.DataLakeServiceUri); if (parsedConnectionString.KeyCredential) { - return ServiceClient( + return DataLakeServiceClient( serviceUri.GetAbsoluteUrl(), parsedConnectionString.KeyCredential, options); } else { - return ServiceClient(serviceUri.GetAbsoluteUrl(), options); + return DataLakeServiceClient(serviceUri.GetAbsoluteUrl(), options); } } - ServiceClient::ServiceClient( + DataLakeServiceClient::DataLakeServiceClient( const std::string& serviceUri, std::shared_ptr credential, - const ServiceClientOptions& options) + const DataLakeServiceClientOptions& options) : m_dfsUri(Details::GetDfsUriFromUri(serviceUri)), m_blobServiceClient( Details::GetBlobUriFromUri(serviceUri), credential, @@ -100,10 +101,10 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { m_pipeline = std::make_shared(policies); } - ServiceClient::ServiceClient( + DataLakeServiceClient::DataLakeServiceClient( const std::string& serviceUri, std::shared_ptr credential, - const ServiceClientOptions& options) + const DataLakeServiceClientOptions& options) : m_dfsUri(Details::GetDfsUriFromUri(serviceUri)), m_blobServiceClient( Details::GetBlobUriFromUri(serviceUri), credential, @@ -132,7 +133,9 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { m_pipeline = std::make_shared(policies); } - ServiceClient::ServiceClient(const std::string& serviceUri, const ServiceClientOptions& options) + DataLakeServiceClient::DataLakeServiceClient( + const std::string& serviceUri, + const DataLakeServiceClientOptions& options) : m_dfsUri(Details::GetDfsUriFromUri(serviceUri)), m_blobServiceClient( Details::GetBlobUriFromUri(serviceUri), GetBlobServiceClientOptions(options)) @@ -158,7 +161,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { m_pipeline = std::make_shared(policies); } - FileSystemClient ServiceClient::GetFileSystemClient(const std::string& fileSystemName) const + FileSystemClient DataLakeServiceClient::GetFileSystemClient( + const std::string& fileSystemName) const { auto builder = m_dfsUri; builder.AppendPath(Storage::Details::UrlEncodePath(fileSystemName)); @@ -166,8 +170,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { builder, m_blobServiceClient.GetBlobContainerClient(fileSystemName), m_pipeline); } - Azure::Core::Response ServiceClient::ListFileSystemsSegement( - const ListFileSystemsSegmentOptions& options) const + Azure::Core::Response + DataLakeServiceClient::ListFileSystemsSegement(const ListFileSystemsSegmentOptions& options) const { Blobs::ListContainersSegmentOptions blobOptions; blobOptions.Context = options.Context; diff --git a/sdk/storage/azure-storage-files-datalake/test/datalake_sas_test.cpp b/sdk/storage/azure-storage-files-datalake/test/datalake_sas_test.cpp index 162ebfb0a..16ca98b4b 100644 --- a/sdk/storage/azure-storage-files-datalake/test/datalake_sas_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/datalake_sas_test.cpp @@ -33,8 +33,8 @@ namespace Azure { namespace Storage { namespace Test { auto keyCredential = Details::ParseConnectionString(AdlsGen2ConnectionString()).KeyCredential; auto accountName = keyCredential->AccountName; - auto serviceClient0 - = Files::DataLake::ServiceClient::CreateFromConnectionString(AdlsGen2ConnectionString()); + auto serviceClient0 = Files::DataLake::DataLakeServiceClient::CreateFromConnectionString( + AdlsGen2ConnectionString()); auto filesystemClient0 = serviceClient0.GetFileSystemClient(m_fileSystemName); auto containerClinet0 = Blobs::BlobContainerClient::CreateFromConnectionString( AdlsGen2ConnectionString(), m_fileSystemName); @@ -50,7 +50,7 @@ namespace Azure { namespace Storage { namespace Test { auto directory2Uri = directory2Client0.GetDfsUri(); auto fileUri = fileClient0.GetUri(); - auto serviceClient1 = Files::DataLake::ServiceClient( + auto serviceClient1 = Files::DataLake::DataLakeServiceClient( serviceUri, std::make_shared( AadTenantId(), AadClientId(), AadClientSecret())); diff --git a/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.cpp b/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.cpp index 76a0c61d7..1907ccba3 100644 --- a/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.cpp +++ b/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.cpp @@ -9,7 +9,7 @@ namespace Azure { namespace Storage { namespace Test { const size_t c_FILE_SYSTEM_TEST_SIZE = 5; - std::shared_ptr + std::shared_ptr DataLakeServiceClientTest::m_dataLakeServiceClient; std::vector DataLakeServiceClientTest::m_fileSystemNameSetA; std::vector DataLakeServiceClientTest::m_fileSystemNameSetB; @@ -18,8 +18,9 @@ namespace Azure { namespace Storage { namespace Test { void DataLakeServiceClientTest::SetUpTestSuite() { - m_dataLakeServiceClient = std::make_shared( - Files::DataLake::ServiceClient::CreateFromConnectionString(AdlsGen2ConnectionString())); + m_dataLakeServiceClient = std::make_shared( + Files::DataLake::DataLakeServiceClient::CreateFromConnectionString( + AdlsGen2ConnectionString())); m_fileSystemPrefixA = LowercaseRandomString(10); m_fileSystemPrefixB = LowercaseRandomString(10); m_fileSystemNameSetA.clear(); diff --git a/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.hpp b/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.hpp index f4af7eb7b..6c63d7454 100644 --- a/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.hpp +++ b/sdk/storage/azure-storage-files-datalake/test/datalake_service_client_test.hpp @@ -14,7 +14,7 @@ namespace Azure { namespace Storage { namespace Test { static std::vector ListAllFileSystems( const std::string& prefix = std::string()); - static std::shared_ptr m_dataLakeServiceClient; + static std::shared_ptr m_dataLakeServiceClient; static std::vector m_fileSystemNameSetA; static std::string m_fileSystemPrefixA; static std::vector m_fileSystemNameSetB; diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp index cc967883b..d0a9bfc90 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/protocol/share_rest_client.hpp @@ -342,7 +342,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { std::string LastModified; std::string Etag; - int32_t Quota = int32_t(); + int64_t Quota = int64_t(); Azure::Core::Nullable ProvisionedIops; Azure::Core::Nullable ProvisionedIngressMBps; Azure::Core::Nullable ProvisionedEgressMBps; @@ -537,7 +537,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::map Metadata; std::string ETag; std::string LastModified; - int32_t Quota = int32_t(); + int64_t Quota = int64_t(); Azure::Core::Nullable ProvisionedIops; Azure::Core::Nullable ProvisionedIngressMBps; Azure::Core::Nullable ProvisionedEgressMBps; @@ -2341,7 +2341,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } else if (path.size() == 1 && path[0] == XmlTagName::c_Quota) { - result.Quota = std::stoi(node.Value); + result.Quota = std::stoll(node.Value); } else if (path.size() == 1 && path[0] == XmlTagName::c_RemainingRetentionDays) { @@ -2626,7 +2626,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { // Timeouts for File Service Operations. std::map Metadata; // A name-value pair to associate with a file storage object. - Azure::Core::Nullable + Azure::Core::Nullable ShareQuota; // Specifies the maximum size of the share, in gigabytes. std::string ApiVersionParameter = Details::c_DefaultServiceApiVersion; // Specifies the version of the operation to @@ -3241,7 +3241,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { std::string ApiVersionParameter = Details::c_DefaultServiceApiVersion; // Specifies the version of the operation to // use for this request. - Azure::Core::Nullable + Azure::Core::Nullable ShareQuota; // Specifies the maximum size of the share, in gigabytes. Azure::Core::Nullable LeaseIdOptional; // If specified, the operation only succeeds if the resource's lease @@ -3565,7 +3565,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } result.ETag = response.GetHeaders().at(Details::c_HeaderETag); result.LastModified = response.GetHeaders().at(Details::c_HeaderLastModified); - result.Quota = std::stoi(response.GetHeaders().at(Details::c_HeaderQuota)); + result.Quota = std::stoll(response.GetHeaders().at(Details::c_HeaderQuota)); if (response.GetHeaders().find(Details::c_HeaderProvisionedIops) != response.GetHeaders().end()) { diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp index 7456f9d56..2754b7578 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_client.hpp @@ -143,7 +143,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { * version and modified time of a share. */ Azure::Core::Response SetQuota( - int32_t quota, + int32_t quotaInGiB, const SetShareQuotaOptions& options = SetShareQuotaOptions()) const; /** @@ -287,6 +287,6 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { : m_shareUri(std::move(shareUri)), m_pipeline(std::move(pipeline)) { } - friend class ServiceClient; + friend class ShareServiceClient; }; }}}} // namespace Azure::Storage::Files::Shares diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp index 40decfbc7..0f150b088 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_options.hpp @@ -19,7 +19,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * @brief Service client options used to initalize ServiceClient. */ - struct ServiceClientOptions + struct ShareServiceClientOptions { std::vector> PerOperationPolicies; std::vector> PerRetryPolicies; @@ -137,7 +137,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { /** * @brief Specifies the maximum size of the share, in gigabytes. */ - Azure::Core::Nullable ShareQuota; + Azure::Core::Nullable ShareQuotaInGiB; }; struct DeleteShareOptions diff --git a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_service_client.hpp b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_service_client.hpp index 50f12a0ab..e884d1f3d 100644 --- a/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_service_client.hpp +++ b/sdk/storage/azure-storage-files-shares/inc/azure/storage/files/shares/share_service_client.hpp @@ -18,53 +18,53 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { class ShareClient; - class ServiceClient { + class ShareServiceClient { public: /** - * @brief Create A ServiceClient from connection string to manage the service related + * @brief Create A ShareServiceClient from connection string to manage the service related * attributes. * @param connectionString Azure Storage connection string. * @param options Optional parameters used to initialize the client. - * @return ServiceClient + * @return ShareServiceClient */ - static ServiceClient CreateFromConnectionString( + static ShareServiceClient CreateFromConnectionString( const std::string& connectionString, - const ServiceClientOptions& options = ServiceClientOptions()); + const ShareServiceClientOptions& options = ShareServiceClientOptions()); /** - * @brief Initialize a new instance of ServiceClient using shared key authentication. + * @brief Initialize a new instance of ShareServiceClient using shared key authentication. * @param serviceUri The service URI this client's request targets. * @param credential The shared key credential used to initialize the client. * @param options Optional parameters used to initialize the client. */ - explicit ServiceClient( + explicit ShareServiceClient( const std::string& serviceUri, std::shared_ptr credential, - const ServiceClientOptions& options = ServiceClientOptions()); + const ShareServiceClientOptions& options = ShareServiceClientOptions()); /** - * @brief Initialize a new instance of ServiceClient using token authentication. + * @brief Initialize a new instance of ShareServiceClient using token authentication. * @param serviceUri The service URI this client's request targets. * @param credential The client secret credential used to initialize the client. * @param options Optional parameters used to initialize the client. */ - explicit ServiceClient( + explicit ShareServiceClient( const std::string& serviceUri, std::shared_ptr credential, - const ServiceClientOptions& options = ServiceClientOptions()); + const ShareServiceClientOptions& options = ShareServiceClientOptions()); /** - * @brief Initialize a new instance of ServiceClient using anonymous access or shared access - * signature. + * @brief Initialize a new instance of ShareServiceClient using anonymous access or shared + * access signature. * @param serviceUri The service URI this client's request targets. * @param options Optional parameters used to initialize the client. */ - explicit ServiceClient( + explicit ShareServiceClient( const std::string& serviceUri, - const ServiceClientOptions& options = ServiceClientOptions()); + const ShareServiceClientOptions& options = ShareServiceClientOptions()); /** - * @brief Create a ShareClient from current ServiceClient + * @brief Create a ShareClient from current ShareServiceClient * @param shareName The name of the file share. * @return ShareClient A share client that can be used to manage a share resource. */ diff --git a/sdk/storage/azure-storage-files-shares/src/share_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_client.cpp index e1877b0e0..0f79fe079 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_client.cpp @@ -144,7 +144,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { { auto protocolLayerOptions = Details::ShareRestClient::Share::CreateOptions(); protocolLayerOptions.Metadata = options.Metadata; - protocolLayerOptions.ShareQuota = options.ShareQuota; + protocolLayerOptions.ShareQuota = options.ShareQuotaInGiB; return Details::ShareRestClient::Share::Create( m_shareUri, *m_pipeline, options.Context, protocolLayerOptions); } @@ -179,11 +179,11 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { } Azure::Core::Response ShareClient::SetQuota( - int32_t quota, + int32_t quotaInGiB, const SetShareQuotaOptions& options) const { auto protocolLayerOptions = Details::ShareRestClient::Share::SetQuotaOptions(); - protocolLayerOptions.ShareQuota = quota; + protocolLayerOptions.ShareQuota = quotaInGiB; return Details::ShareRestClient::Share::SetQuota( m_shareUri, *m_pipeline, options.Context, protocolLayerOptions); } diff --git a/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp b/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp index 128c28f56..2691a09b2 100644 --- a/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp +++ b/sdk/storage/azure-storage-files-shares/src/share_service_client.cpp @@ -15,28 +15,28 @@ #include "azure/storage/files/shares/version.hpp" namespace Azure { namespace Storage { namespace Files { namespace Shares { - ServiceClient ServiceClient::CreateFromConnectionString( + ShareServiceClient ShareServiceClient::CreateFromConnectionString( const std::string& connectionString, - const ServiceClientOptions& options) + const ShareServiceClientOptions& options) { auto parsedConnectionString = Azure::Storage::Details::ParseConnectionString(connectionString); auto serviceUri = std::move(parsedConnectionString.FileServiceUri); if (parsedConnectionString.KeyCredential) { - return ServiceClient( + return ShareServiceClient( serviceUri.GetAbsoluteUrl(), parsedConnectionString.KeyCredential, options); } else { - return ServiceClient(serviceUri.GetAbsoluteUrl(), options); + return ShareServiceClient(serviceUri.GetAbsoluteUrl(), options); } } - ServiceClient::ServiceClient( + ShareServiceClient::ShareServiceClient( const std::string& serviceUri, std::shared_ptr credential, - const ServiceClientOptions& options) + const ShareServiceClientOptions& options) : m_serviceUri(serviceUri) { std::vector> policies; @@ -58,10 +58,10 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { m_pipeline = std::make_shared(policies); } - ServiceClient::ServiceClient( + ShareServiceClient::ShareServiceClient( const std::string& serviceUri, std::shared_ptr credential, - const ServiceClientOptions& options) + const ShareServiceClientOptions& options) : m_serviceUri(serviceUri) { std::vector> policies; @@ -84,7 +84,9 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { m_pipeline = std::make_shared(policies); } - ServiceClient::ServiceClient(const std::string& serviceUri, const ServiceClientOptions& options) + ShareServiceClient::ShareServiceClient( + const std::string& serviceUri, + const ShareServiceClientOptions& options) : m_serviceUri(serviceUri) { std::vector> policies; @@ -105,14 +107,14 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { m_pipeline = std::make_shared(policies); } - ShareClient ServiceClient::GetShareClient(const std::string& shareName) const + ShareClient ShareServiceClient::GetShareClient(const std::string& shareName) const { auto builder = m_serviceUri; builder.AppendPath(Storage::Details::UrlEncodePath(shareName)); return ShareClient(builder, m_pipeline); } - Azure::Core::Response ServiceClient::ListSharesSegment( + Azure::Core::Response ShareServiceClient::ListSharesSegment( const ListSharesSegmentOptions& options) const { auto protocolLayerOptions = Details::ShareRestClient::Service::ListSharesSegmentOptions(); @@ -124,7 +126,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { m_serviceUri, *m_pipeline, options.Context, protocolLayerOptions); } - Azure::Core::Response ServiceClient::SetProperties( + Azure::Core::Response ShareServiceClient::SetProperties( StorageServiceProperties properties, const SetServicePropertiesOptions& options) const { @@ -134,7 +136,7 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares { m_serviceUri, *m_pipeline, options.Context, protocolLayerOptions); } - Azure::Core::Response ServiceClient::GetProperties( + Azure::Core::Response ShareServiceClient::GetProperties( const GetServicePropertiesOptions& options) const { auto protocolLayerOptions = Details::ShareRestClient::Service::GetPropertiesOptions(); diff --git a/sdk/storage/azure-storage-files-shares/test/share_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/share_client_test.cpp index 2c08d53c5..fa6719bf9 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/share_client_test.cpp @@ -130,8 +130,8 @@ namespace Azure { namespace Storage { namespace Test { AdlsGen2ConnectionString(), LowercaseRandomString()); Files::Shares::CreateShareOptions options1; Files::Shares::CreateShareOptions options2; - options1.ShareQuota = quota32GB; - options2.ShareQuota = quota64GB; + options1.ShareQuotaInGiB = quota32GB; + options2.ShareQuotaInGiB = quota64GB; EXPECT_NO_THROW(client1.Create(options1)); EXPECT_NO_THROW(client2.Create(options2)); diff --git a/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp b/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp index a65f89b4a..e945e7e7a 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/share_sas_test.cpp @@ -26,7 +26,7 @@ namespace Azure { namespace Storage { namespace Test { auto keyCredential = Details::ParseConnectionString(StandardStorageConnectionString()).KeyCredential; auto accountName = keyCredential->AccountName; - auto fileServiceClient0 = Files::Shares::ServiceClient::CreateFromConnectionString( + auto fileServiceClient0 = Files::Shares::ShareServiceClient::CreateFromConnectionString( StandardStorageConnectionString()); auto shareClient0 = fileServiceClient0.GetShareClient(m_shareName); auto fileClient0 = shareClient0.GetFileClient(fileName); diff --git a/sdk/storage/azure-storage-files-shares/test/share_service_client_test.cpp b/sdk/storage/azure-storage-files-shares/test/share_service_client_test.cpp index 642b68a9b..2e48cfc7a 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_service_client_test.cpp +++ b/sdk/storage/azure-storage-files-shares/test/share_service_client_test.cpp @@ -20,7 +20,7 @@ namespace Azure { namespace Storage { namespace Test { const size_t c_SHARE_TEST_SIZE = 5; - std::shared_ptr + std::shared_ptr FileShareServiceClientTest::m_fileShareServiceClient; std::vector FileShareServiceClientTest::m_shareNameSetA; std::vector FileShareServiceClientTest::m_shareNameSetB; @@ -29,8 +29,8 @@ namespace Azure { namespace Storage { namespace Test { void FileShareServiceClientTest::SetUpTestSuite() { - m_fileShareServiceClient = std::make_shared( - Files::Shares::ServiceClient::CreateFromConnectionString( + m_fileShareServiceClient = std::make_shared( + Files::Shares::ShareServiceClient::CreateFromConnectionString( StandardStorageConnectionString())); m_sharePrefixA = LowercaseRandomString(10); m_sharePrefixB = LowercaseRandomString(10); @@ -246,8 +246,9 @@ namespace Azure { namespace Storage { namespace Test { TEST_F(FileShareServiceClientTest, DISABLED_SetPremiumFileProperties) { - auto premiumFileShareServiceClient = std::make_shared( - Files::Shares::ServiceClient::CreateFromConnectionString(PremiumFileConnectionString())); + auto premiumFileShareServiceClient = std::make_shared( + Files::Shares::ShareServiceClient::CreateFromConnectionString( + PremiumFileConnectionString())); auto properties = *premiumFileShareServiceClient->GetProperties(); auto originalProperties = properties; diff --git a/sdk/storage/azure-storage-files-shares/test/share_service_client_test.hpp b/sdk/storage/azure-storage-files-shares/test/share_service_client_test.hpp index de6cb6549..66783c41d 100644 --- a/sdk/storage/azure-storage-files-shares/test/share_service_client_test.hpp +++ b/sdk/storage/azure-storage-files-shares/test/share_service_client_test.hpp @@ -14,7 +14,7 @@ namespace Azure { namespace Storage { namespace Test { static std::vector ListAllShares( const std::string& prefix = std::string()); - static std::shared_ptr m_fileShareServiceClient; + static std::shared_ptr m_fileShareServiceClient; static std::vector m_shareNameSetA; static std::string m_sharePrefixA; static std::vector m_shareNameSetB;