-
Notifications
You must be signed in to change notification settings - Fork 122
/
Copy pathClient.ts
192 lines (167 loc) · 6.42 KB
/
Client.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
/**
* This file was auto-generated by Fern from our API Definition.
*/
import * as environments from "./environments";
import * as core from "./core";
import { Admins } from "./api/resources/admins/client/Client";
import { Articles } from "./api/resources/articles/client/Client";
import { HelpCenters } from "./api/resources/helpCenters/client/Client";
import { Companies } from "./api/resources/companies/client/Client";
import { Contacts } from "./api/resources/contacts/client/Client";
import { Notes } from "./api/resources/notes/client/Client";
import { Tags } from "./api/resources/tags/client/Client";
import { Conversations } from "./api/resources/conversations/client/Client";
import { DataAttributes } from "./api/resources/dataAttributes/client/Client";
import { Events } from "./api/resources/events/client/Client";
import { DataExport } from "./api/resources/dataExport/client/Client";
import { Messages } from "./api/resources/messages/client/Client";
import { Segments } from "./api/resources/segments/client/Client";
import { SubscriptionTypes } from "./api/resources/subscriptionTypes/client/Client";
import { PhoneCallRedirects } from "./api/resources/phoneCallRedirects/client/Client";
import { Teams } from "./api/resources/teams/client/Client";
import { TicketTypes } from "./api/resources/ticketTypes/client/Client";
import { Tickets } from "./api/resources/tickets/client/Client";
import { Visitors } from "./api/resources/visitors/client/Client";
import { News } from "./api/resources/news/client/Client";
export declare namespace IntercomClient {
export interface Options {
environment?: core.Supplier<environments.IntercomEnvironment | string>;
/** Specify a custom URL to connect the client to. */
baseUrl?: core.Supplier<string>;
token?: core.Supplier<core.BearerToken | undefined>;
/** Override the Intercom-Version header */
version?:
| "1.0"
| "1.1"
| "1.2"
| "1.3"
| "1.4"
| "2.0"
| "2.1"
| "2.2"
| "2.3"
| "2.4"
| "2.5"
| "2.6"
| "2.7"
| "2.8"
| "2.9"
| "2.10"
| "2.11"
| "Unstable";
fetcher?: core.FetchFunction;
}
export interface RequestOptions {
/** The maximum time to wait for a response in seconds. */
timeoutInSeconds?: number;
/** The number of times to retry the request. Defaults to 2. */
maxRetries?: number;
/** A hook to abort the request. */
abortSignal?: AbortSignal;
/** Additional headers to include in the request. */
headers?: Record<string, string>;
/** Override the Intercom-Version header */
version?:
| "1.0"
| "1.1"
| "1.2"
| "1.3"
| "1.4"
| "2.0"
| "2.1"
| "2.2"
| "2.3"
| "2.4"
| "2.5"
| "2.6"
| "2.7"
| "2.8"
| "2.9"
| "2.10"
| "2.11"
| "Unstable";
}
}
export class IntercomClient {
protected _admins: Admins | undefined;
protected _articles: Articles | undefined;
protected _helpCenters: HelpCenters | undefined;
protected _companies: Companies | undefined;
protected _contacts: Contacts | undefined;
protected _notes: Notes | undefined;
protected _tags: Tags | undefined;
protected _conversations: Conversations | undefined;
protected _dataAttributes: DataAttributes | undefined;
protected _events: Events | undefined;
protected _dataExport: DataExport | undefined;
protected _messages: Messages | undefined;
protected _segments: Segments | undefined;
protected _subscriptionTypes: SubscriptionTypes | undefined;
protected _phoneCallRedirects: PhoneCallRedirects | undefined;
protected _teams: Teams | undefined;
protected _ticketTypes: TicketTypes | undefined;
protected _tickets: Tickets | undefined;
protected _visitors: Visitors | undefined;
protected _news: News | undefined;
constructor(protected readonly _options: IntercomClient.Options = {}) {}
public get admins(): Admins {
return (this._admins ??= new Admins(this._options));
}
public get articles(): Articles {
return (this._articles ??= new Articles(this._options));
}
public get helpCenters(): HelpCenters {
return (this._helpCenters ??= new HelpCenters(this._options));
}
public get companies(): Companies {
return (this._companies ??= new Companies(this._options));
}
public get contacts(): Contacts {
return (this._contacts ??= new Contacts(this._options));
}
public get notes(): Notes {
return (this._notes ??= new Notes(this._options));
}
public get tags(): Tags {
return (this._tags ??= new Tags(this._options));
}
public get conversations(): Conversations {
return (this._conversations ??= new Conversations(this._options));
}
public get dataAttributes(): DataAttributes {
return (this._dataAttributes ??= new DataAttributes(this._options));
}
public get events(): Events {
return (this._events ??= new Events(this._options));
}
public get dataExport(): DataExport {
return (this._dataExport ??= new DataExport(this._options));
}
public get messages(): Messages {
return (this._messages ??= new Messages(this._options));
}
public get segments(): Segments {
return (this._segments ??= new Segments(this._options));
}
public get subscriptionTypes(): SubscriptionTypes {
return (this._subscriptionTypes ??= new SubscriptionTypes(this._options));
}
public get phoneCallRedirects(): PhoneCallRedirects {
return (this._phoneCallRedirects ??= new PhoneCallRedirects(this._options));
}
public get teams(): Teams {
return (this._teams ??= new Teams(this._options));
}
public get ticketTypes(): TicketTypes {
return (this._ticketTypes ??= new TicketTypes(this._options));
}
public get tickets(): Tickets {
return (this._tickets ??= new Tickets(this._options));
}
public get visitors(): Visitors {
return (this._visitors ??= new Visitors(this._options));
}
public get news(): News {
return (this._news ??= new News(this._options));
}
}