Search in sources :

Example 1 with FileGetInfoQuery

use of com.hederahashgraph.api.proto.java.FileGetInfoQuery in project hedera-services by hashgraph.

the class RequestBuilder method getFileGetInfoBuilder.

/**
 * Get file get info builder
 *
 * @param payment
 * 		payment
 * @param fileID
 * 		file ID
 * @param responseType
 * 		response type
 * @return query
 */
public static Query getFileGetInfoBuilder(Transaction payment, FileID fileID, ResponseType responseType) {
    QueryHeader queryHeader = QueryHeader.newBuilder().setPayment(payment).setResponseType(responseType).build();
    FileGetInfoQuery fileGetInfoQuery = FileGetInfoQuery.newBuilder().setHeader(queryHeader).setFileID(fileID).build();
    return Query.newBuilder().setFileGetInfo(fileGetInfoQuery).build();
}
Also used : FileGetInfoQuery(com.hederahashgraph.api.proto.java.FileGetInfoQuery) QueryHeader(com.hederahashgraph.api.proto.java.QueryHeader)

Example 2 with FileGetInfoQuery

use of com.hederahashgraph.api.proto.java.FileGetInfoQuery in project hedera-services by hashgraph.

the class HapiGetFileInfo method getFileInfoQuery.

private Query getFileInfoQuery(HapiApiSpec spec, Transaction payment, boolean costOnly) {
    file = fileSupplier.isPresent() ? fileSupplier.get().get() : file;
    var id = TxnUtils.asFileId(file, spec);
    fileId = id;
    FileGetInfoQuery infoQuery = FileGetInfoQuery.newBuilder().setHeader(costOnly ? answerCostHeader(payment) : answerHeader(payment)).setFileID(id).build();
    return Query.newBuilder().setFileGetInfo(infoQuery).build();
}
Also used : FileGetInfoQuery(com.hederahashgraph.api.proto.java.FileGetInfoQuery)

Aggregations

FileGetInfoQuery (com.hederahashgraph.api.proto.java.FileGetInfoQuery)2 QueryHeader (com.hederahashgraph.api.proto.java.QueryHeader)1