azure-storage-files-shares
share_service_client.hpp
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // SPDX-License-Identifier: MIT
3 
4 #pragma once
5 
6 #include <memory>
7 #include <string>
8 
9 #include <azure/core/internal/http/pipeline.hpp>
10 #include <azure/core/response.hpp>
11 #include <azure/storage/common/storage_credential.hpp>
12 
13 #include "azure/storage/files/shares/protocol/share_rest_client.hpp"
14 #include "azure/storage/files/shares/share_options.hpp"
15 #include "azure/storage/files/shares/share_responses.hpp"
16 
17 namespace Azure { namespace Storage { namespace Files { namespace Shares {
18 
19  class ShareClient;
20 
21  class ShareServiceClient final {
22  public:
31  const std::string& connectionString,
32  const ShareClientOptions& options = ShareClientOptions());
33 
40  explicit ShareServiceClient(
41  const std::string& serviceUrl,
42  std::shared_ptr<StorageSharedKeyCredential> credential,
43  const ShareClientOptions& options = ShareClientOptions());
44 
51  explicit ShareServiceClient(
52  const std::string& serviceUrl,
53  const ShareClientOptions& options = ShareClientOptions());
54 
60  ShareClient GetShareClient(const std::string& shareName) const;
61 
67  std::string GetUrl() const { return m_serviceUrl.GetAbsoluteUrl(); }
68 
77  const ListSharesOptions& options = ListSharesOptions(),
78  const Azure::Core::Context& context = Azure::Core::Context()) const;
79 
88  Azure::Response<Models::SetServicePropertiesResult> SetProperties(
91  const Azure::Core::Context& context = Azure::Core::Context()) const;
92 
99  Azure::Response<Models::ShareServiceProperties> GetProperties(
101  const Azure::Core::Context& context = Azure::Core::Context()) const;
102 
103  private:
104  Azure::Core::Url m_serviceUrl;
105  std::shared_ptr<Azure::Core::Http::_internal::HttpPipeline> m_pipeline;
106  };
107 }}}} // namespace Azure::Storage::Files::Shares
Azure::Storage::Files::Shares::ShareClient
Definition: share_client.hpp:21
Azure::Storage::Files::Shares::ShareServiceClient::GetShareClient
ShareClient GetShareClient(const std::string &shareName) const
Create a ShareClient from current ShareServiceClient.
Definition: share_service_client.cpp:79
Azure::Storage::Files::Shares::Models::ShareServiceProperties
Storage service properties.
Definition: share_rest_client.hpp:595
Azure::Storage::Files::Shares::ListSharesPagedResponse
Response type for Azure::Storage::Files::Shares::ShareServiceClient::ListShares.
Definition: share_responses.hpp:252
Azure::Storage::Files::Shares::ListSharesOptions
Optional parameters for Azure::Storage::Files::Shares::ShareServiceClient::ListShares.
Definition: share_options.hpp:34
Azure::Storage::Files::Shares::ShareServiceClient::GetProperties
Azure::Response< Models::ShareServiceProperties > GetProperties(const GetServicePropertiesOptions &options=GetServicePropertiesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Get the service's properties.
Definition: share_service_client.cpp:126
Azure::Storage::Files::Shares::ShareServiceClient::ShareServiceClient
ShareServiceClient(const std::string &serviceUrl, std::shared_ptr< StorageSharedKeyCredential > credential, const ShareClientOptions &options=ShareClientOptions())
Initialize a new instance of ShareServiceClient using shared key authentication.
Definition: share_service_client.cpp:38
Azure::Storage::Files::Shares::ShareServiceClient::ListShares
ListSharesPagedResponse ListShares(const ListSharesOptions &options=ListSharesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Returns a paginated collection of the shares in the storage account. Enumerating the shares may make ...
Definition: share_service_client.cpp:86
Azure::Storage::Files::Shares::ShareServiceClient::SetProperties
Azure::Response< Models::SetServicePropertiesResult > SetProperties(Models::ShareServiceProperties properties, const SetServicePropertiesOptions &options=SetServicePropertiesOptions(), const Azure::Core::Context &context=Azure::Core::Context()) const
Set the service's properties.
Definition: share_service_client.cpp:114
Azure::Storage::Files::Shares::ShareServiceClient
Definition: share_service_client.hpp:21
Azure::Storage::Files::Shares::SetServicePropertiesOptions
Optional parameters for Azure::Storage::Files::Shares::ShareServiceClient::SetProperties.
Definition: share_options.hpp:67
Azure::Storage::Files::Shares::GetServicePropertiesOptions
Optional parameters for Azure::Storage::Files::Shares::ShareServiceClient::GetProperties.
Definition: share_options.hpp:75
Azure::Storage::Files::Shares::ShareServiceClient::CreateFromConnectionString
static ShareServiceClient CreateFromConnectionString(const std::string &connectionString, const ShareClientOptions &options=ShareClientOptions())
Create A ShareServiceClient from connection string to manage the service related attributes.
Definition: share_service_client.cpp:20
Azure::Storage::Files::Shares::ShareClientOptions
Client options used to initialize share clients.
Definition: share_options.hpp:22
Azure::Storage::Files::Shares::ShareServiceClient::GetUrl
std::string GetUrl() const
Gets the file share service's primary URL endpoint.
Definition: share_service_client.hpp:67