azure-security-keyvault-certificates
Loading...
Searching...
No Matches
certificate_client_operations.hpp
Go to the documentation of this file.
1
2// Copyright (c) Microsoft Corporation.
3// Licensed under the MIT License.
4
11#pragma once
12
14#include "azure/keyvault/certificates/dll_import_export.hpp"
15
16#include <azure/core/operation.hpp>
17#include <azure/core/operation_status.hpp>
18#include <azure/core/response.hpp>
19
20namespace Azure { namespace Security { namespace KeyVault { namespace Certificates {
21 class CertificateClient;
26 : public Azure::Core::Operation<CertificateOperationProperties> {
27
28 friend class CertificateClient;
29
30 private:
31 std::shared_ptr<CertificateClient> m_certificateClient;
33 std::string m_continuationToken;
34
35 Azure::Response<CertificateOperationProperties> PollUntilDoneInternal(
36 std::chrono::milliseconds period,
37 Azure::Core::Context& context) override;
38
39 std::unique_ptr<Azure::Core::Http::RawResponse> PollInternal(
40 Azure::Core::Context const& context) override;
41
42 /*
43 * Only friend classes are permitted to call the constructor .
44 *
45 * Since C++ doesn't offer `internal` access, we use friends-only instead.
46 */
48 std::shared_ptr<CertificateClient> certificateClient,
49 Azure::Response<CertificateOperationProperties> response);
50
52 std::string resumeToken,
53 std::shared_ptr<CertificateClient> certificateClient);
54
55 public:
62 CertificateOperationProperties Value() const override { return m_value; }
63
70 std::string GetResumeToken() const override { return m_continuationToken; }
71
86 std::string const& resumeToken,
87 CertificateClient const& client,
88 Azure::Core::Context const& context = Azure::Core::Context());
89
95 void Cancel(Azure::Core::Context const& context = Azure::Core::Context());
96
102 void Delete(Azure::Core::Context const& context = Azure::Core::Context());
103
109 bool IsCompleted() const;
110 };
111
115 class DeleteCertificateOperation final : public Azure::Core::Operation<DeletedCertificate> {
116
117 friend class CertificateClient;
118
119 private:
120 std::shared_ptr<CertificateClient> m_certificateClient;
121 DeletedCertificate m_value;
122 std::string m_continuationToken;
123
124 Azure::Response<DeletedCertificate> PollUntilDoneInternal(
125 std::chrono::milliseconds period,
126 Azure::Core::Context& context) override;
127
128 std::unique_ptr<Azure::Core::Http::RawResponse> PollInternal(
129 Azure::Core::Context const& context) override;
130
131 /*
132 * Only friend classes are permitted to call the constructor .
133 *
134 * Since C++ doesn't offer `internal` access, we use friends-only instead.
135 */
137 std::shared_ptr<CertificateClient> certificateClient,
138 Azure::Response<DeletedCertificate> response);
139
141 std::string resumeToken,
142 std::shared_ptr<CertificateClient> certificateClient);
143
144 public:
150 DeletedCertificate Value() const override { return m_value; }
151
158 std::string GetResumeToken() const override { return m_continuationToken; }
159
174 std::string const& resumeToken,
175 CertificateClient const& client,
176 Azure::Core::Context const& context = Azure::Core::Context());
177 };
178
183 : public Azure::Core::Operation<KeyVaultCertificateWithPolicy> {
184
185 friend class CertificateClient;
186
187 private:
188 std::shared_ptr<CertificateClient> m_certificateClient;
190 std::string m_continuationToken;
191
192 Azure::Response<KeyVaultCertificateWithPolicy> PollUntilDoneInternal(
193 std::chrono::milliseconds period,
194 Azure::Core::Context& context) override;
195
196 std::unique_ptr<Azure::Core::Http::RawResponse> PollInternal(
197 Azure::Core::Context const& context) override;
198
199 /*
200 * Only friend classes are permitted to call the constructor .
201 *
202 * Since C++ doesn't offer `internal` access, we use friends-only instead.
203 */
205 std::shared_ptr<CertificateClient> certificateClient,
206 Azure::Response<KeyVaultCertificateWithPolicy> response);
207
209 std::string resumeToken,
210 std::shared_ptr<CertificateClient> certificateClient);
211
212 public:
219 KeyVaultCertificateWithPolicy Value() const override { return m_value; }
220
227 std::string GetResumeToken() const override { return m_continuationToken; }
228
243 std::string const& resumeToken,
244 CertificateClient const& client,
245 Azure::Core::Context const& context = Azure::Core::Context());
246 };
247}}}} // namespace Azure::Security::KeyVault::Certificates
Defines the Key Vault Certificates types.
The CertificateClient provides synchronous methods to manage KeyVaultCertificate in Azure Key Vault.
Definition certificate_client.hpp:39
A certificate operation.
Definition certificate_client_models.hpp:1187
Represents a create certificate long running operation.
Definition certificate_client_operations.hpp:26
CertificateOperationProperties Value() const override
Get the Azure::Security::KeyVault::Certificates::CertificateOperationProperties object.
Definition certificate_client_operations.hpp:62
static CreateCertificateOperation CreateFromResumeToken(std::string const &resumeToken, CertificateClient const &client, Azure::Core::Context const &context=Azure::Core::Context())
Create a CreateCertificateOperation from the resumeToken fetched from another Operation<T>,...
std::string GetResumeToken() const override
Get an Url as string which can be used to get the status of the operation.
Definition certificate_client_operations.hpp:70
bool IsCompleted() const
Determines if the operation has completed.
void Cancel(Azure::Core::Context const &context=Azure::Core::Context())
Cancels the operation.
void Delete(Azure::Core::Context const &context=Azure::Core::Context())
Delete operation.
Represents a delete certificate long running operation.
Definition certificate_client_operations.hpp:115
std::string GetResumeToken() const override
Get an Url as string which can be used to get the status of the operation.
Definition certificate_client_operations.hpp:158
DeletedCertificate Value() const override
Get the Azure::Security::KeyVault::Certificates::DeletedCertificate object.
Definition certificate_client_operations.hpp:150
static DeleteCertificateOperation CreateFromResumeToken(std::string const &resumeToken, CertificateClient const &client, Azure::Core::Context const &context=Azure::Core::Context())
Create a DeleteCertificateOperation from the resumeToken fetched from another Operation<T>,...
Represents a deleted certificate in a KeyVault.
Definition certificate_client_models.hpp:1295
A KeyVaultCertificate along with its CertificatePolicy.
Definition certificate_client_models.hpp:890
Represents a recover deleted certificate long running operation.
Definition certificate_client_operations.hpp:183
KeyVaultCertificateWithPolicy Value() const override
Get the Azure::Security::KeyVault::Certificates::KeyVaultCertificateWithPolicy object.
Definition certificate_client_operations.hpp:219
std::string GetResumeToken() const override
Get an Url as string which can be used to get the status of the operation.
Definition certificate_client_operations.hpp:227
static RecoverDeletedCertificateOperation CreateFromResumeToken(std::string const &resumeToken, CertificateClient const &client, Azure::Core::Context const &context=Azure::Core::Context())
Create a RecoverDeletedCertificateOperation from the resumeToken fetched from another Operation<T>,...