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 }, + ); +}