-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathoauth-applications.ts
More file actions
144 lines (125 loc) · 3.91 KB
/
oauth-applications.ts
File metadata and controls
144 lines (125 loc) · 3.91 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../core/resource';
import { APIPromise } from '../core/api-promise';
import { Page, type PageParams, PagePromise } from '../core/pagination';
import { RequestOptions } from '../internal/request-options';
import { path } from '../internal/utils/path';
export class OAuthApplications extends APIResource {
/**
* Retrieve an OAuth Application
*
* @example
* ```ts
* const oauthApplication =
* await client.oauthApplications.retrieve(
* 'application_gj9ufmpgh5i56k4vyriy',
* );
* ```
*/
retrieve(oauthApplicationID: string, options?: RequestOptions): APIPromise<OAuthApplication> {
return this._client.get(path`/oauth_applications/${oauthApplicationID}`, options);
}
/**
* List OAuth Applications
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const oauthApplication of client.oauthApplications.list()) {
* // ...
* }
* ```
*/
list(
query: OAuthApplicationListParams | null | undefined = {},
options?: RequestOptions,
): PagePromise<OAuthApplicationsPage, OAuthApplication> {
return this._client.getAPIList('/oauth_applications', Page<OAuthApplication>, { query, ...options });
}
}
export type OAuthApplicationsPage = Page<OAuthApplication>;
/**
* An OAuth Application lets you build an application for others to use with their
* Increase data. You can create an OAuth Application via the Dashboard and read
* information about it with the API. Learn more about OAuth
* [here](https://increase.com/documentation/oauth).
*/
export interface OAuthApplication {
/**
* The OAuth Application's identifier.
*/
id: string;
/**
* The OAuth Application's client_id. Use this to authenticate with the OAuth
* Application.
*/
client_id: string;
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp when the OAuth
* Application was created.
*/
created_at: string;
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp when the OAuth
* Application was deleted.
*/
deleted_at: string | null;
/**
* The name you chose for this OAuth Application.
*/
name: string | null;
/**
* Whether the application is active.
*
* - `active` - The application is active and can be used by your users.
* - `deleted` - The application is deleted.
*/
status: 'active' | 'deleted';
/**
* A constant representing the object's type. For this resource it will always be
* `oauth_application`.
*/
type: 'oauth_application';
}
export interface OAuthApplicationListParams extends PageParams {
created_at?: OAuthApplicationListParams.CreatedAt;
status?: OAuthApplicationListParams.Status;
}
export namespace OAuthApplicationListParams {
export interface CreatedAt {
/**
* Return results after this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
* timestamp.
*/
after?: string;
/**
* Return results before this [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601)
* timestamp.
*/
before?: string;
/**
* Return results on or after this
* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
*/
on_or_after?: string;
/**
* Return results on or before this
* [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp.
*/
on_or_before?: string;
}
export interface Status {
/**
* Return results whose value is in the provided list. For GET requests, this
* should be encoded as a comma-delimited string, such as `?in=one,two,three`.
*/
in?: Array<'active' | 'deleted'>;
}
}
export declare namespace OAuthApplications {
export {
type OAuthApplication as OAuthApplication,
type OAuthApplicationsPage as OAuthApplicationsPage,
type OAuthApplicationListParams as OAuthApplicationListParams,
};
}