tangled
alpha
login
or
join now
altagos.dev
/
space
0
fork
atom
A SpaceTraders Agent
0
fork
atom
overview
issues
pulls
pipelines
account model + get request
altagos.dev
4 months ago
6864f9d8
5b3f18b2
verified
This commit was signed with the committer's
known signature
.
altagos.dev
SSH Key Fingerprint:
SHA256:UbTjEcCZlc6GzQWLCuDK3D//HESWD2xFPkzue9XMras=
+26
2 changed files
expand all
collapse all
unified
split
src
st
models
accounts.zig
models.zig
+2
src/st/models.zig
···
1
1
+
pub const accounts = @import("models/accounts.zig");
2
2
+
1
3
pub const Info = @import("models/Info.zig");
2
4
3
5
pub fn Wrapper(comptime T: type) type {
+24
src/st/models/accounts.zig
···
1
1
+
const st = @import("../root.zig");
2
2
+
const Client = st.http.Client;
3
3
+
const Response = st.http.Response;
4
4
+
const Wrapper = st.models.Wrapper;
5
5
+
6
6
+
pub const AccountWrapper = struct {
7
7
+
account: Account,
8
8
+
};
9
9
+
10
10
+
pub const Account = struct {
11
11
+
id: []const u8,
12
12
+
email: ?[]const u8 = null,
13
13
+
token: ?[]const u8 = null,
14
14
+
createdAt: []const u8,
15
15
+
};
16
16
+
17
17
+
pub fn get(client: *Client) !Response(AccountWrapper) {
18
18
+
return client.request(
19
19
+
Wrapper(AccountWrapper),
20
20
+
"/my/account",
21
21
+
.{},
22
22
+
.{ .auth = .agent },
23
23
+
);
24
24
+
}