Other than options and model types (which are property bags), make everything that has functions, a class. (#2631)

* Other than options and model types (which are property bags), make
everything that has functions, a class.

* Fix clang formatting.
This commit is contained in:
Ahson Khan 2021-07-15 11:25:30 -07:00 committed by GitHub
parent 76fd63b2b3
commit 90bdfd8408
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 45 additions and 47 deletions

View File

@ -37,8 +37,8 @@ namespace Azure { namespace Security { namespace KeyVault {
namespace Keys { namespace Cryptography {
namespace _detail {
struct CryptographyProvider;
struct RemoteCryptographyClient;
class CryptographyProvider;
class RemoteCryptographyClient;
} // namespace _detail
/**

View File

@ -34,8 +34,8 @@ namespace Azure {
namespace Cryptography {
namespace _detail {
struct CryptographyProvider
{
class CryptographyProvider {
public:
virtual ~CryptographyProvider() = default;
virtual bool CanRemote() const noexcept = 0;

View File

@ -35,78 +35,78 @@ namespace Azure {
namespace _detail {
/***************** Encrypt Result *****************/
struct EncryptResultSerializer final
{
class EncryptResultSerializer final {
public:
static EncryptResult EncryptResultDeserialize(
Azure::Core::Http::RawResponse const& rawResponse);
};
/***************** Encrypt Parameters *****************/
struct EncryptParametersSerializer final
{
class EncryptParametersSerializer final {
public:
static std::string EncryptParametersSerialize(
Azure::Security::KeyVault::Keys::Cryptography::EncryptParameters const& parameters);
};
/***************** Decrypt Result *****************/
struct DecryptResultSerializer final
{
class DecryptResultSerializer final {
public:
static DecryptResult DecryptResultDeserialize(
Azure::Core::Http::RawResponse const& rawResponse);
};
/***************** Encrypt Parameters *****************/
struct DecryptParametersSerializer final
{
class DecryptParametersSerializer final {
public:
static std::string DecryptParametersSerialize(
Azure::Security::KeyVault::Keys::Cryptography::DecryptParameters const& parameters);
};
/***************** WrapKey Result *****************/
struct WrapResultSerializer final
{
class WrapResultSerializer final {
public:
static WrapResult WrapResultDeserialize(Azure::Core::Http::RawResponse const& rawResponse);
};
/***************** WrapKey Parameters *****************/
struct KeyWrapParametersSerializer final
{
class KeyWrapParametersSerializer final {
public:
static std::string KeyWrapParametersSerialize(
Azure::Security::KeyVault::Keys::Cryptography::_detail::KeyWrapParameters const&
parameters);
};
/***************** UnwrapKey Result *****************/
struct UnwrapResultSerializer final
{
class UnwrapResultSerializer final {
public:
static UnwrapResult UnwrapResultDeserialize(
Azure::Core::Http::RawResponse const& rawResponse);
};
/***************** Sign Result *****************/
struct SignResultSerializer final
{
class SignResultSerializer final {
public:
static SignResult SignResultDeserialize(Azure::Core::Http::RawResponse const& rawResponse);
};
/***************** Key sign Parameters *****************/
struct KeySignParametersSerializer final
{
class KeySignParametersSerializer final {
public:
static std::string KeySignParametersSerialize(
Azure::Security::KeyVault::Keys::Cryptography::_detail::KeySignParameters const&
parameters);
};
/***************** Verify Result *****************/
struct VerifyResultSerializer final
{
class VerifyResultSerializer final {
public:
static VerifyResult VerifyResultDeserialize(
Azure::Core::Http::RawResponse const& rawResponse);
};
/***************** Key Verify Parameters *****************/
struct KeyVerifyParametersSerializer final
{
class KeyVerifyParametersSerializer final {
public:
static std::string KeyVerifyParametersSerialize(
Azure::Security::KeyVault::Keys::Cryptography::_detail::KeyVerifyParameters const&
parameters);

View File

@ -17,9 +17,8 @@
namespace Azure { namespace Security { namespace KeyVault { namespace Keys { namespace _detail {
struct KeyBackup final : public Azure::Core::Json::_internal::JsonSerializable
{
class KeyBackup final : public Azure::Core::Json::_internal::JsonSerializable {
public:
std::vector<uint8_t> Value;
std::string Serialize() const override;

View File

@ -20,8 +20,8 @@
namespace Azure { namespace Security { namespace KeyVault { namespace Keys { namespace _detail {
/***************** KeyVault Key *****************/
struct KeyVaultKeySerializer final
{
class KeyVaultKeySerializer final {
public:
// Creates a new key based on a name and an HTTP raw response.
static KeyVaultKey KeyVaultKeyDeserialize(
std::string const& name,
@ -83,22 +83,22 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam
};
/**************** Deleted Key *******************/
struct DeletedKeySerializer final
{
class DeletedKeySerializer final {
public:
static DeletedKey DeletedKeyDeserialize(
std::string const& name,
Azure::Core::Http::RawResponse const& rawResponse);
};
/**************** Import Key Options ***********/
struct ImportKeyOptionsSerializer final
{
class ImportKeyOptionsSerializer final {
public:
static std::string ImportKeyOptionsSerialize(ImportKeyOptions const& importKeyOptions);
};
/**************** Key Properties ************/
struct KeyPropertiesPagedResultSerializer final
{
class KeyPropertiesPagedResultSerializer final {
public:
static KeyPropertiesPagedResponse KeyPropertiesPagedResultDeserialize(
Azure::Core::Http::RawResponse const& rawResponse);
static DeletedKeyPagedResponse DeletedKeyPagedResultDeserialize(
@ -106,8 +106,8 @@ namespace Azure { namespace Security { namespace KeyVault { namespace Keys { nam
};
/**************** JWK ************/
struct JsonWebKeySerializer final
{
class JsonWebKeySerializer final {
public:
static void JsonWebKeySerialize(
JsonWebKey const& jwk,
Azure::Core::Json::_internal::json& destJson);

View File

@ -24,8 +24,8 @@ namespace Azure {
namespace Cryptography {
namespace _detail {
struct LocalCryptographyProviderFactory final
{
class LocalCryptographyProviderFactory final {
public:
LocalCryptographyProviderFactory() = delete;
static std::unique_ptr<CryptographyProvider> Create(

View File

@ -30,10 +30,9 @@ namespace Azure {
namespace Cryptography {
namespace _detail {
struct RemoteCryptographyClient final
: public Azure::Security::KeyVault::Keys::Cryptography::_detail::CryptographyProvider
{
class RemoteCryptographyClient final
: public Azure::Security::KeyVault::Keys::Cryptography::_detail::CryptographyProvider {
public:
std::shared_ptr<Azure::Security::KeyVault::_detail::KeyVaultProtocolClient> Pipeline;
Azure::Core::Url KeyId;

View File

@ -21,8 +21,8 @@ namespace Azure {
namespace Cryptography {
namespace _detail {
struct RsaCryptographyProvider final : public LocalCryptographyProvider
{
class RsaCryptographyProvider final : public LocalCryptographyProvider {
public:
RsaCryptographyProvider(
Azure::Security::KeyVault::Keys::JsonWebKey const& keyMaterial,
Azure::Security::KeyVault::Keys::KeyProperties const& keyProperties,