mirror of
https://github.com/LukeHagar/discoursejs.git
synced 2025-12-06 04:19:37 +00:00
ci: regenerated with OpenAPI Doc latest, Speakeasy CLI 1.358.0
This commit is contained in:
@@ -14,24 +14,19 @@ Create an invite
|
||||
|
||||
```typescript
|
||||
import { SDK } from "@lukehagar/discoursejs";
|
||||
import { CreateInviteRequest, CreateInviteRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations";
|
||||
|
||||
const sdk = new SDK();
|
||||
|
||||
async function run() {
|
||||
const sdk = new SDK();
|
||||
const apiKey: string = "<value>";
|
||||
const apiUsername: string = "<value>";
|
||||
const requestBody: CreateInviteRequestBody = {
|
||||
email: "not-a-user-yet@example.com",
|
||||
groupIds: "42,43",
|
||||
groupNames: "foo,bar",
|
||||
maxRedemptionsAllowed: 5,
|
||||
};
|
||||
const result = await sdk.invites.createInvite("<value>", "<value>", {
|
||||
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
|
||||
}
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
@@ -39,17 +34,19 @@ 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. |
|
||||
| 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 |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
||||
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[operations.CreateInviteResponse](../../sdk/models/operations/createinviteresponse.md)>**
|
||||
**Promise\<[operations.CreateInviteResponseBody](../../sdk/models/operations/createinviteresponsebody.md)\>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
@@ -64,20 +61,14 @@ Invite to topic
|
||||
|
||||
```typescript
|
||||
import { SDK } from "@lukehagar/discoursejs";
|
||||
import { InviteToTopicRequest, InviteToTopicRequestBody } from "@lukehagar/discoursejs/dist/sdk/models/operations";
|
||||
|
||||
const sdk = new SDK();
|
||||
|
||||
async function run() {
|
||||
const sdk = new SDK();
|
||||
const apiKey: string = "<value>";
|
||||
const apiUsername: string = "<value>";
|
||||
const id: string = "<value>";
|
||||
const requestBody: InviteToTopicRequestBody = {};
|
||||
const result = await sdk.invites.inviteToTopic("<value>", "<value>", "<value>");
|
||||
|
||||
const res = await sdk.invites.inviteToTopic(apiKey, apiUsername, id, requestBody);
|
||||
|
||||
if (res.statusCode == 200) {
|
||||
// handle response
|
||||
}
|
||||
// Handle the result
|
||||
console.log(result)
|
||||
}
|
||||
|
||||
run();
|
||||
@@ -85,18 +76,20 @@ 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. |
|
||||
| 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 |
|
||||
| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. |
|
||||
| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. |
|
||||
| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. |
|
||||
|
||||
|
||||
### Response
|
||||
|
||||
**Promise<[operations.InviteToTopicResponse](../../sdk/models/operations/invitetotopicresponse.md)>**
|
||||
**Promise\<[operations.InviteToTopicResponseBody](../../sdk/models/operations/invitetotopicresponsebody.md)\>**
|
||||
### Errors
|
||||
|
||||
| Error Object | Status Code | Content Type |
|
||||
|
||||
Reference in New Issue
Block a user