azure-security-keyvault-secrets
keyvault_secret.hpp
Go to the documentation of this file.
1 // Copyright (c) Microsoft Corporation. All rights reserved.
2 // SPDX-License-Identifier: MIT
3 
9 #pragma once
11 
12 namespace Azure { namespace Security { namespace KeyVault { namespace Secrets {
14  {
19  std::string Name;
20 
25  Azure::Nullable<std::string> Value;
26 
31  std::string Id;
32 
38 
43  KeyVaultSecret() = default;
44 
51  KeyVaultSecret(std::string const& name, std::string const& value)
52  : Name(name), Value(value), Properties(name)
53  {
54  if (Name.empty())
55  {
56  throw std::invalid_argument("Name cannot be empty");
57  }
58 
59  if (Value.HasValue() == false || Value.Value().empty())
60  {
61  throw std::invalid_argument("Value cannot be empty");
62  }
63  }
64 
65  private:
66  KeyVaultSecret(std::string name) : Name(std::move(name))
67  {
68  if (Name.empty())
69  {
70  throw std::invalid_argument("Name cannot be empty");
71  }
72  }
73 
74  friend struct DeletedSecret;
75  };
76 
77 }}}} // namespace Azure::Security::KeyVault::Secrets
keyvault_secret_properties.hpp
Keyvault Secret Attributes definition.
Azure::Security::KeyVault::Secrets::KeyVaultSecret::Id
std::string Id
The secret id.
Definition: keyvault_secret.hpp:31
Azure::Security::KeyVault::Secrets::KeyVaultSecret::KeyVaultSecret
KeyVaultSecret(std::string const &name, std::string const &value)
Construct a new Secret object.
Definition: keyvault_secret.hpp:51
Azure::Security::KeyVault::Secrets::SecretProperties
The Secret attributes managed by the KeyVault service.
Definition: keyvault_secret_properties.hpp:23
Azure::Security::KeyVault::Secrets::KeyVaultSecret::Value
Azure::Nullable< std::string > Value
The secret value.
Definition: keyvault_secret.hpp:25
Azure::Security::KeyVault::Secrets::KeyVaultSecret
Definition: keyvault_secret.hpp:14
Azure
Azure SDK abstractions.
Definition: dll_import_export.hpp:46
Azure::Security::KeyVault::Secrets::KeyVaultSecret::Name
std::string Name
The name of the secret.
Definition: keyvault_secret.hpp:19
Azure::Security::KeyVault::Secrets::KeyVaultSecret::Properties
SecretProperties Properties
The secret Properties bundle.
Definition: keyvault_secret.hpp:37
Azure::Security::KeyVault::Secrets::KeyVaultSecret::KeyVaultSecret
KeyVaultSecret()=default
Construct a new Secret object.