From 6864f9d8bb3883681f7e16b38a0e92375d2d7383 Mon Sep 17 00:00:00 2001 From: Altagos Date: Sat, 8 Nov 2025 17:59:36 +0100 Subject: [PATCH] account model + get request --- src/st/models.zig | 2 ++ src/st/models/accounts.zig | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 src/st/models/accounts.zig diff --git a/src/st/models.zig b/src/st/models.zig index f5b7210..e2bf4e8 100644 --- a/src/st/models.zig +++ b/src/st/models.zig @@ -1,3 +1,5 @@ +pub const accounts = @import("models/accounts.zig"); + pub const Info = @import("models/Info.zig"); pub fn Wrapper(comptime T: type) type { diff --git a/src/st/models/accounts.zig b/src/st/models/accounts.zig new file mode 100644 index 0000000..69be75a --- /dev/null +++ b/src/st/models/accounts.zig @@ -0,0 +1,24 @@ +const st = @import("../root.zig"); +const Client = st.http.Client; +const Response = st.http.Response; +const Wrapper = st.models.Wrapper; + +pub const AccountWrapper = struct { + account: Account, +}; + +pub const Account = struct { + id: []const u8, + email: ?[]const u8 = null, + token: ?[]const u8 = null, + createdAt: []const u8, +}; + +pub fn get(client: *Client) !Response(AccountWrapper) { + return client.request( + Wrapper(AccountWrapper), + "/my/account", + .{}, + .{ .auth = .agent }, + ); +} -- 2.51.2