(users)
- listUsers - Lists all of the users in the organization.
- retrieveUser - Retrieves a user by their identifier.
- modifyUser - Modifies a user's role in the organization.
- deleteUser - Deletes a user from the organization.
Lists all of the users in the organization.
import { ArgotOpenAi } from "argot-open-ai";
const argotOpenAi = new ArgotOpenAi({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const result = await argotOpenAi.users.listUsers({});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { usersListUsers } from "argot-open-ai/funcs/usersListUsers.js";
// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const res = await usersListUsers(argotOpenAi, {});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ListUsersRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.UserListResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Retrieves a user by their identifier.
import { ArgotOpenAi } from "argot-open-ai";
const argotOpenAi = new ArgotOpenAi({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const result = await argotOpenAi.users.retrieveUser({
userId: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { usersRetrieveUser } from "argot-open-ai/funcs/usersRetrieveUser.js";
// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const res = await usersRetrieveUser(argotOpenAi, {
userId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.RetrieveUserRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.User>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Modifies a user's role in the organization.
import { ArgotOpenAi } from "argot-open-ai";
const argotOpenAi = new ArgotOpenAi({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const result = await argotOpenAi.users.modifyUser({
userId: "<id>",
userRoleUpdateRequest: {
role: "reader",
},
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { usersModifyUser } from "argot-open-ai/funcs/usersModifyUser.js";
// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const res = await usersModifyUser(argotOpenAi, {
userId: "<id>",
userRoleUpdateRequest: {
role: "reader",
},
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.ModifyUserRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.User>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |
Deletes a user from the organization.
import { ArgotOpenAi } from "argot-open-ai";
const argotOpenAi = new ArgotOpenAi({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const result = await argotOpenAi.users.deleteUser({
userId: "<id>",
});
// Handle the result
console.log(result);
}
run();
The standalone function version of this method:
import { ArgotOpenAiCore } from "argot-open-ai/core.js";
import { usersDeleteUser } from "argot-open-ai/funcs/usersDeleteUser.js";
// Use `ArgotOpenAiCore` for best tree-shaking performance.
// You can create one instance of it to use across an application.
const argotOpenAi = new ArgotOpenAiCore({
apiKeyAuth: process.env["ARGOTOPENAI_API_KEY_AUTH"] ?? "",
});
async function run() {
const res = await usersDeleteUser(argotOpenAi, {
userId: "<id>",
});
if (!res.ok) {
throw res.error;
}
const { value: result } = res;
// Handle the result
console.log(result);
}
run();
Parameter | Type | Required | Description |
---|---|---|---|
request |
operations.DeleteUserRequest | ✔️ | The request object to use for the request. |
options |
RequestOptions | ➖ | Used to set various options for making HTTP requests. |
options.fetchOptions |
RequestInit | ➖ | 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 | ➖ | Enables retrying HTTP requests under certain failure conditions. |
Promise<components.UserDeleteResponse>
Error Type | Status Code | Content Type |
---|---|---|
errors.SDKError | 4XX, 5XX | */* |