diff --git a/languages/cpp/README.md b/languages/cpp/README.md index 29d65d185..1e48e5907 100644 --- a/languages/cpp/README.md +++ b/languages/cpp/README.md @@ -25,40 +25,40 @@ clientSettings.set_user_agent(user_agent); ```c++ std::string accessToken = ""; BitwardenClient bitwardenClient = BitwardenClient(clientSettings); -ResponseForApiKeyLoginResponse responseForApiKeyLoginResponse = bitwardenClient.accessTokenLogin(accessToken); +bitwardenClient.accessTokenLogin(accessToken); ``` ### Create new project ```c++ boost::uuids::uuid organizationUuid = boost::uuids::string_generator()(""); -ResponseForProjectResponse responseForProjectResponseCreate = bitwardenClient.createProject(organizationUuid, "TestProject"); +ProjectResponse projectResponseCreate = bitwardenClient.createProject(organizationUuid, "TestProject"); ``` ### List all projects ```c++ -ResponseForProjectsResponse responseForProjectResponseList = bitwardenClient.listProjects(organizationUuid); +ProjectsResponse projectResponseList = bitwardenClient.listProjects(organizationUuid); ``` ### Get project details ```c++ -boost::uuids::uuid projectId = boost::uuids::string_generator()(responseForProjectResponseCreate.get_data()->get_id()); -ResponseForProjectResponse responseForProjectResponseGet = bitwardenClient.getProject(projectId); +boost::uuids::uuid projectId = boost::uuids::string_generator()(projectResponseCreate.get_id()); +ProjectResponse projectResponseGet = bitwardenClient.getProject(projectId); ``` ### Update project ```c++ -boost::uuids::uuid projectId = boost::uuids::string_generator()(responseForProjectResponseCreate.get_data()->get_id()); -ResponseForProjectResponse responseForProjectResponseUpdate = bitwardenClient.updateProject(projectId, organizationUuid, "TestProjectUpdated"); +boost::uuids::uuid projectId = boost::uuids::string_generator()(projectResponseCreate.get_id()); +ProjectResponse projectResponseUpdate = bitwardenClient.updateProject(projectId, organizationUuid, "TestProjectUpdated"); ``` ### Delete projects ```c++ -ResponseForSecretsDeleteResponse responseForSecretsDeleteResponse = bitwardenClient.deleteSecrets({secretId}); +SecretsDeleteResponse secretsDeleteResponse = bitwardenClient.deleteSecrets({secretId}); ``` ### Add new secret @@ -67,31 +67,31 @@ ResponseForSecretsDeleteResponse responseForSecretsDeleteResponse = bitwardenCli std::string key = "key"; std::string value = "value"; std::string note = "note"; -ResponseForSecretResponse responseForSecretResponseCreate = bitwardenClient.createSecret(key, value, note, organizationUuid, {projectId}); +SecretResponse secretResponseCreate = bitwardenClient.createSecret(key, value, note, organizationUuid, {projectId}); ``` ### List secrets ```c++ -ResponseForSecretIdentifiersResponse responseForSecretIdentifiersResponse = bitwardenClient.listSecrets(organizationUuid); +SecretIdentifiersResponse secretIdentifiersResponse = bitwardenClient.listSecrets(organizationUuid); ``` ### Get secret details ``` -boost::uuids::uuid secretId = boost::uuids::string_generator()(responseForSecretResponseCreate.get_data()->get_id()); -ResponseForSecretResponse responseForSecretResponseGet = bitwardenClient.getSecret(secretId); +boost::uuids::uuid secretId = boost::uuids::string_generator()(secretResponseCreate.get_id()); +SecretResponse secretResponseGet = bitwardenClient.getSecret(secretId); ``` ### Update secret ```c++ -ResponseForSecretResponse responseForSecretResponseUpdate = bitwardenClient.updateSecret(secretId, "key2", "value2", "note2", organizationUuid, {projectId}); +SecretResponse secretResponseUpdate = bitwardenClient.updateSecret(secretId, "key2", "value2", "note2", organizationUuid, {projectId}); ``` # Delete secrets ```c++ -ResponseForSecretsDeleteResponse responseForSecretsDeleteResponse = bitwardenClient.deleteSecrets({secretId}); +SecretsDeleteResponse secretsDeleteResponse = bitwardenClient.deleteSecrets({secretId}); ``` [Access Tokens]: https://bitwarden.com/help/access-tokens/ diff --git a/languages/cpp/examples/Wrapper.cpp b/languages/cpp/examples/Wrapper.cpp index 2d84f998d..a6f67c62e 100644 --- a/languages/cpp/examples/Wrapper.cpp +++ b/languages/cpp/examples/Wrapper.cpp @@ -29,22 +29,22 @@ int main() { // Create a Bitwarden client instance BitwardenClient bitwardenClient = BitwardenClient(clientSettings); // // Access token login - ResponseForApiKeyLoginResponse responseForApiKeyLoginResponse = bitwardenClient.accessTokenLogin(accessToken); + bitwardenClient.accessTokenLogin(accessToken); // Organization ID boost::uuids::uuid organizationUuid = boost::uuids::string_generator()(organizationId); // // Create a new project - ResponseForProjectResponse responseForProjectResponseCreate = bitwardenClient.createProject(organizationUuid, "NewTestProject"); - boost::uuids::uuid projectId = boost::uuids::string_generator()(responseForProjectResponseCreate.get_data()->get_id()); + ProjectResponse projectResponseCreate = bitwardenClient.createProject(organizationUuid, "NewTestProject"); + boost::uuids::uuid projectId = boost::uuids::string_generator()(projectResponseCreate.get_id()); // List projects - ResponseForProjectsResponse responseForProjectResponseList = bitwardenClient.listProjects(organizationUuid); + ProjectsResponse projectResponseList = bitwardenClient.listProjects(organizationUuid); // Get project details - ResponseForProjectResponse responseForProjectResponseGet = bitwardenClient.getProject(projectId); + ProjectResponse projectResponseGet = bitwardenClient.getProject(projectId); // Update project - ResponseForProjectResponse responseForProjectResponseUpdate = bitwardenClient.updateProject(projectId, organizationUuid, "NewTestProject2"); + ProjectResponse ProjectResponseUpdate = bitwardenClient.updateProject(projectId, organizationUuid, "NewTestProject2"); // Secrets std::string key = "key"; @@ -52,26 +52,26 @@ int main() { std::string note = "note"; // Create a new secret - ResponseForSecretResponse responseForSecretResponseCreate = bitwardenClient.createSecret(key, value, note, organizationUuid, {projectId}); - boost::uuids::uuid secretId = boost::uuids::string_generator()(responseForSecretResponseCreate.get_data()->get_id()); + SecretResponse secretResponseCreate = bitwardenClient.createSecret(key, value, note, organizationUuid, {projectId}); + boost::uuids::uuid secretId = boost::uuids::string_generator()(secretResponseCreate.get_id()); // List secrets - ResponseForSecretIdentifiersResponse responseForSecretIdentifiersResponse = bitwardenClient.listSecrets(organizationUuid); + SecretIdentifiersResponse secretIdentifiersResponse = bitwardenClient.listSecrets(organizationUuid); // Get secret details - ResponseForSecretResponse responseForSecretResponseGet = bitwardenClient.getSecret(secretId); + SecretResponse secretResponseGet = bitwardenClient.getSecret(secretId); // Update secret key = "key2"; value = "value2"; note = "note2"; - ResponseForSecretResponse responseForSecretResponseUpdate = bitwardenClient.updateSecret(secretId, key, value, note, organizationUuid, {projectId}); + SecretResponse responseForSecretResponseUpdate = bitwardenClient.updateSecret(secretId, key, value, note, organizationUuid, {projectId}); // Delete secrets - ResponseForSecretsDeleteResponse responseForSecretsDeleteResponse = bitwardenClient.deleteSecrets({secretId}); + SecretsDeleteResponse secretsDeleteResponse = bitwardenClient.deleteSecrets({secretId}); // Delete projects - ResponseForProjectsDeleteResponse responseForProjectsDeleteResponse = bitwardenClient.deleteProjects({projectId}); + ProjectsDeleteResponse projectsDeleteResponse = bitwardenClient.deleteProjects({projectId}); return 0; } diff --git a/languages/cpp/include/BitwardenClient.h b/languages/cpp/include/BitwardenClient.h index 0a63bf8aa..1e1e85b7b 100644 --- a/languages/cpp/include/BitwardenClient.h +++ b/languages/cpp/include/BitwardenClient.h @@ -11,17 +11,17 @@ class BitwardenClient { BitwardenClient(ClientSettings clientSettings); ~BitwardenClient(); - ResponseForApiKeyLoginResponse accessTokenLogin(const std::string& accessToken); - ResponseForProjectResponse getProject(const boost::uuids::uuid& id); - ResponseForProjectResponse createProject(const boost::uuids::uuid& organizationId, const std::string& name); - ResponseForProjectResponse updateProject(const boost::uuids::uuid& id, const boost::uuids::uuid& organizationId, const std::string& name); - ResponseForProjectsDeleteResponse deleteProjects(const std::vector& ids); - ResponseForProjectsResponse listProjects(const boost::uuids::uuid &organizationId); - ResponseForSecretResponse getSecret(const boost::uuids::uuid& id); - ResponseForSecretResponse createSecret(const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds); - ResponseForSecretResponse updateSecret(const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds); - ResponseForSecretsDeleteResponse deleteSecrets(const std::vector& ids); - ResponseForSecretIdentifiersResponse listSecrets(const boost::uuids::uuid& organizationId); + void accessTokenLogin(const std::string& accessToken); + ProjectResponse getProject(const boost::uuids::uuid& id); + ProjectResponse createProject(const boost::uuids::uuid& organizationId, const std::string& name); + ProjectResponse updateProject(const boost::uuids::uuid& id, const boost::uuids::uuid& organizationId, const std::string& name); + ProjectsDeleteResponse deleteProjects(const std::vector& ids); + ProjectsResponse listProjects(const boost::uuids::uuid &organizationId); + SecretResponse getSecret(const boost::uuids::uuid& id); + SecretResponse createSecret(const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds); + SecretResponse updateSecret(const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds); + SecretsDeleteResponse deleteSecrets(const std::vector& ids); + SecretIdentifiersResponse listSecrets(const boost::uuids::uuid& organizationId); private: BitwardenLibrary* library; diff --git a/languages/cpp/include/CommandRunner.h b/languages/cpp/include/CommandRunner.h index fa3d25d9d..9aa6cbe9c 100644 --- a/languages/cpp/include/CommandRunner.h +++ b/languages/cpp/include/CommandRunner.h @@ -12,8 +12,8 @@ class CommandRunner { public: CommandRunner(BitwardenLibrary* library, void* client); - template - T runCommand(const Command& command, Func deserializer); + template + R runCommand(const Command& command, Func deserializer); @@ -25,8 +25,8 @@ class CommandRunner { nlohmann::json filterNullObjects(const nlohmann::json& input); }; -template -T CommandRunner::runCommand(const Command& command, Func deserializer) { +template +R CommandRunner::runCommand(const Command& command, Func deserializer) { // Serialize the Command object to a JSON string std::string jsonString = commandToString(command); const char* jsonCStr = jsonString.c_str(); @@ -40,6 +40,6 @@ T CommandRunner::runCommand(const Command& command, Func deserializer) { throw std::runtime_error(*deserialized.get_error_message()); } - return deserialized; + return deserialized.get_data().get(); } diff --git a/languages/cpp/include/Projects.h b/languages/cpp/include/Projects.h index 19be71978..9bef19b9c 100644 --- a/languages/cpp/include/Projects.h +++ b/languages/cpp/include/Projects.h @@ -8,11 +8,11 @@ class Projects { public: Projects(CommandRunner* commandRunner); - ResponseForProjectResponse get(const boost::uuids::uuid& id); - ResponseForProjectResponse create(const boost::uuids::uuid& organizationId, const std::string& name); - ResponseForProjectResponse update(const boost::uuids::uuid& id, const boost::uuids::uuid& organizationId, const std::string& name); - ResponseForProjectsDeleteResponse deleteProjects(const std::vector& ids); - ResponseForProjectsResponse list(const boost::uuids::uuid& organizationId); + ProjectResponse get(const boost::uuids::uuid& id); + ProjectResponse create(const boost::uuids::uuid& organizationId, const std::string& name); + ProjectResponse update(const boost::uuids::uuid& id, const boost::uuids::uuid& organizationId, const std::string& name); + ProjectsDeleteResponse deleteProjects(const std::vector& ids); + ProjectsResponse list(const boost::uuids::uuid& organizationId); private: CommandRunner* commandRunner; diff --git a/languages/cpp/include/Secrets.h b/languages/cpp/include/Secrets.h index 85a336c58..024ec3692 100644 --- a/languages/cpp/include/Secrets.h +++ b/languages/cpp/include/Secrets.h @@ -8,11 +8,11 @@ class Secrets { public: Secrets(CommandRunner* commandRunner); - ResponseForSecretResponse get(const boost::uuids::uuid& id); - ResponseForSecretResponse create(const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds); - ResponseForSecretResponse update(const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds); - ResponseForSecretsDeleteResponse deleteSecrets(const std::vector& ids); - ResponseForSecretIdentifiersResponse list(const boost::uuids::uuid& organizationId); + SecretResponse get(const boost::uuids::uuid& id); + SecretResponse create(const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds); + SecretResponse update(const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds); + SecretsDeleteResponse deleteSecrets(const std::vector& ids); + SecretIdentifiersResponse list(const boost::uuids::uuid& organizationId); private: CommandRunner* commandRunner; diff --git a/languages/cpp/src/BitwardenClient.cpp b/languages/cpp/src/BitwardenClient.cpp index 13050b1d6..51aedde7b 100644 --- a/languages/cpp/src/BitwardenClient.cpp +++ b/languages/cpp/src/BitwardenClient.cpp @@ -32,7 +32,7 @@ BitwardenClient::~BitwardenClient() { } } -ResponseForApiKeyLoginResponse BitwardenClient::accessTokenLogin(const std::string& accessToken) { +void BitwardenClient::accessTokenLogin(const std::string& accessToken) { Command command; AccessTokenLoginRequest accessTokenLoginRequest; accessTokenLoginRequest.set_access_token(accessToken); @@ -45,35 +45,35 @@ ResponseForApiKeyLoginResponse BitwardenClient::accessTokenLogin(const std::stri return loginResponse; }; try { - return commandRunner->runCommand(command, deserializer); + commandRunner->runCommand(command, deserializer); } catch (const std::exception& ex) { std::cerr << "Error in accessTokenLogin: " << ex.what() << std::endl; throw ex; } } -ResponseForProjectResponse BitwardenClient::getProject(const boost::uuids::uuid& id){ +ProjectResponse BitwardenClient::getProject(const boost::uuids::uuid& id){ if (!isClientOpen) { throw std::runtime_error("Client is not open."); } return projects.get(id); } -ResponseForProjectResponse BitwardenClient::createProject(const boost::uuids::uuid& organizationId, const std::string& name){ +ProjectResponse BitwardenClient::createProject(const boost::uuids::uuid& organizationId, const std::string& name){ if (!isClientOpen) { throw std::runtime_error("Client is not open."); } return projects.create(organizationId, name); } -ResponseForProjectResponse BitwardenClient::updateProject(const boost::uuids::uuid& id, const boost::uuids::uuid& organizationId, const std::string& name){ +ProjectResponse BitwardenClient::updateProject(const boost::uuids::uuid& id, const boost::uuids::uuid& organizationId, const std::string& name){ if (!isClientOpen) { throw std::runtime_error("Client is not open."); } return projects.update(id, organizationId, name); } -ResponseForProjectsDeleteResponse BitwardenClient::deleteProjects(const std::vector& ids) { +ProjectsDeleteResponse BitwardenClient::deleteProjects(const std::vector& ids) { if (!isClientOpen) { throw std::runtime_error("Client is not open."); } @@ -81,7 +81,7 @@ ResponseForProjectsDeleteResponse BitwardenClient::deleteProjects(const std::vec } -ResponseForProjectsResponse BitwardenClient::listProjects(const boost::uuids::uuid &organizationId) { +ProjectsResponse BitwardenClient::listProjects(const boost::uuids::uuid &organizationId) { if (!isClientOpen) { throw std::runtime_error("Client is not open."); } @@ -89,28 +89,28 @@ ResponseForProjectsResponse BitwardenClient::listProjects(const boost::uuids::uu } -ResponseForSecretResponse BitwardenClient::getSecret(const boost::uuids::uuid& id){ +SecretResponse BitwardenClient::getSecret(const boost::uuids::uuid& id){ if (!isClientOpen) { throw std::runtime_error("Client is not open."); } return secrets.get(id); } -ResponseForSecretResponse BitwardenClient::createSecret(const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds){ +SecretResponse BitwardenClient::createSecret(const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds){ if (!isClientOpen) { throw std::runtime_error("Client is not open."); } return secrets.create(key, value, note, organizationId, projectIds); } -ResponseForSecretResponse BitwardenClient::updateSecret(const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds){ +SecretResponse BitwardenClient::updateSecret(const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds){ if (!isClientOpen) { throw std::runtime_error("Client is not open."); } return secrets.update(id, key, value, note, organizationId, projectIds); } -ResponseForSecretsDeleteResponse BitwardenClient::deleteSecrets(const std::vector& ids) { +SecretsDeleteResponse BitwardenClient::deleteSecrets(const std::vector& ids) { if (!isClientOpen) { throw std::runtime_error("Client is not open."); } @@ -118,7 +118,7 @@ ResponseForSecretsDeleteResponse BitwardenClient::deleteSecrets(const std::vecto } -ResponseForSecretIdentifiersResponse BitwardenClient::listSecrets(const boost::uuids::uuid &organizationId) { +SecretIdentifiersResponse BitwardenClient::listSecrets(const boost::uuids::uuid &organizationId) { if (!isClientOpen) { throw std::runtime_error("Client is not open."); } diff --git a/languages/cpp/src/Projects.cpp b/languages/cpp/src/Projects.cpp index 4dfbce472..d0aa6ed49 100644 --- a/languages/cpp/src/Projects.cpp +++ b/languages/cpp/src/Projects.cpp @@ -28,7 +28,7 @@ auto projectListDeserializer = [](const char* response) -> ResponseForProjectsRe return listResponse; }; -ResponseForProjectResponse Projects::get(const boost::uuids::uuid& id) { +ProjectResponse Projects::get(const boost::uuids::uuid& id) { Command command; ProjectsCommand projectsCommand; ProjectGetRequest projectGetRequest; @@ -40,14 +40,14 @@ ResponseForProjectResponse Projects::get(const boost::uuids::uuid& id) { command.set_projects(projectsCommand); try { - return commandRunner->runCommand(command, projectsDeserializer); + return commandRunner->runCommand(command, projectsDeserializer); } catch (const std::exception& ex) { std::cerr << "Error in getProject: " << ex.what() << std::endl; throw ex; } } -ResponseForProjectResponse Projects::create(const boost::uuids::uuid& organizationId, const std::string& name) { +ProjectResponse Projects::create(const boost::uuids::uuid& organizationId, const std::string& name) { Command command; ProjectsCommand projectsCommand; ProjectCreateRequest projectCreateRequest; @@ -60,14 +60,14 @@ ResponseForProjectResponse Projects::create(const boost::uuids::uuid& organizati command.set_projects(projectsCommand); try { - return commandRunner->runCommand(command, projectsDeserializer); + return commandRunner->runCommand(command, projectsDeserializer); } catch (const std::exception& ex) { std::cerr << "Error in createProject: " << ex.what() << std::endl; throw ex; } } -ResponseForProjectResponse Projects::update(const boost::uuids::uuid& id, const boost::uuids::uuid& organizationId, const std::string& name) { +ProjectResponse Projects::update(const boost::uuids::uuid& id, const boost::uuids::uuid& organizationId, const std::string& name) { Command command; ProjectsCommand projectsCommand; ProjectPutRequest projectPutRequest; @@ -83,14 +83,14 @@ ResponseForProjectResponse Projects::update(const boost::uuids::uuid& id, const command.set_projects(projectsCommand); try { - return commandRunner->runCommand(command, projectsDeserializer); + return commandRunner->runCommand(command, projectsDeserializer); } catch (const std::exception& ex) { std::cerr << "Error in updateProject: " << ex.what() << std::endl; throw ex; } } -ResponseForProjectsDeleteResponse Projects::deleteProjects(const std::vector& ids) { +ProjectsDeleteResponse Projects::deleteProjects(const std::vector& ids) { Command command; ProjectsCommand projectsCommand; ProjectsDeleteRequest projectsDeleteRequest; @@ -105,14 +105,14 @@ ResponseForProjectsDeleteResponse Projects::deleteProjects(const std::vectorrunCommand(command, deleteProjectsDeserializer); + return commandRunner->runCommand(command, deleteProjectsDeserializer); } catch (const std::exception& ex) { std::cerr << "Error in deleteProjects: " << ex.what() << std::endl; throw ex; } } -ResponseForProjectsResponse Projects::list(const boost::uuids::uuid& organizationId) { +ProjectsResponse Projects::list(const boost::uuids::uuid& organizationId) { Command command; ProjectsCommand projectsCommand; ProjectsListRequest projectsListRequest; @@ -124,7 +124,7 @@ ResponseForProjectsResponse Projects::list(const boost::uuids::uuid& organizatio command.set_projects(projectsCommand); try { - return commandRunner->runCommand(command, projectListDeserializer); + return commandRunner->runCommand(command, projectListDeserializer); } catch (const std::exception& ex) { std::cerr << "Error in listProjects: " << ex.what() << std::endl; throw ex; diff --git a/languages/cpp/src/Secrets.cpp b/languages/cpp/src/Secrets.cpp index 8fedc5e86..e153ea7f1 100644 --- a/languages/cpp/src/Secrets.cpp +++ b/languages/cpp/src/Secrets.cpp @@ -27,7 +27,7 @@ auto secretListDeserializer = [](const std::string& response) -> ResponseForSecr return listResponse; }; -ResponseForSecretResponse Secrets::get(const boost::uuids::uuid& id) { +SecretResponse Secrets::get(const boost::uuids::uuid& id) { Command command; SecretsCommand secretsCommand; SecretGetRequest secretGetRequest; @@ -39,14 +39,14 @@ ResponseForSecretResponse Secrets::get(const boost::uuids::uuid& id) { command.set_secrets(secretsCommand); try { - return commandRunner->runCommand(command, secretsDeserializer); + return commandRunner->runCommand(command, secretsDeserializer); } catch (const std::exception& ex) { std::cerr << "Error in getSecret: " << ex.what() << std::endl; throw ex; } } -ResponseForSecretResponse Secrets::create(const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds) { +SecretResponse Secrets::create(const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds) { Command command; SecretsCommand secretsCommand; SecretCreateRequest secretCreateRequest; @@ -68,14 +68,14 @@ ResponseForSecretResponse Secrets::create(const std::string& key, const std::str command.set_secrets(secretsCommand); try { - return commandRunner->runCommand(command, secretsDeserializer); + return commandRunner->runCommand(command, secretsDeserializer); } catch (const std::exception& ex) { std::cerr << "Error in createSecret: " << ex.what() << std::endl; throw ex; } } -ResponseForSecretResponse Secrets::update(const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds) { +SecretResponse Secrets::update(const boost::uuids::uuid& id, const std::string& key, const std::string& value, const std::string& note, const boost::uuids::uuid& organizationId, const std::vector& projectIds) { Command command; SecretsCommand secretsCommand; SecretPutRequest secretPutRequest; @@ -100,14 +100,14 @@ ResponseForSecretResponse Secrets::update(const boost::uuids::uuid& id, const st command.set_secrets(secretsCommand); try { - return commandRunner->runCommand(command, secretsDeserializer); + return commandRunner->runCommand(command, secretsDeserializer); } catch (const std::exception& ex) { std::cerr << "Error in updateSecret: " << ex.what() << std::endl; throw ex; } } -ResponseForSecretsDeleteResponse Secrets::deleteSecrets(const std::vector& ids) { +SecretsDeleteResponse Secrets::deleteSecrets(const std::vector& ids) { Command command; SecretsCommand secretsCommand; SecretsDeleteRequest secretsDeleteRequest; @@ -122,14 +122,14 @@ ResponseForSecretsDeleteResponse Secrets::deleteSecrets(const std::vectorrunCommand(command, deleteSecretsDeserializer); + return commandRunner->runCommand(command, deleteSecretsDeserializer); } catch (const std::exception& ex) { std::cerr << "Error in deleteSecrets: " << ex.what() << std::endl; throw ex; } } -ResponseForSecretIdentifiersResponse Secrets::list(const boost::uuids::uuid& organizationId) { +SecretIdentifiersResponse Secrets::list(const boost::uuids::uuid& organizationId) { Command command; SecretsCommand secretsCommand; SecretIdentifiersRequest secretIdentifiersRequest; @@ -141,7 +141,7 @@ ResponseForSecretIdentifiersResponse Secrets::list(const boost::uuids::uuid& org command.set_secrets(secretsCommand); try { - return commandRunner->runCommand(command, secretListDeserializer); + return commandRunner->runCommand(command, secretListDeserializer); } catch (const std::exception& ex) { std::cerr << "Error in listSecret: " << ex.what() << std::endl; throw ex;