/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { representativesCreate } from "../funcs/representativesCreate.js"; import { representativesDelete } from "../funcs/representativesDelete.js"; import { representativesGet } from "../funcs/representativesGet.js"; import { representativesList } from "../funcs/representativesList.js"; import { representativesUpdate } from "../funcs/representativesUpdate.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Representatives extends ClientSDK { /** * Moov accounts associated with businesses require information regarding individuals who represent the business. * You can provide this information by creating a representative. Each account is allowed a maximum of 7 representatives. * Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/representatives.write` scope. */ async create( request: operations.CreateRepresentativeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(representativesCreate( this, request, options, )); } /** * A Moov account may have multiple representatives depending on the associated business's ownership and management structure. * You can use this method to list all the representatives for a given Moov account. * Note that Moov accounts associated with an individual do not have representatives. * Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/representatives.read` scope. */ async list( request: operations.ListRepresentativesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(representativesList( this, request, options, )); } /** * Deletes a business representative associated with a Moov account. Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/representatives.write` scope. */ async delete( request: operations.DeleteRepresentativeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(representativesDelete( this, request, options, )); } /** * Retrieve a specific representative associated with a given Moov account. Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/representatives.read` scope. */ async get( request: operations.GetRepresentativeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(representativesGet( this, request, options, )); } /** * If a representative's information has changed you can patch the information associated with a specific representative ID. * Read our [business representatives guide](https://docs.moov.io/guides/accounts/requirements/business-representatives/) to learn more. * * When **can** profile data be updated: * * - For unverified representatives, all profile data can be edited. * - During the verification process, missing or incomplete profile data can be edited. * - Verified representatives can only add missing profile data. * * When **can't** profile data be updated: * * - Verified representatives cannot change any existing profile data. * * If you need to update information in a locked state, please contact Moov support. * * To access this endpoint using an [access token](https://docs.moov.io/api/authentication/access-tokens/) * you'll need to specify the `/accounts/{accountID}/representatives.write` scope. */ async update( request: operations.UpdateRepresentativeRequest, options?: RequestOptions, ): Promise { return unwrapAsync(representativesUpdate( this, request, options, )); } }