ci: regenerated with OpenAPI Doc latest, Speakeasy CLI 1.134.1

This commit is contained in:
speakeasybot
2024-01-10 15:48:00 +00:00
parent 0231c2a428
commit 2af51a7827
589 changed files with 45363 additions and 0 deletions

439
docs/sdks/admin/README.md Normal file
View File

@@ -0,0 +1,439 @@
# Admin
(*admin*)
### Available Operations
* [activateUser](#activateuser) - Activate a user
* [adminGetUser](#admingetuser) - Get a user by id
* [adminListUsers](#adminlistusers) - Get a list of users
* [anonymizeUser](#anonymizeuser) - Anonymize a user
* [deactivateUser](#deactivateuser) - Deactivate a user
* [deleteUser](#deleteuser) - Delete a user
* [logOutUser](#logoutuser) - Log a user out
* [refreshGravatar](#refreshgravatar) - Refresh gravatar
* [silenceUser](#silenceuser) - Silence a user
* [suspendUser](#suspenduser) - Suspend a user
## activateUser
Activate a user
### Example Usage
```typescript
import { SDK } from "openapi";
import { ActivateUserRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 203554;
const res = await sdk.admin.activateUser(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ActivateUserResponse](../../sdk/models/operations/activateuserresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## adminGetUser
Get a user by id
### Example Usage
```typescript
import { SDK } from "openapi";
import { AdminGetUserRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 386776;
const res = await sdk.admin.adminGetUser(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.AdminGetUserResponse](../../sdk/models/operations/admingetuserresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## adminListUsers
Get a list of users
### Example Usage
```typescript
import { SDK } from "openapi";
import { Flag, QueryParamAsc, QueryParamOrder } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const res = await sdk.admin.adminListUsers({
flag: Flag.New,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `request` | [operations.AdminListUsersRequest](../../sdk/models/operations/adminlistusersrequest.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.AdminListUsersResponse](../../sdk/models/operations/adminlistusersresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## anonymizeUser
Anonymize a user
### Example Usage
```typescript
import { SDK } from "openapi";
import { AnonymizeUserRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 418778;
const res = await sdk.admin.anonymizeUser(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.AnonymizeUserResponse](../../sdk/models/operations/anonymizeuserresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## deactivateUser
Deactivate a user
### Example Usage
```typescript
import { SDK } from "openapi";
import { DeactivateUserRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 143950;
const res = await sdk.admin.deactivateUser(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.DeactivateUserResponse](../../sdk/models/operations/deactivateuserresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## deleteUser
Delete a user
### Example Usage
```typescript
import { SDK } from "openapi";
import { DeleteUserRequest, DeleteUserRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 251343;
const requestBody: DeleteUserRequestBody = {};
const res = await sdk.admin.deleteUser(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `id` | *number* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.DeleteUserRequestBody](../../sdk/models/operations/deleteuserrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.DeleteUserResponse](../../sdk/models/operations/deleteuserresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## logOutUser
Log a user out
### Example Usage
```typescript
import { SDK } from "openapi";
import { LogOutUserRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 379568;
const res = await sdk.admin.logOutUser(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.LogOutUserResponse](../../sdk/models/operations/logoutuserresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## refreshGravatar
Refresh gravatar
### Example Usage
```typescript
import { SDK } from "openapi";
import { RefreshGravatarRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const username: string = "string";
const res = await sdk.admin.refreshGravatar(username);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `username` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.RefreshGravatarResponse](../../sdk/models/operations/refreshgravatarresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## silenceUser
Silence a user
### Example Usage
```typescript
import { SDK } from "openapi";
import { SilenceUserRequest, SilenceUserRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 606247;
const requestBody: SilenceUserRequestBody = {
postAction: "delete",
silencedTill: "2022-06-01T08:00:00.000Z",
};
const res = await sdk.admin.silenceUser(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.SilenceUserRequestBody](../../sdk/models/operations/silenceuserrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.SilenceUserResponse](../../sdk/models/operations/silenceuserresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## suspendUser
Suspend a user
### Example Usage
```typescript
import { SDK } from "openapi";
import { SuspendUserRequest, SuspendUserRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 970832;
const requestBody: SuspendUserRequestBody = {
postAction: "delete",
reason: "string",
suspendUntil: "2121-02-22",
};
const res = await sdk.admin.suspendUser(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.SuspendUserRequestBody](../../sdk/models/operations/suspenduserrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.SuspendUserResponse](../../sdk/models/operations/suspenduserresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

172
docs/sdks/backups/README.md Normal file
View File

@@ -0,0 +1,172 @@
# Backups
(*backups*)
### Available Operations
* [createBackup](#createbackup) - Create backup
* [downloadBackup](#downloadbackup) - Download backup
* [getBackups](#getbackups) - List backups
* [sendDownloadBackupEmail](#senddownloadbackupemail) - Send download backup email
## createBackup
Create backup
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.backups.createBackup({
withUploads: false,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `request` | [operations.CreateBackupRequestBody](../../sdk/models/operations/createbackuprequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateBackupResponse](../../sdk/models/operations/createbackupresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## downloadBackup
Download backup
### Example Usage
```typescript
import { SDK } from "openapi";
import { DownloadBackupRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const filename: string = "string";
const token: string = "string";
const res = await sdk.backups.downloadBackup(filename, token);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `filename` | *string* | :heavy_check_mark: | N/A |
| `token` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.DownloadBackupResponse](../../sdk/models/operations/downloadbackupresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## getBackups
List backups
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.backups.getBackups();
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetBackupsResponse](../../sdk/models/operations/getbackupsresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## sendDownloadBackupEmail
Send download backup email
### Example Usage
```typescript
import { SDK } from "openapi";
import { SendDownloadBackupEmailRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const filename: string = "string";
const res = await sdk.backups.sendDownloadBackupEmail(filename);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `filename` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.SendDownloadBackupEmailResponse](../../sdk/models/operations/senddownloadbackupemailresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

218
docs/sdks/badges/README.md Normal file
View File

@@ -0,0 +1,218 @@
# Badges
(*badges*)
### Available Operations
* [adminListBadges](#adminlistbadges) - List badges
* [createBadge](#createbadge) - Create badge
* [deleteBadge](#deletebadge) - Delete badge
* [listUserBadges](#listuserbadges) - List badges for a user
* [updateBadge](#updatebadge) - Update badge
## adminListBadges
List badges
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.badges.adminListBadges();
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.AdminListBadgesResponse](../../sdk/models/operations/adminlistbadgesresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## createBadge
Create badge
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.badges.createBadge({
badgeTypeId: 190613,
name: "string",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `request` | [operations.CreateBadgeRequestBody](../../sdk/models/operations/createbadgerequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateBadgeResponse](../../sdk/models/operations/createbadgeresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## deleteBadge
Delete badge
### Example Usage
```typescript
import { SDK } from "openapi";
import { DeleteBadgeRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 32345;
const res = await sdk.badges.deleteBadge(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.DeleteBadgeResponse](../../sdk/models/operations/deletebadgeresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listUserBadges
List badges for a user
### Example Usage
```typescript
import { SDK } from "openapi";
import { ListUserBadgesRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const username: string = "string";
const res = await sdk.badges.listUserBadges(username);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `username` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListUserBadgesResponse](../../sdk/models/operations/listuserbadgesresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## updateBadge
Update badge
### Example Usage
```typescript
import { SDK } from "openapi";
import { UpdateBadgeRequest, UpdateBadgeRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 280628;
const requestBody: UpdateBadgeRequestBody = {
badgeTypeId: 568845,
name: "string",
};
const res = await sdk.badges.updateBadge(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.UpdateBadgeRequestBody](../../sdk/models/operations/updatebadgerequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.UpdateBadgeResponse](../../sdk/models/operations/updatebadgeresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

View File

@@ -0,0 +1,276 @@
# Categories
(*categories*)
### Available Operations
* [createCategory](#createcategory) - Creates a category
* [getCategory](#getcategory) - Show category
* [getSite](#getsite) - Get site info
* [listCategories](#listcategories) - Retrieves a list of categories
* [listCategoryTopics](#listcategorytopics) - List topics
* [updateCategory](#updatecategory) - Updates a category
## createCategory
Creates a category
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.categories.createCategory({
color: "49d9e9",
formTemplateIds: [
"string",
],
name: "string",
permissions: {
"key": "string",
},
textColor: "f0fcfd",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `request` | [operations.CreateCategoryRequestBody](../../sdk/models/operations/createcategoryrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateCategoryResponse](../../sdk/models/operations/createcategoryresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## getCategory
Show category
### Example Usage
```typescript
import { SDK } from "openapi";
import { GetCategoryRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 39147;
const res = await sdk.categories.getCategory(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetCategoryResponse](../../sdk/models/operations/getcategoryresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## getSite
Can be used to fetch all categories and subcategories
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.categories.getSite();
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetSiteResponse](../../sdk/models/operations/getsiteresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listCategories
Retrieves a list of categories
### Example Usage
```typescript
import { SDK } from "openapi";
import { ListCategoriesRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const includeSubcategories: boolean = false;
const res = await sdk.categories.listCategories(includeSubcategories);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `includeSubcategories` | *boolean* | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListCategoriesResponse](../../sdk/models/operations/listcategoriesresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listCategoryTopics
List topics
### Example Usage
```typescript
import { SDK } from "openapi";
import { ListCategoryTopicsRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 394133;
const slug: string = "string";
const res = await sdk.categories.listCategoryTopics(id, slug);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `slug` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListCategoryTopicsResponse](../../sdk/models/operations/listcategorytopicsresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## updateCategory
Updates a category
### Example Usage
```typescript
import { SDK } from "openapi";
import { UpdateCategoryRequest, UpdateCategoryRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 353500;
const requestBody: UpdateCategoryRequestBody = {
color: "49d9e9",
formTemplateIds: [
"string",
],
name: "string",
permissions: {
"key": "string",
},
textColor: "f0fcfd",
};
const res = await sdk.categories.updateCategory(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.UpdateCategoryRequestBody](../../sdk/models/operations/updatecategoryrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.UpdateCategoryResponse](../../sdk/models/operations/updatecategoryresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

384
docs/sdks/groups/README.md Normal file
View File

@@ -0,0 +1,384 @@
# Groups
(*groups*)
### Available Operations
* [addGroupMembers](#addgroupmembers) - Add group members
* [createGroup](#creategroup) - Create a group
* [deleteGroup](#deletegroup) - Delete a group
* [getGroup](#getgroup) - Get a group
* [listGroupMembers](#listgroupmembers) - List group members
* [listGroups](#listgroups) - List groups
* [removeGroupMembers](#removegroupmembers) - Remove group members
* [updateGroup](#updategroup) - Update a group
## addGroupMembers
Add group members
### Example Usage
```typescript
import { SDK } from "openapi";
import { AddGroupMembersRequest, AddGroupMembersRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 985975;
const requestBody: AddGroupMembersRequestBody = {
usernames: "username1,username2",
};
const res = await sdk.groups.addGroupMembers(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
| `id` | *number* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.AddGroupMembersRequestBody](../../sdk/models/operations/addgroupmembersrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.AddGroupMembersResponse](../../sdk/models/operations/addgroupmembersresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## createGroup
Create a group
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.groups.createGroup({
group: {
mutedCategoryIds: [
385163,
],
name: "string",
regularCategoryIds: [
723588,
],
trackingCategoryIds: [
835377,
],
watchingCategoryIds: [
370420,
],
watchingFirstPostCategoryIds: [
831661,
],
},
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `request` | [operations.CreateGroupRequestBody](../../sdk/models/operations/creategrouprequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateGroupResponse](../../sdk/models/operations/creategroupresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## deleteGroup
Delete a group
### Example Usage
```typescript
import { SDK } from "openapi";
import { DeleteGroupRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 21302;
const res = await sdk.groups.deleteGroup(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.DeleteGroupResponse](../../sdk/models/operations/deletegroupresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## getGroup
Get a group
### Example Usage
```typescript
import { SDK } from "openapi";
import { GetGroupRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: string = "string";
const res = await sdk.groups.getGroup(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *string* | :heavy_check_mark: | Use group name instead of id |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetGroupResponse](../../sdk/models/operations/getgroupresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listGroupMembers
List group members
### Example Usage
```typescript
import { SDK } from "openapi";
import { ListGroupMembersRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: string = "string";
const res = await sdk.groups.listGroupMembers(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *string* | :heavy_check_mark: | Use group name instead of id |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListGroupMembersResponse](../../sdk/models/operations/listgroupmembersresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listGroups
List groups
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.groups.listGroups();
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListGroupsResponse](../../sdk/models/operations/listgroupsresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## removeGroupMembers
Remove group members
### Example Usage
```typescript
import { SDK } from "openapi";
import { RemoveGroupMembersRequest, RemoveGroupMembersRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 649523;
const requestBody: RemoveGroupMembersRequestBody = {
usernames: "username1,username2",
};
const res = await sdk.groups.removeGroupMembers(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
| `id` | *number* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.RemoveGroupMembersRequestBody](../../sdk/models/operations/removegroupmembersrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.RemoveGroupMembersResponse](../../sdk/models/operations/removegroupmembersresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## updateGroup
Update a group
### Example Usage
```typescript
import { SDK } from "openapi";
import { UpdateGroupGroup, UpdateGroupRequest, UpdateGroupRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 438471;
const requestBody: UpdateGroupRequestBody = {
group: {
mutedCategoryIds: [
244551,
],
name: "string",
regularCategoryIds: [
750192,
],
trackingCategoryIds: [
733973,
],
watchingCategoryIds: [
485153,
],
watchingFirstPostCategoryIds: [
710652,
],
},
};
const res = await sdk.groups.updateGroup(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `id` | *number* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.UpdateGroupRequestBody](../../sdk/models/operations/updategrouprequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.UpdateGroupResponse](../../sdk/models/operations/updategroupresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

104
docs/sdks/invites/README.md Normal file
View File

@@ -0,0 +1,104 @@
# Invites
(*invites*)
### Available Operations
* [createInvite](#createinvite) - Create an invite
* [inviteToTopic](#invitetotopic) - Invite to topic
## createInvite
Create an invite
### Example Usage
```typescript
import { SDK } from "openapi";
import { CreateInviteRequest, CreateInviteRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const requestBody: CreateInviteRequestBody = {
email: "not-a-user-yet@example.com",
groupIds: "42,43",
groupNames: "foo,bar",
maxRedemptionsAllowed: 5,
};
const res = await sdk.invites.createInvite(apiKey, apiUsername, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.CreateInviteRequestBody](../../sdk/models/operations/createinviterequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateInviteResponse](../../sdk/models/operations/createinviteresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## inviteToTopic
Invite to topic
### Example Usage
```typescript
import { SDK } from "openapi";
import { InviteToTopicRequest, InviteToTopicRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const requestBody: InviteToTopicRequestBody = {};
const res = await sdk.invites.inviteToTopic(apiKey, apiUsername, id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.InviteToTopicRequestBody](../../sdk/models/operations/invitetotopicrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.InviteToTopicResponse](../../sdk/models/operations/invitetotopicresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

View File

@@ -0,0 +1,84 @@
# Notifications
(*notifications*)
### Available Operations
* [getNotifications](#getnotifications) - Get the notifications that belong to the current user
* [markNotificationsAsRead](#marknotificationsasread) - Mark notifications as read
## getNotifications
Get the notifications that belong to the current user
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.notifications.getNotifications();
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetNotificationsResponse](../../sdk/models/operations/getnotificationsresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## markNotificationsAsRead
Mark notifications as read
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.notifications.markNotificationsAsRead({});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------ |
| `request` | [operations.MarkNotificationsAsReadRequestBody](../../sdk/models/operations/marknotificationsasreadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.MarkNotificationsAsReadResponse](../../sdk/models/operations/marknotificationsasreadresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

377
docs/sdks/posts/README.md Normal file
View File

@@ -0,0 +1,377 @@
# Posts
(*posts*)
### Available Operations
* [createTopicPostPM](#createtopicpostpm) - Creates a new topic, a new post, or a private message
* [deletePost](#deletepost) - delete a single post
* [getPost](#getpost) - Retrieve a single post
* [listPosts](#listposts) - List latest posts across topics
* [lockPost](#lockpost) - Lock a post from being edited
* [performPostAction](#performpostaction) - Like a post and other actions
* [postReplies](#postreplies) - List replies to a post
* [updatePost](#updatepost) - Update a single post
## createTopicPostPM
Creates a new topic, a new post, or a private message
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.posts.createTopicPostPM({
archetype: "private_message",
raw: "string",
targetRecipients: "blake,sam",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `request` | [operations.CreateTopicPostPMRequestBody](../../sdk/models/operations/createtopicpostpmrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateTopicPostPMResponse](../../sdk/models/operations/createtopicpostpmresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## deletePost
delete a single post
### Example Usage
```typescript
import { SDK } from "openapi";
import { DeletePostRequest, DeletePostRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: number = 188146;
const requestBody: DeletePostRequestBody = {
forceDestroy: true,
};
const res = await sdk.posts.deletePost(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `id` | *number* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.DeletePostRequestBody](../../sdk/models/operations/deletepostrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.DeletePostResponse](../../sdk/models/operations/deletepostresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## getPost
This endpoint can be used to get the number of likes on a post using the
`actions_summary` property in the response. `actions_summary` responses
with the id of `2` signify a `like`. If there are no `actions_summary`
items with the id of `2`, that means there are 0 likes. Other ids likely
refer to various different flag types.
### Example Usage
```typescript
import { SDK } from "openapi";
import { GetPostRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: string = "string";
const res = await sdk.posts.getPost(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetPostResponse](../../sdk/models/operations/getpostresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listPosts
List latest posts across topics
### Example Usage
```typescript
import { SDK } from "openapi";
import { ListPostsRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const before: string = "string";
const res = await sdk.posts.listPosts(apiKey, apiUsername, before);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `before` | *string* | :heavy_minus_sign: | Load posts with an id lower than this value. Useful for pagination. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListPostsResponse](../../sdk/models/operations/listpostsresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## lockPost
Lock a post from being edited
### Example Usage
```typescript
import { SDK } from "openapi";
import { LockPostRequest, LockPostRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const requestBody: LockPostRequestBody = {
locked: "string",
};
const res = await sdk.posts.lockPost(apiKey, apiUsername, id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------ |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.LockPostRequestBody](../../sdk/models/operations/lockpostrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.LockPostResponse](../../sdk/models/operations/lockpostresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## performPostAction
Like a post and other actions
### Example Usage
```typescript
import { SDK } from "openapi";
import { PerformPostActionRequest, PerformPostActionRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const requestBody: PerformPostActionRequestBody = {
id: 315075,
postActionTypeId: 159481,
};
const res = await sdk.posts.performPostAction(apiKey, apiUsername, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.PerformPostActionRequestBody](../../sdk/models/operations/performpostactionrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.PerformPostActionResponse](../../sdk/models/operations/performpostactionresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## postReplies
List replies to a post
### Example Usage
```typescript
import { SDK } from "openapi";
import { PostRepliesRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: string = "string";
const res = await sdk.posts.postReplies(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.PostRepliesResponse](../../sdk/models/operations/postrepliesresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## updatePost
Update a single post
### Example Usage
```typescript
import { SDK } from "openapi";
import { Post, UpdatePostRequest, UpdatePostRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: string = "string";
const requestBody: UpdatePostRequestBody = {
post: {
raw: "string",
},
};
const res = await sdk.posts.updatePost(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| `id` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.UpdatePostRequestBody](../../sdk/models/operations/updatepostrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.UpdatePostResponse](../../sdk/models/operations/updatepostresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

View File

@@ -0,0 +1,133 @@
# PrivateMessages
(*privateMessages*)
### Available Operations
* [createTopicPostPM](#createtopicpostpm) - Creates a new topic, a new post, or a private message
* [getUserSentPrivateMessages](#getusersentprivatemessages) - Get a list of private messages sent for a user
* [listUserPrivateMessages](#listuserprivatemessages) - Get a list of private messages for a user
## createTopicPostPM
Creates a new topic, a new post, or a private message
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.privateMessages.createTopicPostPM({
archetype: "private_message",
raw: "string",
targetRecipients: "blake,sam",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `request` | [operations.CreateTopicPostPMRequestBody](../../sdk/models/operations/createtopicpostpmrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateTopicPostPMResponse](../../sdk/models/operations/createtopicpostpmresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## getUserSentPrivateMessages
Get a list of private messages sent for a user
### Example Usage
```typescript
import { SDK } from "openapi";
import { GetUserSentPrivateMessagesRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const username: string = "string";
const res = await sdk.privateMessages.getUserSentPrivateMessages(username);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `username` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetUserSentPrivateMessagesResponse](../../sdk/models/operations/getusersentprivatemessagesresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listUserPrivateMessages
Get a list of private messages for a user
### Example Usage
```typescript
import { SDK } from "openapi";
import { ListUserPrivateMessagesRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const username: string = "string";
const res = await sdk.privateMessages.listUserPrivateMessages(username);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `username` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListUserPrivateMessagesResponse](../../sdk/models/operations/listuserprivatemessagesresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

65
docs/sdks/sdk/README.md Normal file
View File

@@ -0,0 +1,65 @@
# SDK
## Overview
Discourse API Documentation: This page contains the documentation on how to use Discourse through API calls.
> Note: For any endpoints not listed you can follow the
[reverse engineer the Discourse API](https://meta.discourse.org/t/-/20576)
guide to figure out how to use an API endpoint.
### Request Content-Type
The Content-Type for POST and PUT requests can be set to `application/x-www-form-urlencoded`,
`multipart/form-data`, or `application/json`.
### Endpoint Names and Response Content-Type
Most API endpoints provide the same content as their HTML counterparts. For example
the URL `/categories` serves a list of categories, the `/categories.json` API provides the
same information in JSON format.
Instead of sending API requests to `/categories.json` you may also send them to `/categories`
and add an `Accept: application/json` header to the request to get the JSON response.
Sending requests with the `Accept` header is necessary if you want to use URLs
for related endpoints returned by the API, such as pagination URLs.
These URLs are returned without the `.json` prefix so you need to add the header in
order to get the correct response format.
### Authentication
Some endpoints do not require any authentication, pretty much anything else will
require you to be authenticated.
To become authenticated you will need to create an API Key from the admin panel.
Once you have your API Key you can pass it in along with your API Username
as an HTTP header like this:
```
curl -X GET "http://127.0.0.1:3000/admin/users/list/active.json" \
-H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \
-H "Api-Username: system"
```
and this is how POST requests will look:
```
curl -X POST "http://127.0.0.1:3000/categories" \
-H "Content-Type: multipart/form-data;" \
-H "Api-Key: 714552c6148e1617aeab526d0606184b94a80ec048fc09894ff1a72b740c5f19" \
-H "Api-Username: system" \
-F "name=89853c20-4409-e91a-a8ea-f6cdff96aaaa" \
-F "color=49d9e9" \
-F "text_color=f0fcfd"
```
### Boolean values
If an endpoint accepts a boolean be sure to specify it as a lowercase
`true` or `false` value unless noted otherwise.
### Available Operations

File diff suppressed because one or more lines are too long

44
docs/sdks/site/README.md Normal file
View File

@@ -0,0 +1,44 @@
# Site
(*site*)
### Available Operations
* [getSite](#getsite) - Get site info
## getSite
Can be used to fetch all categories and subcategories
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.site.getSite();
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetSiteResponse](../../sdk/models/operations/getsiteresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

253
docs/sdks/tags/README.md Normal file
View File

@@ -0,0 +1,253 @@
# Tags
(*tags*)
### Available Operations
* [createTagGroup](#createtaggroup) - Creates a tag group
* [getTag](#gettag) - Get a specific tag
* [getTagGroup](#gettaggroup) - Get a single tag group
* [listTagGroups](#listtaggroups) - Get a list of tag groups
* [listTags](#listtags) - Get a list of tags
* [updateTagGroup](#updatetaggroup) - Update tag group
## createTagGroup
Creates a tag group
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.tags.createTagGroup({
name: "string",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `request` | [operations.CreateTagGroupRequestBody](../../sdk/models/operations/createtaggrouprequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateTagGroupResponse](../../sdk/models/operations/createtaggroupresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## getTag
Get a specific tag
### Example Usage
```typescript
import { SDK } from "openapi";
import { GetTagRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const name: string = "string";
const res = await sdk.tags.getTag(name);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `name` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetTagResponse](../../sdk/models/operations/gettagresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## getTagGroup
Get a single tag group
### Example Usage
```typescript
import { SDK } from "openapi";
import { GetTagGroupRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: string = "string";
const res = await sdk.tags.getTagGroup(id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `id` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetTagGroupResponse](../../sdk/models/operations/gettaggroupresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listTagGroups
Get a list of tag groups
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.tags.listTagGroups();
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListTagGroupsResponse](../../sdk/models/operations/listtaggroupsresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listTags
Get a list of tags
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.tags.listTags();
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListTagsResponse](../../sdk/models/operations/listtagsresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## updateTagGroup
Update tag group
### Example Usage
```typescript
import { SDK } from "openapi";
import { UpdateTagGroupRequest, UpdateTagGroupRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const id: string = "string";
const requestBody: UpdateTagGroupRequestBody = {};
const res = await sdk.tags.updateTagGroup(id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `id` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.UpdateTagGroupRequestBody](../../sdk/models/operations/updatetaggrouprequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.UpdateTagGroupResponse](../../sdk/models/operations/updatetaggroupresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

623
docs/sdks/topics/README.md Normal file
View File

@@ -0,0 +1,623 @@
# Topics
(*topics*)
### Available Operations
* [bookmarkTopic](#bookmarktopic) - Bookmark topic
* [createTopicPostPM](#createtopicpostpm) - Creates a new topic, a new post, or a private message
* [createTopicTimer](#createtopictimer) - Create topic timer
* [getTopic](#gettopic) - Get a single topic
* [getTopicByExternalId](#gettopicbyexternalid) - Get topic by external_id
* [inviteToTopic](#invitetotopic) - Invite to topic
* [listLatestTopics](#listlatesttopics) - Get the latest topics
* [listTopTopics](#listtoptopics) - Get the top topics filtered by period
* [removeTopic](#removetopic) - Remove a topic
* [setNotificationLevel](#setnotificationlevel) - Set notification level
* [updateTopic](#updatetopic) - Update a topic
* [updateTopicStatus](#updatetopicstatus) - Update the status of a topic
* [updateTopicTimestamp](#updatetopictimestamp) - Update topic timestamp
## bookmarkTopic
Bookmark topic
### Example Usage
```typescript
import { SDK } from "openapi";
import { BookmarkTopicRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const res = await sdk.topics.bookmarkTopic(apiKey, apiUsername, id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.BookmarkTopicResponse](../../sdk/models/operations/bookmarktopicresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## createTopicPostPM
Creates a new topic, a new post, or a private message
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.topics.createTopicPostPM({
archetype: "private_message",
raw: "string",
targetRecipients: "blake,sam",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `request` | [operations.CreateTopicPostPMRequestBody](../../sdk/models/operations/createtopicpostpmrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateTopicPostPMResponse](../../sdk/models/operations/createtopicpostpmresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## createTopicTimer
Create topic timer
### Example Usage
```typescript
import { SDK } from "openapi";
import { CreateTopicTimerRequest, CreateTopicTimerRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const requestBody: CreateTopicTimerRequestBody = {
time: "string",
};
const res = await sdk.topics.createTopicTimer(apiKey, apiUsername, id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.CreateTopicTimerRequestBody](../../sdk/models/operations/createtopictimerrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateTopicTimerResponse](../../sdk/models/operations/createtopictimerresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## getTopic
Get a single topic
### Example Usage
```typescript
import { SDK } from "openapi";
import { GetTopicRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const res = await sdk.topics.getTopic(apiKey, apiUsername, id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetTopicResponse](../../sdk/models/operations/gettopicresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## getTopicByExternalId
Get topic by external_id
### Example Usage
```typescript
import { SDK } from "openapi";
import { GetTopicByExternalIdRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const externalId: string = "string";
const res = await sdk.topics.getTopicByExternalId(externalId);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `externalId` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GetTopicByExternalIdResponse](../../sdk/models/operations/gettopicbyexternalidresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## inviteToTopic
Invite to topic
### Example Usage
```typescript
import { SDK } from "openapi";
import { InviteToTopicRequest, InviteToTopicRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const requestBody: InviteToTopicRequestBody = {};
const res = await sdk.topics.inviteToTopic(apiKey, apiUsername, id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.InviteToTopicRequestBody](../../sdk/models/operations/invitetotopicrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.InviteToTopicResponse](../../sdk/models/operations/invitetotopicresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listLatestTopics
Get the latest topics
### Example Usage
```typescript
import { SDK } from "openapi";
import { ListLatestTopicsRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const ascending: string = "string";
const order: string = "string";
const res = await sdk.topics.listLatestTopics(apiKey, apiUsername, ascending, order);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `ascending` | *string* | :heavy_minus_sign: | Defaults to `desc`, add `ascending=true` to sort asc |
| `order` | *string* | :heavy_minus_sign: | Enum: `default`, `created`, `activity`, `views`, `posts`, `category`, `likes`, `op_likes`, `posters` |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListLatestTopicsResponse](../../sdk/models/operations/listlatesttopicsresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## listTopTopics
Get the top topics filtered by period
### Example Usage
```typescript
import { SDK } from "openapi";
import { ListTopTopicsRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const period: string = "string";
const res = await sdk.topics.listTopTopics(apiKey, apiUsername, period);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `period` | *string* | :heavy_minus_sign: | Enum: `all`, `yearly`, `quarterly`, `monthly`, `weekly`, `daily` |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.ListTopTopicsResponse](../../sdk/models/operations/listtoptopicsresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## removeTopic
Remove a topic
### Example Usage
```typescript
import { SDK } from "openapi";
import { RemoveTopicRequest } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const res = await sdk.topics.removeTopic(apiKey, apiUsername, id);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.RemoveTopicResponse](../../sdk/models/operations/removetopicresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## setNotificationLevel
Set notification level
### Example Usage
```typescript
import { SDK } from "openapi";
import { NotificationLevel, SetNotificationLevelRequest, SetNotificationLevelRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const requestBody: SetNotificationLevelRequestBody = {
notificationLevel: NotificationLevel.Two,
};
const res = await sdk.topics.setNotificationLevel(apiKey, apiUsername, id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.SetNotificationLevelRequestBody](../../sdk/models/operations/setnotificationlevelrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.SetNotificationLevelResponse](../../sdk/models/operations/setnotificationlevelresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## updateTopic
Update a topic
### Example Usage
```typescript
import { SDK } from "openapi";
import { Topic, UpdateTopicRequest, UpdateTopicRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const requestBody: UpdateTopicRequestBody = {
topic: {},
};
const res = await sdk.topics.updateTopic(apiKey, apiUsername, id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.UpdateTopicRequestBody](../../sdk/models/operations/updatetopicrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.UpdateTopicResponse](../../sdk/models/operations/updatetopicresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## updateTopicStatus
Update the status of a topic
### Example Usage
```typescript
import { SDK } from "openapi";
import { Enabled, Status, UpdateTopicStatusRequest, UpdateTopicStatusRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const requestBody: UpdateTopicStatusRequestBody = {
enabled: Enabled.False,
status: Status.PinnedGlobally,
until: "2030-12-31",
};
const res = await sdk.topics.updateTopicStatus(apiKey, apiUsername, id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.UpdateTopicStatusRequestBody](../../sdk/models/operations/updatetopicstatusrequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.UpdateTopicStatusResponse](../../sdk/models/operations/updatetopicstatusresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## updateTopicTimestamp
Update topic timestamp
### Example Usage
```typescript
import { SDK } from "openapi";
import { UpdateTopicTimestampRequest, UpdateTopicTimestampRequestBody } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const apiKey: string = "string";
const apiUsername: string = "string";
const id: string = "string";
const requestBody: UpdateTopicTimestampRequestBody = {
timestamp: "1594291380",
};
const res = await sdk.topics.updateTopicTimestamp(apiKey, apiUsername, id, requestBody);
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `apiKey` | *string* | :heavy_check_mark: | N/A |
| `apiUsername` | *string* | :heavy_check_mark: | N/A |
| `id` | *string* | :heavy_check_mark: | N/A |
| `requestBody` | [operations.UpdateTopicTimestampRequestBody](../../sdk/models/operations/updatetopictimestamprequestbody.md) | :heavy_minus_sign: | N/A |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.UpdateTopicTimestampResponse](../../sdk/models/operations/updatetopictimestampresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

419
docs/sdks/uploads/README.md Normal file
View File

@@ -0,0 +1,419 @@
# Uploads
(*uploads*)
### Available Operations
* [abortMultipart](#abortmultipart) - Abort multipart upload
* [batchPresignMultipartParts](#batchpresignmultipartparts) - Generates batches of presigned URLs for multipart parts
* [completeExternalUpload](#completeexternalupload) - Completes a direct external upload
* [completeMultipart](#completemultipart) - Complete multipart upload
* [createMultipartUpload](#createmultipartupload) - Creates a multipart external upload
* [createUpload](#createupload) - Creates an upload
* [generatePresignedPut](#generatepresignedput) - Initiates a direct external upload
## abortMultipart
This endpoint aborts the multipart upload initiated with /create-multipart.
This should be used when cancelling the upload. It does not matter if parts
were already uploaded into the external storage provider.
You must have the correct permissions and CORS settings configured in your
external provider. We support AWS S3 as the default. See:
https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4.
An external file store must be set up and `enable_direct_s3_uploads` must
be set to true for this endpoint to function.
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.uploads.abortMultipart({
externalUploadIdentifier: "84x83tmxy398t3y._Q_z8CoJYVr69bE6D7f8J6Oo0434QquLFoYdGVerWFx9X5HDEI_TP_95c34n853495x35345394.d.ghQ",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ |
| `request` | [operations.AbortMultipartRequestBody](../../sdk/models/operations/abortmultipartrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.AbortMultipartResponse](../../sdk/models/operations/abortmultipartresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## batchPresignMultipartParts
Multipart uploads are uploaded in chunks or parts to individual presigned
URLs, similar to the one generated by /generate-presigned-put. The part
numbers provided must be between 1 and 10000. The total number of parts
will depend on the chunk size in bytes that you intend to use to upload
each chunk. For example a 12MB file may have 2 5MB chunks and a final
2MB chunk, for part numbers 1, 2, and 3.
This endpoint will return a presigned URL for each part number provided,
which you can then use to send PUT requests for the binary chunk corresponding
to that part. When the part is uploaded, the provider should return an
ETag for the part, and this should be stored along with the part number,
because this is needed to complete the multipart upload.
You must have the correct permissions and CORS settings configured in your
external provider. We support AWS S3 as the default. See:
https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4.
An external file store must be set up and `enable_direct_s3_uploads` must
be set to true for this endpoint to function.
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.uploads.batchPresignMultipartParts({
partNumbers: [
"string",
"string",
"string",
],
uniqueIdentifier: "66e86218-80d9-4bda-b4d5-2b6def968705",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
| `request` | [operations.BatchPresignMultipartPartsRequestBody](../../sdk/models/operations/batchpresignmultipartpartsrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.BatchPresignMultipartPartsResponse](../../sdk/models/operations/batchpresignmultipartpartsresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## completeExternalUpload
Completes an external upload initialized with /get-presigned-put. The
file will be moved from its temporary location in external storage to
a final destination in the S3 bucket. An Upload record will also be
created in the database in most cases.
If a sha1-checksum was provided in the initial request it will also
be compared with the uploaded file in storage to make sure the same
file was uploaded. The file size will be compared for the same reason.
You must have the correct permissions and CORS settings configured in your
external provider. We support AWS S3 as the default. See:
https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4.
An external file store must be set up and `enable_direct_s3_uploads` must
be set to true for this endpoint to function.
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.uploads.completeExternalUpload({
forPrivateMessage: "true",
forSiteSetting: "true",
pasted: "true",
uniqueIdentifier: "66e86218-80d9-4bda-b4d5-2b6def968705",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------- |
| `request` | [operations.CompleteExternalUploadRequestBody](../../sdk/models/operations/completeexternaluploadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CompleteExternalUploadResponse](../../sdk/models/operations/completeexternaluploadresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## completeMultipart
Completes the multipart upload in the external store, and copies the
file from its temporary location to its final location in the store.
All of the parts must have been uploaded to the external storage provider.
An Upload record will be completed in most cases once the file is copied
to its final location.
You must have the correct permissions and CORS settings configured in your
external provider. We support AWS S3 as the default. See:
https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4.
An external file store must be set up and `enable_direct_s3_uploads` must
be set to true for this endpoint to function.
### Example Usage
```typescript
import { SDK } from "openapi";
async function run() {
const sdk = new SDK();
const res = await sdk.uploads.completeMultipart({
parts: [
"string",
"string",
],
uniqueIdentifier: "66e86218-80d9-4bda-b4d5-2b6def968705",
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
| `request` | [operations.CompleteMultipartRequestBody](../../sdk/models/operations/completemultipartrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CompleteMultipartResponse](../../sdk/models/operations/completemultipartresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## createMultipartUpload
Creates a multipart upload in the external storage provider, storing
a temporary reference to the external upload similar to /get-presigned-put.
You must have the correct permissions and CORS settings configured in your
external provider. We support AWS S3 as the default. See:
https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4.
An external file store must be set up and `enable_direct_s3_uploads` must
be set to true for this endpoint to function.
### Example Usage
```typescript
import { SDK } from "openapi";
import { UploadType } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const res = await sdk.uploads.createMultipartUpload({
fileName: "IMG_2021.jpeg",
fileSize: 4096,
metadata: {},
uploadType: UploadType.CardBackground,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `request` | [operations.CreateMultipartUploadRequestBody](../../sdk/models/operations/createmultipartuploadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateMultipartUploadResponse](../../sdk/models/operations/createmultipartuploadresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## createUpload
Creates an upload
### Example Usage
```typescript
import { SDK } from "openapi";
import { TypeT } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const res = await sdk.uploads.createUpload({
file: {
content: new TextEncoder().encode("0x5d6beD2Fe2"),
fileName: "blanche_centro_white.jpe",
},
type: TypeT.CardBackground,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `request` | [operations.CreateUploadRequestBody](../../sdk/models/operations/createuploadrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.CreateUploadResponse](../../sdk/models/operations/createuploadresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |
## generatePresignedPut
Direct external uploads bypass the usual method of creating uploads
via the POST /uploads route, and upload directly to an external provider,
which by default is S3. This route begins the process, and will return
a unique identifier for the external upload as well as a presigned URL
which is where the file binary blob should be uploaded to.
Once the upload is complete to the external service, you must call the
POST /complete-external-upload route using the unique identifier returned
by this route, which will create any required Upload record in the Discourse
database and also move file from its temporary location to the final
destination in the external storage service.
You must have the correct permissions and CORS settings configured in your
external provider. We support AWS S3 as the default. See:
https://meta.discourse.org/t/-/210469#s3-multipart-direct-uploads-4.
An external file store must be set up and `enable_direct_s3_uploads` must
be set to true for this endpoint to function.
### Example Usage
```typescript
import { SDK } from "openapi";
import { GeneratePresignedPutType } from "openapi/dist/sdk/models/operations";
async function run() {
const sdk = new SDK();
const res = await sdk.uploads.generatePresignedPut({
fileName: "IMG_2021.jpeg",
fileSize: 4096,
metadata: {},
type: GeneratePresignedPutType.CardBackground,
});
if (res.statusCode == 200) {
// handle response
}
}
run();
```
### Parameters
| Parameter | Type | Required | Description |
| ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------ |
| `request` | [operations.GeneratePresignedPutRequestBody](../../sdk/models/operations/generatepresignedputrequestbody.md) | :heavy_check_mark: | The request object to use for the request. |
| `config` | [AxiosRequestConfig](https://axios-http.com/docs/req_config) | :heavy_minus_sign: | Available config options for making requests. |
### Response
**Promise<[operations.GeneratePresignedPutResponse](../../sdk/models/operations/generatepresignedputresponse.md)>**
### Errors
| Error Object | Status Code | Content Type |
| --------------- | --------------- | --------------- |
| errors.SDKError | 4xx-5xx | */* |

1087
docs/sdks/users/README.md Normal file

File diff suppressed because it is too large Load Diff