import { IDL } from '@icp-sdk/core/candid';
export const idlFactory = ({ IDL }) => {
const Post = IDL.Record({
'id' : IDL.Int64,
'title' : IDL.Text,
'body' : IDL.Text,
'author' : IDL.Text,
'summary' : IDL.Text,
});
const GetPostResult = IDL.Variant({ 'Ok' : Post, 'Err' : IDL.Text });
const HeaderField = IDL.Tuple(IDL.Text, IDL.Text);
const HttpRequest = IDL.Record({
'url' : IDL.Text,
'method' : IDL.Text,
'body' : IDL.Vec(IDL.Nat8),
'headers' : IDL.Vec(HeaderField),
'certificate_version' : IDL.Opt(IDL.Nat16),
});
const HttpResponse = IDL.Record({
'body' : IDL.Vec(IDL.Nat8),
'headers' : IDL.Vec(HeaderField),
'status_code' : IDL.Nat16,
});
return IDL.Service({
'get_post' : IDL.Func([IDL.Int64], [GetPostResult], ['query']),
'http_request' : IDL.Func([HttpRequest], [HttpResponse], ['query']),
'http_request_update' : IDL.Func([HttpRequest], [HttpResponse], []),
'list_posts' : IDL.Func([], [IDL.Vec(Post)], ['query']),
});
};
export const init = ({ IDL }) => { return []; };