forked from hiero-ledger/hiero-sdk-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGetFileInfoParams.h
More file actions
42 lines (35 loc) · 1003 Bytes
/
GetFileInfoParams.h
File metadata and controls
42 lines (35 loc) · 1003 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// SPDX-License-Identifier: Apache-2.0
#ifndef HIERO_TCK_CPP_GET_FILE_INFO_PARAMS_H_
#define HIERO_TCK_CPP_GET_FILE_INFO_PARAMS_H_
#include "json/JsonUtils.h"
#include <nlohmann/json.hpp>
#include <optional>
#include <string>
namespace Hiero::TCK::FileService
{
/**
* Struct to hold the arguments for a `getFileInfo` JSON-RPC method call.
*/
struct GetFileInfoParams
{
/**
* The ID of the file to query.
*/
std::optional<std::string> mFileId;
};
} // namespace Hiero::TCK::FileService
namespace nlohmann
{
/**
* JSON serializer template specialization required to convert GetFileInfoParams arguments properly.
*/
template<>
struct [[maybe_unused]] adl_serializer<Hiero::TCK::FileService::GetFileInfoParams>
{
static void from_json(const json& jsonFrom, Hiero::TCK::FileService::GetFileInfoParams& params)
{
params.mFileId = Hiero::TCK::getOptionalJsonParameter<std::string>(jsonFrom, "fileId");
}
};
} // namespace nlohmann
#endif // HIERO_TCK_CPP_GET_FILE_INFO_PARAMS_H_