-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplates.ts
90 lines (63 loc) · 2.62 KB
/
templates.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
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../resource';
import * as Core from '../core';
import * as TemplatesAPI from './templates';
export class Templates extends APIResource {
create(body: TemplateCreateParams, options?: Core.RequestOptions): Core.APIPromise<unknown> {
return this._client.post('/templates', { body, ...options });
}
retrieve(
customerId: string,
id: string,
options?: Core.RequestOptions,
): Core.APIPromise<SentDmServicesContractsResponsesTemplateResponse> {
return this._client.get(`/templates/${customerId}/${id}`, options);
}
update(id: string, body: TemplateUpdateParams, options?: Core.RequestOptions): Core.APIPromise<unknown> {
return this._client.put(`/templates/${id}`, { body, ...options });
}
list(query: TemplateListParams, options?: Core.RequestOptions): Core.APIPromise<TemplateListResponse> {
return this._client.get('/templates', { query, ...options });
}
delete(customerId: string, id: string, options?: Core.RequestOptions): Core.APIPromise<unknown> {
return this._client.delete(`/templates/${customerId}/${id}`, options);
}
}
export interface SentDmServicesContractsResponsesTemplateResponse {
id?: string;
category?: string;
createdAt?: string;
customerId?: string;
name?: string;
rawBody?: string;
updatedAt?: string;
whatsappTemplateName?: string;
whatsappTemplateStatus?: string;
}
export type TemplateCreateResponse = unknown;
export type TemplateUpdateResponse = unknown;
export type TemplateListResponse = Array<SentDmServicesContractsResponsesTemplateResponse>;
export type TemplateDeleteResponse = unknown;
export interface TemplateCreateParams {
customerId?: string;
name?: string;
}
export interface TemplateUpdateParams {
category?: string;
customerId?: string;
name?: string;
rawBody?: string;
}
export interface TemplateListParams {
customerId: string;
}
export namespace Templates {
export import SentDmServicesContractsResponsesTemplateResponse = TemplatesAPI.SentDmServicesContractsResponsesTemplateResponse;
export import TemplateCreateResponse = TemplatesAPI.TemplateCreateResponse;
export import TemplateUpdateResponse = TemplatesAPI.TemplateUpdateResponse;
export import TemplateListResponse = TemplatesAPI.TemplateListResponse;
export import TemplateDeleteResponse = TemplatesAPI.TemplateDeleteResponse;
export import TemplateCreateParams = TemplatesAPI.TemplateCreateParams;
export import TemplateUpdateParams = TemplatesAPI.TemplateUpdateParams;
export import TemplateListParams = TemplatesAPI.TemplateListParams;
}