Skip to content

Latest commit

 

History

History
172 lines (114 loc) · 7.46 KB

README.md

File metadata and controls

172 lines (114 loc) · 7.46 KB

Backups

(backups)

Available Operations

createBackup

Create backup

Example Usage

import { SDK } from "@lukehagar/discoursejs";

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 ✔️ The request object to use for the request.
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.CreateBackupResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

downloadBackup

Download backup

Example Usage

import { SDK } from "@lukehagar/discoursejs";
import { DownloadBackupRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations";

async function run() {
  const sdk = new SDK();
const filename: string = "<value>";
const token: string = "<value>";

  const res = await sdk.backups.downloadBackup(filename, token);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
filename string ✔️ N/A
token string ✔️ N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.DownloadBackupResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

getBackups

List backups

Example Usage

import { SDK } from "@lukehagar/discoursejs";

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 Available config options for making requests.

Response

Promise<operations.GetBackupsResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /

sendDownloadBackupEmail

Send download backup email

Example Usage

import { SDK } from "@lukehagar/discoursejs";
import { SendDownloadBackupEmailRequest } from "@lukehagar/discoursejs/dist/sdk/models/operations";

async function run() {
  const sdk = new SDK();
const filename: string = "<value>";

  const res = await sdk.backups.sendDownloadBackupEmail(filename);

  if (res.statusCode == 200) {
    // handle response
  }
}

run();

Parameters

Parameter Type Required Description
filename string ✔️ N/A
config AxiosRequestConfig Available config options for making requests.

Response

Promise<operations.SendDownloadBackupEmailResponse>

Errors

Error Object Status Code Content Type
errors.SDKError 4xx-5xx /