/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { usersActivateUser } from "../funcs/usersActivateUser.js"; import { usersAdminGetUser } from "../funcs/usersAdminGetUser.js"; import { usersAdminListUsers } from "../funcs/usersAdminListUsers.js"; import { usersAnonymizeUser } from "../funcs/usersAnonymizeUser.js"; import { usersChangePassword } from "../funcs/usersChangePassword.js"; import { usersCreateUser } from "../funcs/usersCreateUser.js"; import { usersDeactivateUser } from "../funcs/usersDeactivateUser.js"; import { usersDeleteUser } from "../funcs/usersDeleteUser.js"; import { usersGetUser } from "../funcs/usersGetUser.js"; import { usersGetUserEmails } from "../funcs/usersGetUserEmails.js"; import { usersGetUserExternalId } from "../funcs/usersGetUserExternalId.js"; import { usersGetUserIdentiyProviderExternalId } from "../funcs/usersGetUserIdentiyProviderExternalId.js"; import { usersListUserActions } from "../funcs/usersListUserActions.js"; import { usersListUserBadges } from "../funcs/usersListUserBadges.js"; import { usersListUsersPublic } from "../funcs/usersListUsersPublic.js"; import { usersLogOutUser } from "../funcs/usersLogOutUser.js"; import { usersRefreshGravatar } from "../funcs/usersRefreshGravatar.js"; import { usersSendPasswordResetEmail } from "../funcs/usersSendPasswordResetEmail.js"; import { usersSilenceUser } from "../funcs/usersSilenceUser.js"; import { usersSuspendUser } from "../funcs/usersSuspendUser.js"; import { usersUpdateAvatar } from "../funcs/usersUpdateAvatar.js"; import { usersUpdateEmail } from "../funcs/usersUpdateEmail.js"; import { usersUpdateUser } from "../funcs/usersUpdateUser.js"; import { usersUpdateUsername } from "../funcs/usersUpdateUsername.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "./models/operations/index.js"; import { unwrapAsync } from "./types/fp.js"; export class Users extends ClientSDK { /** * Activate a user */ async activateUser( id: number, options?: RequestOptions, ): Promise { return unwrapAsync(usersActivateUser( this, id, options, )); } /** * Get a user by id */ async adminGetUser( id: number, options?: RequestOptions, ): Promise { return unwrapAsync(usersAdminGetUser( this, id, options, )); } /** * Get a list of users */ async adminListUsers( request: operations.AdminListUsersRequest, options?: RequestOptions, ): Promise> { return unwrapAsync(usersAdminListUsers( this, request, options, )); } /** * Anonymize a user */ async anonymizeUser( id: number, options?: RequestOptions, ): Promise { return unwrapAsync(usersAnonymizeUser( this, id, options, )); } /** * Change password */ async changePassword( token: string, requestBody?: operations.ChangePasswordRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersChangePassword( this, token, requestBody, options, )); } /** * Creates a user */ async createUser( apiKey: string, apiUsername: string, requestBody?: operations.CreateUserRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersCreateUser( this, apiKey, apiUsername, requestBody, options, )); } /** * Deactivate a user */ async deactivateUser( id: number, options?: RequestOptions, ): Promise { return unwrapAsync(usersDeactivateUser( this, id, options, )); } /** * Delete a user */ async deleteUser( id: number, requestBody?: operations.DeleteUserRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersDeleteUser( this, id, requestBody, options, )); } /** * Get a single user by username */ async getUser( apiKey: string, apiUsername: string, username: string, options?: RequestOptions, ): Promise { return unwrapAsync(usersGetUser( this, apiKey, apiUsername, username, options, )); } /** * Get email addresses belonging to a user */ async getUserEmails( username: string, options?: RequestOptions, ): Promise { return unwrapAsync(usersGetUserEmails( this, username, options, )); } /** * Get a user by external_id */ async getUserExternalId( apiKey: string, apiUsername: string, externalId: string, options?: RequestOptions, ): Promise { return unwrapAsync(usersGetUserExternalId( this, apiKey, apiUsername, externalId, options, )); } /** * Get a user by identity provider external ID */ async getUserIdentiyProviderExternalId( apiKey: string, apiUsername: string, externalId: string, provider: string, options?: RequestOptions, ): Promise { return unwrapAsync(usersGetUserIdentiyProviderExternalId( this, apiKey, apiUsername, externalId, provider, options, )); } /** * Get a list of user actions */ async listUserActions( filter: string, offset: number, username: string, options?: RequestOptions, ): Promise { return unwrapAsync(usersListUserActions( this, filter, offset, username, options, )); } /** * List badges for a user */ async listUserBadges( username: string, options?: RequestOptions, ): Promise { return unwrapAsync(usersListUserBadges( this, username, options, )); } /** * Get a public list of users */ async listUsersPublic( order: operations.Order, period: operations.Period, asc?: operations.Asc | undefined, page?: number | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersListUsersPublic( this, order, period, asc, page, options, )); } /** * Log a user out */ async logOutUser( id: number, options?: RequestOptions, ): Promise { return unwrapAsync(usersLogOutUser( this, id, options, )); } /** * Refresh gravatar */ async refreshGravatar( username: string, options?: RequestOptions, ): Promise { return unwrapAsync(usersRefreshGravatar( this, username, options, )); } /** * Send password reset email */ async sendPasswordResetEmail( request?: operations.SendPasswordResetEmailRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersSendPasswordResetEmail( this, request, options, )); } /** * Silence a user */ async silenceUser( id: number, requestBody?: operations.SilenceUserRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersSilenceUser( this, id, requestBody, options, )); } /** * Suspend a user */ async suspendUser( id: number, requestBody?: operations.SuspendUserRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersSuspendUser( this, id, requestBody, options, )); } /** * Update avatar */ async updateAvatar( username: string, requestBody?: operations.UpdateAvatarRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersUpdateAvatar( this, username, requestBody, options, )); } /** * Update email */ async updateEmail( username: string, requestBody?: operations.UpdateEmailRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersUpdateEmail( this, username, requestBody, options, )); } /** * Update a user */ async updateUser( apiKey: string, apiUsername: string, username: string, requestBody?: operations.UpdateUserRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersUpdateUser( this, apiKey, apiUsername, username, requestBody, options, )); } /** * Update username */ async updateUsername( username: string, requestBody?: operations.UpdateUsernameRequestBody | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(usersUpdateUsername( this, username, requestBody, options, )); } }