syllable-sdk 1.0.8-rc.1 → 1.0.8-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/mcp-server.js +6 -6
- package/bin/mcp-server.js.map +4 -4
- package/examples/package-lock.json +1 -1
- package/jsr.json +1 -1
- package/lib/config.d.ts +3 -3
- package/lib/config.js +3 -3
- package/mcp-server/mcp-server.js +1 -1
- package/mcp-server/server.js +1 -1
- package/openapi.json +33 -33
- package/package.json +1 -1
- package/src/lib/config.ts +3 -3
- package/src/mcp-server/mcp-server.ts +1 -1
- package/src/mcp-server/server.ts +1 -1
- package/.devcontainer/README.md +0 -35
- package/api-reference/sdks/agents/README.md +0 -224
- package/api-reference/sdks/availabletargets/README.md +0 -49
- package/api-reference/sdks/channels/README.md +0 -92
- package/api-reference/sdks/chats/README.md +0 -55
- package/api-reference/sdks/conversations/README.md +0 -91
- package/api-reference/sdks/dashboards/README.md +0 -321
- package/api-reference/sdks/events/README.md +0 -50
- package/api-reference/sdks/greetings/README.md +0 -223
- package/api-reference/sdks/organizations/README.md +0 -48
- package/api-reference/sdks/prompts/README.md +0 -225
- package/api-reference/sdks/sessions/README.md +0 -50
- package/api-reference/sdks/syllable/README.md +0 -22
- package/api-reference/sdks/targets/README.md +0 -194
- package/api-reference/sdks/tools/README.md +0 -92
- package/docs/sdks/agents/README.md +0 -589
- package/docs/sdks/batches/README.md +0 -742
- package/docs/sdks/campaigns/README.md +0 -526
- package/docs/sdks/channels/README.md +0 -401
- package/docs/sdks/conversations/README.md +0 -100
- package/docs/sdks/custommessages/README.md +0 -496
- package/docs/sdks/dashboards/README.md +0 -481
- package/docs/sdks/datasources/README.md +0 -458
- package/docs/sdks/directory/README.md +0 -727
- package/docs/sdks/events/README.md +0 -100
- package/docs/sdks/folders/README.md +0 -675
- package/docs/sdks/fullsummary/README.md +0 -82
- package/docs/sdks/incidents/README.md +0 -501
- package/docs/sdks/insights/README.md +0 -100
- package/docs/sdks/languagegroups/README.md +0 -565
- package/docs/sdks/latency/README.md +0 -82
- package/docs/sdks/numbers/README.md +0 -250
- package/docs/sdks/organizations/README.md +0 -317
- package/docs/sdks/permissions/README.md +0 -78
- package/docs/sdks/prompts/README.md +0 -592
- package/docs/sdks/pronunciations/README.md +0 -360
- package/docs/sdks/roles/README.md +0 -430
- package/docs/sdks/services/README.md +0 -430
- package/docs/sdks/sessiondebug/README.md +0 -236
- package/docs/sdks/sessionlabels/README.md +0 -262
- package/docs/sdks/sessions/README.md +0 -325
- package/docs/sdks/syllablesdktools/README.md +0 -578
- package/docs/sdks/takeouts/README.md +0 -228
- package/docs/sdks/targets/README.md +0 -454
- package/docs/sdks/test/README.md +0 -92
- package/docs/sdks/tools/README.md +0 -518
- package/docs/sdks/transcript/README.md +0 -82
- package/docs/sdks/twilio/README.md +0 -246
- package/docs/sdks/users/README.md +0 -561
- package/docs/sdks/v1/README.md +0 -561
- package/docs/sdks/voicegroups/README.md +0 -551
- package/docs/sdks/workflows/README.md +0 -781
- package/examples/README.md +0 -31
|
@@ -1,430 +0,0 @@
|
|
|
1
|
-
# Roles
|
|
2
|
-
(*roles*)
|
|
3
|
-
|
|
4
|
-
## Overview
|
|
5
|
-
|
|
6
|
-
Operations related to roles. A role is a collection of permissions that can be assigned to users to control their access to various features within the Syllable system.
|
|
7
|
-
|
|
8
|
-
### Available Operations
|
|
9
|
-
|
|
10
|
-
* [list](#list) - List Roles
|
|
11
|
-
* [create](#create) - Create Role
|
|
12
|
-
* [update](#update) - Update Role
|
|
13
|
-
* [getById](#getbyid) - Get Role
|
|
14
|
-
* [delete](#delete) - Delete Role
|
|
15
|
-
|
|
16
|
-
## list
|
|
17
|
-
|
|
18
|
-
List the existing roles.
|
|
19
|
-
|
|
20
|
-
### Example Usage
|
|
21
|
-
|
|
22
|
-
<!-- UsageSnippet language="typescript" operationID="roles_list" method="get" path="/api/v1/roles/" -->
|
|
23
|
-
```typescript
|
|
24
|
-
import { SyllableSDK } from "syllable-sdk";
|
|
25
|
-
|
|
26
|
-
const syllableSDK = new SyllableSDK({
|
|
27
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
async function run() {
|
|
31
|
-
const result = await syllableSDK.roles.list({
|
|
32
|
-
page: 0,
|
|
33
|
-
searchFields: [
|
|
34
|
-
"name",
|
|
35
|
-
],
|
|
36
|
-
searchFieldValues: [
|
|
37
|
-
"Some Object Name",
|
|
38
|
-
],
|
|
39
|
-
startDatetime: "2023-01-01T00:00:00Z",
|
|
40
|
-
endDatetime: "2024-01-01T00:00:00Z",
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
console.log(result);
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
run();
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Standalone function
|
|
50
|
-
|
|
51
|
-
The standalone function version of this method:
|
|
52
|
-
|
|
53
|
-
```typescript
|
|
54
|
-
import { SyllableSDKCore } from "syllable-sdk/core.js";
|
|
55
|
-
import { rolesList } from "syllable-sdk/funcs/rolesList.js";
|
|
56
|
-
|
|
57
|
-
// Use `SyllableSDKCore` for best tree-shaking performance.
|
|
58
|
-
// You can create one instance of it to use across an application.
|
|
59
|
-
const syllableSDK = new SyllableSDKCore({
|
|
60
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
async function run() {
|
|
64
|
-
const res = await rolesList(syllableSDK, {
|
|
65
|
-
page: 0,
|
|
66
|
-
searchFields: [
|
|
67
|
-
"name",
|
|
68
|
-
],
|
|
69
|
-
searchFieldValues: [
|
|
70
|
-
"Some Object Name",
|
|
71
|
-
],
|
|
72
|
-
startDatetime: "2023-01-01T00:00:00Z",
|
|
73
|
-
endDatetime: "2024-01-01T00:00:00Z",
|
|
74
|
-
});
|
|
75
|
-
if (res.ok) {
|
|
76
|
-
const { value: result } = res;
|
|
77
|
-
console.log(result);
|
|
78
|
-
} else {
|
|
79
|
-
console.log("rolesList failed:", res.error);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
run();
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Parameters
|
|
87
|
-
|
|
88
|
-
| Parameter | Type | Required | Description |
|
|
89
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
90
|
-
| `request` | [operations.RolesListRequest](../../models/operations/roleslistrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
91
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
92
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
93
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
94
|
-
|
|
95
|
-
### Response
|
|
96
|
-
|
|
97
|
-
**Promise\<[components.ListResponseRoleResponse](../../models/components/listresponseroleresponse.md)\>**
|
|
98
|
-
|
|
99
|
-
### Errors
|
|
100
|
-
|
|
101
|
-
| Error Type | Status Code | Content Type |
|
|
102
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
103
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
104
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
105
|
-
|
|
106
|
-
## create
|
|
107
|
-
|
|
108
|
-
Create a new role.
|
|
109
|
-
|
|
110
|
-
### Example Usage
|
|
111
|
-
|
|
112
|
-
<!-- UsageSnippet language="typescript" operationID="roles_create" method="post" path="/api/v1/roles/" -->
|
|
113
|
-
```typescript
|
|
114
|
-
import { SyllableSDK } from "syllable-sdk";
|
|
115
|
-
|
|
116
|
-
const syllableSDK = new SyllableSDK({
|
|
117
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
118
|
-
});
|
|
119
|
-
|
|
120
|
-
async function run() {
|
|
121
|
-
const result = await syllableSDK.roles.create({
|
|
122
|
-
name: "Prompt Engineer",
|
|
123
|
-
description: "Role for users who can fetch and change prompts",
|
|
124
|
-
permissions: [
|
|
125
|
-
"prompts_read",
|
|
126
|
-
"prompts_write",
|
|
127
|
-
"prompts_delete",
|
|
128
|
-
],
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
console.log(result);
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
run();
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Standalone function
|
|
138
|
-
|
|
139
|
-
The standalone function version of this method:
|
|
140
|
-
|
|
141
|
-
```typescript
|
|
142
|
-
import { SyllableSDKCore } from "syllable-sdk/core.js";
|
|
143
|
-
import { rolesCreate } from "syllable-sdk/funcs/rolesCreate.js";
|
|
144
|
-
|
|
145
|
-
// Use `SyllableSDKCore` for best tree-shaking performance.
|
|
146
|
-
// You can create one instance of it to use across an application.
|
|
147
|
-
const syllableSDK = new SyllableSDKCore({
|
|
148
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
149
|
-
});
|
|
150
|
-
|
|
151
|
-
async function run() {
|
|
152
|
-
const res = await rolesCreate(syllableSDK, {
|
|
153
|
-
name: "Prompt Engineer",
|
|
154
|
-
description: "Role for users who can fetch and change prompts",
|
|
155
|
-
permissions: [
|
|
156
|
-
"prompts_read",
|
|
157
|
-
"prompts_write",
|
|
158
|
-
"prompts_delete",
|
|
159
|
-
],
|
|
160
|
-
});
|
|
161
|
-
if (res.ok) {
|
|
162
|
-
const { value: result } = res;
|
|
163
|
-
console.log(result);
|
|
164
|
-
} else {
|
|
165
|
-
console.log("rolesCreate failed:", res.error);
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
run();
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
### Parameters
|
|
173
|
-
|
|
174
|
-
| Parameter | Type | Required | Description |
|
|
175
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
176
|
-
| `request` | [components.RoleCreateRequest](../../models/components/rolecreaterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
177
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
178
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
179
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
180
|
-
|
|
181
|
-
### Response
|
|
182
|
-
|
|
183
|
-
**Promise\<[components.RoleResponse](../../models/components/roleresponse.md)\>**
|
|
184
|
-
|
|
185
|
-
### Errors
|
|
186
|
-
|
|
187
|
-
| Error Type | Status Code | Content Type |
|
|
188
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
189
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
190
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
191
|
-
|
|
192
|
-
## update
|
|
193
|
-
|
|
194
|
-
Update an existing role.
|
|
195
|
-
|
|
196
|
-
### Example Usage
|
|
197
|
-
|
|
198
|
-
<!-- UsageSnippet language="typescript" operationID="roles_update" method="put" path="/api/v1/roles/" -->
|
|
199
|
-
```typescript
|
|
200
|
-
import { SyllableSDK } from "syllable-sdk";
|
|
201
|
-
|
|
202
|
-
const syllableSDK = new SyllableSDK({
|
|
203
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
async function run() {
|
|
207
|
-
const result = await syllableSDK.roles.update({
|
|
208
|
-
name: "Prompt Engineer",
|
|
209
|
-
description: "Role for users who can fetch and change prompts",
|
|
210
|
-
permissions: [
|
|
211
|
-
"prompts_read",
|
|
212
|
-
"prompts_write",
|
|
213
|
-
"prompts_delete",
|
|
214
|
-
],
|
|
215
|
-
id: 1,
|
|
216
|
-
lastUpdatedComments: "Updated to add delete permission",
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
console.log(result);
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
run();
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### Standalone function
|
|
226
|
-
|
|
227
|
-
The standalone function version of this method:
|
|
228
|
-
|
|
229
|
-
```typescript
|
|
230
|
-
import { SyllableSDKCore } from "syllable-sdk/core.js";
|
|
231
|
-
import { rolesUpdate } from "syllable-sdk/funcs/rolesUpdate.js";
|
|
232
|
-
|
|
233
|
-
// Use `SyllableSDKCore` for best tree-shaking performance.
|
|
234
|
-
// You can create one instance of it to use across an application.
|
|
235
|
-
const syllableSDK = new SyllableSDKCore({
|
|
236
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
237
|
-
});
|
|
238
|
-
|
|
239
|
-
async function run() {
|
|
240
|
-
const res = await rolesUpdate(syllableSDK, {
|
|
241
|
-
name: "Prompt Engineer",
|
|
242
|
-
description: "Role for users who can fetch and change prompts",
|
|
243
|
-
permissions: [
|
|
244
|
-
"prompts_read",
|
|
245
|
-
"prompts_write",
|
|
246
|
-
"prompts_delete",
|
|
247
|
-
],
|
|
248
|
-
id: 1,
|
|
249
|
-
lastUpdatedComments: "Updated to add delete permission",
|
|
250
|
-
});
|
|
251
|
-
if (res.ok) {
|
|
252
|
-
const { value: result } = res;
|
|
253
|
-
console.log(result);
|
|
254
|
-
} else {
|
|
255
|
-
console.log("rolesUpdate failed:", res.error);
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
run();
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
### Parameters
|
|
263
|
-
|
|
264
|
-
| Parameter | Type | Required | Description |
|
|
265
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
266
|
-
| `request` | [components.RoleUpdateRequest](../../models/components/roleupdaterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
267
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
268
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
269
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
270
|
-
|
|
271
|
-
### Response
|
|
272
|
-
|
|
273
|
-
**Promise\<[components.RoleResponse](../../models/components/roleresponse.md)\>**
|
|
274
|
-
|
|
275
|
-
### Errors
|
|
276
|
-
|
|
277
|
-
| Error Type | Status Code | Content Type |
|
|
278
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
279
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
280
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
281
|
-
|
|
282
|
-
## getById
|
|
283
|
-
|
|
284
|
-
Fetch a given role.
|
|
285
|
-
|
|
286
|
-
### Example Usage
|
|
287
|
-
|
|
288
|
-
<!-- UsageSnippet language="typescript" operationID="roles_get_by_id" method="get" path="/api/v1/roles/{role_id}" -->
|
|
289
|
-
```typescript
|
|
290
|
-
import { SyllableSDK } from "syllable-sdk";
|
|
291
|
-
|
|
292
|
-
const syllableSDK = new SyllableSDK({
|
|
293
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
294
|
-
});
|
|
295
|
-
|
|
296
|
-
async function run() {
|
|
297
|
-
const result = await syllableSDK.roles.getById({
|
|
298
|
-
roleId: 324660,
|
|
299
|
-
});
|
|
300
|
-
|
|
301
|
-
console.log(result);
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
run();
|
|
305
|
-
```
|
|
306
|
-
|
|
307
|
-
### Standalone function
|
|
308
|
-
|
|
309
|
-
The standalone function version of this method:
|
|
310
|
-
|
|
311
|
-
```typescript
|
|
312
|
-
import { SyllableSDKCore } from "syllable-sdk/core.js";
|
|
313
|
-
import { rolesGetById } from "syllable-sdk/funcs/rolesGetById.js";
|
|
314
|
-
|
|
315
|
-
// Use `SyllableSDKCore` for best tree-shaking performance.
|
|
316
|
-
// You can create one instance of it to use across an application.
|
|
317
|
-
const syllableSDK = new SyllableSDKCore({
|
|
318
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
319
|
-
});
|
|
320
|
-
|
|
321
|
-
async function run() {
|
|
322
|
-
const res = await rolesGetById(syllableSDK, {
|
|
323
|
-
roleId: 324660,
|
|
324
|
-
});
|
|
325
|
-
if (res.ok) {
|
|
326
|
-
const { value: result } = res;
|
|
327
|
-
console.log(result);
|
|
328
|
-
} else {
|
|
329
|
-
console.log("rolesGetById failed:", res.error);
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
run();
|
|
334
|
-
```
|
|
335
|
-
|
|
336
|
-
### Parameters
|
|
337
|
-
|
|
338
|
-
| Parameter | Type | Required | Description |
|
|
339
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
340
|
-
| `request` | [operations.RolesGetByIdRequest](../../models/operations/rolesgetbyidrequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
341
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
342
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
343
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
344
|
-
|
|
345
|
-
### Response
|
|
346
|
-
|
|
347
|
-
**Promise\<[components.RoleResponse](../../models/components/roleresponse.md)\>**
|
|
348
|
-
|
|
349
|
-
### Errors
|
|
350
|
-
|
|
351
|
-
| Error Type | Status Code | Content Type |
|
|
352
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
353
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
354
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|
|
355
|
-
|
|
356
|
-
## delete
|
|
357
|
-
|
|
358
|
-
Delete a role. Optionally, reassign existing users with that role to a new role.
|
|
359
|
-
|
|
360
|
-
### Example Usage
|
|
361
|
-
|
|
362
|
-
<!-- UsageSnippet language="typescript" operationID="roles_delete" method="delete" path="/api/v1/roles/{role_id}" -->
|
|
363
|
-
```typescript
|
|
364
|
-
import { SyllableSDK } from "syllable-sdk";
|
|
365
|
-
|
|
366
|
-
const syllableSDK = new SyllableSDK({
|
|
367
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
368
|
-
});
|
|
369
|
-
|
|
370
|
-
async function run() {
|
|
371
|
-
const result = await syllableSDK.roles.delete({
|
|
372
|
-
roleId: 458987,
|
|
373
|
-
reason: "<value>",
|
|
374
|
-
});
|
|
375
|
-
|
|
376
|
-
console.log(result);
|
|
377
|
-
}
|
|
378
|
-
|
|
379
|
-
run();
|
|
380
|
-
```
|
|
381
|
-
|
|
382
|
-
### Standalone function
|
|
383
|
-
|
|
384
|
-
The standalone function version of this method:
|
|
385
|
-
|
|
386
|
-
```typescript
|
|
387
|
-
import { SyllableSDKCore } from "syllable-sdk/core.js";
|
|
388
|
-
import { rolesDelete } from "syllable-sdk/funcs/rolesDelete.js";
|
|
389
|
-
|
|
390
|
-
// Use `SyllableSDKCore` for best tree-shaking performance.
|
|
391
|
-
// You can create one instance of it to use across an application.
|
|
392
|
-
const syllableSDK = new SyllableSDKCore({
|
|
393
|
-
apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
|
|
394
|
-
});
|
|
395
|
-
|
|
396
|
-
async function run() {
|
|
397
|
-
const res = await rolesDelete(syllableSDK, {
|
|
398
|
-
roleId: 458987,
|
|
399
|
-
reason: "<value>",
|
|
400
|
-
});
|
|
401
|
-
if (res.ok) {
|
|
402
|
-
const { value: result } = res;
|
|
403
|
-
console.log(result);
|
|
404
|
-
} else {
|
|
405
|
-
console.log("rolesDelete failed:", res.error);
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
run();
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
### Parameters
|
|
413
|
-
|
|
414
|
-
| Parameter | Type | Required | Description |
|
|
415
|
-
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
416
|
-
| `request` | [operations.RolesDeleteRequest](../../models/operations/rolesdeleterequest.md) | :heavy_check_mark: | The request object to use for the request. |
|
|
417
|
-
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
|
418
|
-
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
|
419
|
-
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
|
420
|
-
|
|
421
|
-
### Response
|
|
422
|
-
|
|
423
|
-
**Promise\<[any](../../models/.md)\>**
|
|
424
|
-
|
|
425
|
-
### Errors
|
|
426
|
-
|
|
427
|
-
| Error Type | Status Code | Content Type |
|
|
428
|
-
| -------------------------- | -------------------------- | -------------------------- |
|
|
429
|
-
| errors.HTTPValidationError | 422 | application/json |
|
|
430
|
-
| errors.SDKError | 4XX, 5XX | \*/\* |
|