-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapps.ts
96 lines (78 loc) · 2.14 KB
/
apps.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../resource';
import * as Core from '../../core';
import * as UsersAPI from './users/users';
import {
PageUser,
User,
UserCreateParams,
UserListParams,
UserUpdateParams,
Users,
UsersPage,
} from './users/users';
export class Apps extends APIResource {
users: UsersAPI.Users = new UsersAPI.Users(this._client);
/**
* Create a new App
*/
create(body: AppCreateParams, options?: Core.RequestOptions): Core.APIPromise<App> {
return this._client.post('/v1/apps', { body, ...options });
}
/**
* Update an App
*/
update(appId: string, body: AppUpdateParams, options?: Core.RequestOptions): Core.APIPromise<App> {
return this._client.put(`/v1/apps/${appId}`, { body, ...options });
}
/**
* Get an App by ID
*/
get(appId: string, options?: Core.RequestOptions): Core.APIPromise<App> {
return this._client.get(`/v1/apps/${appId}`, options);
}
/**
* Get an App by Name
*/
getByName(name: string, options?: Core.RequestOptions): Core.APIPromise<App> {
return this._client.get(`/v1/apps/name/${name}`, options);
}
/**
* Get or Create an App
*/
getOrCreate(name: string, options?: Core.RequestOptions): Core.APIPromise<App> {
return this._client.get(`/v1/apps/get_or_create/${name}`, options);
}
}
export interface App {
id: string;
created_at: string;
metadata: Record<string, unknown>;
name: string;
}
export interface AppCreateParams {
name: string;
metadata?: Record<string, unknown>;
}
export interface AppUpdateParams {
metadata?: Record<string, unknown> | null;
name?: string | null;
}
Apps.Users = Users;
Apps.UsersPage = UsersPage;
export declare namespace Apps {
export {
type App as App,
type AppCreateParams as AppCreateParams,
type AppUpdateParams as AppUpdateParams,
};
export {
Users as Users,
type PageUser as PageUser,
type User as User,
UsersPage as UsersPage,
type UserCreateParams as UserCreateParams,
type UserUpdateParams as UserUpdateParams,
type UserListParams as UserListParams,
};
}