pub const fleet = @import("fleet.zig"); const st = @import("root.zig"); const http = st.http; const Client = http.Client; const Response = st.http.Response; const models = st.models; const Wrapper = models.Wrapper; const Query = models.Query; pub fn account(client: *Client) !Response(models.accounts.AccountWrapper) { return client.request( Wrapper(models.accounts.AccountWrapper), "/my/account", .{}, .{ .auth = .agent }, ); } pub fn info(client: *Client) !http.RawResponse(models.Info) { return client.request( models.Info, "/", .{}, .{ .auth = .none }, ); } pub const agent = struct { pub fn register( client: *Client, symbol: []const u8, faction: models.factions.Symbol, ) !Response(models.agents.Register) { return client.post( Wrapper(models.agents.Register), "/register", .{}, .{ .symbol = symbol, .faction = faction }, .account, ); } pub fn list(client: *Client, opts: Query) !Response([]models.agents.Agent) { return client.get( Wrapper([]models.agents.Agent), "/agents{f}", .{opts}, .agent, ); } pub fn get(client: *Client, symbol: []const u8) !Response(models.agents.Agent) { return client.get( Wrapper(models.agents.Agent), "/agents/{s}", .{symbol}, .agent, ); } pub fn own(client: *Client) !Response(models.agents.Agent) { return client.get( Wrapper(models.agents.Agent), "/my/agent", .{}, .agent, ); } };