This repository has been archived by the owner on Jun 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Updated GraphQL templates - Added `GetAssetsFromProjects` query to project schema - Added `GetBalancesFromProjects` query to shared schema
- Loading branch information
1 parent
69483ac
commit 6671723
Showing
23 changed files
with
701 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,126 @@ | ||
/* Copyright 2023 Enjin Pte. Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef ENJINSDK_PROJECTGETASSETSFROMPROJECTS_HPP | ||
#define ENJINSDK_PROJECTGETASSETSFROMPROJECTS_HPP | ||
|
||
#include "enjinsdk_export.h" | ||
#include "enjinsdk/internal/AbstractGraphqlRequest.hpp" | ||
#include "enjinsdk/models/AssetFilter.hpp" | ||
#include "enjinsdk/models/AssetSortInput.hpp" | ||
#include "enjinsdk/shared/AssetFragmentArguments.hpp" | ||
#include "enjinsdk/shared/PaginationArguments.hpp" | ||
#include <optional> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace enjin::sdk::project { | ||
|
||
/// \brief Request for getting assets from different projects on the platform. | ||
class ENJINSDK_EXPORT GetAssetsFromProjects : public graphql::AbstractGraphqlRequest, | ||
public shared::AssetFragmentArguments<GetAssetsFromProjects>, | ||
public shared::PaginationArguments<GetAssetsFromProjects> { | ||
public: | ||
/// \brief Default constructor. | ||
GetAssetsFromProjects(); | ||
|
||
~GetAssetsFromProjects() override = default; | ||
|
||
[[nodiscard]] std::string serialize() const override; | ||
|
||
/// \brief Sets the project UUIDs. | ||
/// \param projects The UUIDs. | ||
/// \return This request for chaining. | ||
GetAssetsFromProjects& set_projects(std::vector<std::string> projects); | ||
|
||
/// \brief Sets the filter the request will use. | ||
/// \param filter The filter. | ||
/// \return This request for chaining. | ||
GetAssetsFromProjects& set_filter(models::AssetFilter filter); | ||
|
||
/// \brief Sets the request to sort the results by the specified options. | ||
/// \param sort The sort input. | ||
/// \return This request for chaining. | ||
GetAssetsFromProjects& set_sort(models::AssetSortInput sort); | ||
|
||
[[nodiscard]] json::JsonValue to_json() const override; | ||
|
||
bool operator==(const GetAssetsFromProjects& rhs) const; | ||
|
||
bool operator!=(const GetAssetsFromProjects& rhs) const; | ||
|
||
private: | ||
std::optional<std::vector<std::string>> projects_opt; | ||
std::optional<models::AssetFilter> filter_opt; | ||
std::optional<models::AssetSortInput> sort_opt; | ||
}; | ||
|
||
} | ||
|
||
namespace enjin::sdk::shared { | ||
|
||
// region AssetFragmentArguments | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_asset_id_format(models::AssetIdFormat asset_id_format); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_state_data(); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_config_data(); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_asset_blocks(); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_creator(); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_melt_details(); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_metadata_uri(); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_supply_details(); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_transfer_settings(); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_asset_variant_mode(); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_asset_variants(); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
AssetFragmentArguments<project::GetAssetsFromProjects>::set_with_variant_metadata(); | ||
|
||
// endregion AssetFragmentArguments | ||
|
||
// region PaginationArguments | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
PaginationArguments<project::GetAssetsFromProjects>::set_pagination(models::PaginationInput pagination); | ||
|
||
template ENJINSDK_EXPORT project::GetAssetsFromProjects& | ||
PaginationArguments<project::GetAssetsFromProjects>::set_pagination(int page, int limit); | ||
|
||
// endregion PaginationArguments | ||
|
||
} | ||
|
||
#endif //ENJINSDK_PROJECTGETASSETSFROMPROJECTS_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/* Copyright 2023 Enjin Pte. Ltd. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
#ifndef ENJINSDK_GETBALANCESFROMPROJECTS_HPP | ||
#define ENJINSDK_GETBALANCESFROMPROJECTS_HPP | ||
|
||
#include "enjinsdk_export.h" | ||
#include "enjinsdk/internal/AbstractGraphqlRequest.hpp" | ||
#include "enjinsdk/models/BalanceFilter.hpp" | ||
#include "enjinsdk/shared/BalanceFragmentArguments.hpp" | ||
#include "enjinsdk/shared/PaginationArguments.hpp" | ||
#include <optional> | ||
#include <string> | ||
#include <vector> | ||
|
||
namespace enjin::sdk::shared { | ||
|
||
/// \brief Request for getting balances from different projects on the platform. | ||
class ENJINSDK_EXPORT GetBalancesFromProjects : public graphql::AbstractGraphqlRequest, | ||
public BalanceFragmentArguments<GetBalancesFromProjects>, | ||
public PaginationArguments<GetBalancesFromProjects> { | ||
public: | ||
/// \brief Default constructor. | ||
GetBalancesFromProjects(); | ||
|
||
/// \brief Class destructor. | ||
~GetBalancesFromProjects() override = default; | ||
|
||
[[nodiscard]] std::string serialize() const override; | ||
|
||
/// \brief Sets the project UUIDs. | ||
/// \param projects The UUIDs. | ||
/// \return This request for chaining. | ||
GetBalancesFromProjects& set_projects(std::vector<std::string> projects); | ||
|
||
/// \brief Sets the filter the request will use. | ||
/// \param filter The filter. | ||
/// \return This request for chaining. | ||
GetBalancesFromProjects& set_filter(models::BalanceFilter filter); | ||
|
||
[[nodiscard]] json::JsonValue to_json() const override; | ||
|
||
bool operator==(const GetBalancesFromProjects& rhs) const; | ||
|
||
bool operator!=(const GetBalancesFromProjects& rhs) const; | ||
|
||
private: | ||
std::optional<std::vector<std::string>> projects_opt; | ||
std::optional<models::BalanceFilter> filter_opt; | ||
}; | ||
|
||
// region BalanceFragmentArguments | ||
|
||
template ENJINSDK_EXPORT GetBalancesFromProjects& | ||
BalanceFragmentArguments<GetBalancesFromProjects>::set_bal_id_format(models::AssetIdFormat bal_id_format); | ||
|
||
template ENJINSDK_EXPORT GetBalancesFromProjects& | ||
BalanceFragmentArguments<GetBalancesFromProjects>::set_bal_index_format(models::AssetIndexFormat bal_index_format); | ||
|
||
template ENJINSDK_EXPORT GetBalancesFromProjects& | ||
BalanceFragmentArguments<GetBalancesFromProjects>::set_with_bal_project_uuid(); | ||
|
||
template ENJINSDK_EXPORT GetBalancesFromProjects& | ||
BalanceFragmentArguments<GetBalancesFromProjects>::set_with_bal_wallet_address(); | ||
|
||
// endregion BalanceFragmentArguments | ||
|
||
// region PaginationArguments | ||
|
||
template ENJINSDK_EXPORT GetBalancesFromProjects& | ||
PaginationArguments<GetBalancesFromProjects>::set_pagination(models::PaginationInput pagination); | ||
|
||
template ENJINSDK_EXPORT GetBalancesFromProjects& | ||
PaginationArguments<GetBalancesFromProjects>::set_pagination(int page, int limit); | ||
|
||
// endregion PaginationArguments | ||
|
||
} | ||
|
||
#endif //ENJINSDK_GETBALANCESFROMPROJECTS_HPP |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.