/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { accountManagementAddParty } from "../funcs/accountManagementAddParty.js"; import { accountManagementCloseAccount } from "../funcs/accountManagementCloseAccount.js"; import { accountManagementCreateInterestedParty } from "../funcs/accountManagementCreateInterestedParty.js"; import { accountManagementCreateRestriction } from "../funcs/accountManagementCreateRestriction.js"; import { accountManagementCreateTrustedContact } from "../funcs/accountManagementCreateTrustedContact.js"; import { accountManagementDeleteInterestedParty } from "../funcs/accountManagementDeleteInterestedParty.js"; import { accountManagementDeleteTrustedContact } from "../funcs/accountManagementDeleteTrustedContact.js"; import { accountManagementEndRestriction } from "../funcs/accountManagementEndRestriction.js"; import { accountManagementListAccounts } from "../funcs/accountManagementListAccounts.js"; import { accountManagementListAvailableRestrictions } from "../funcs/accountManagementListAvailableRestrictions.js"; import { accountManagementRemoveParty } from "../funcs/accountManagementRemoveParty.js"; import { accountManagementReplaceParty } from "../funcs/accountManagementReplaceParty.js"; import { accountManagementUpdateAccount } from "../funcs/accountManagementUpdateAccount.js"; import { accountManagementUpdateInterestedParty } from "../funcs/accountManagementUpdateInterestedParty.js"; import { accountManagementUpdateParty } from "../funcs/accountManagementUpdateParty.js"; import { accountManagementUpdateTrustedContact } from "../funcs/accountManagementUpdateTrustedContact.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; import { PageIterator, unwrapResultIterator } from "../types/operations.js"; export class AccountManagement extends ClientSDK { /** * List Accounts * * @remarks * Gets a list of Accounts based on search criteria. */ async listAccounts( request: operations.AccountsListAccountsRequest, options?: RequestOptions, ): Promise< PageIterator > { return unwrapResultIterator(accountManagementListAccounts( this, request, options, )); } /** * Update Account * * @remarks * UPDATE Updates an Account. */ async updateAccount( accountRequestUpdate: components.AccountRequestUpdate, accountId: string, updateMask?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementUpdateAccount( this, accountRequestUpdate, accountId, updateMask, options, )); } /** * Add Party * * @remarks * Adds a party to an account */ async addParty( addPartyRequestCreate: components.AddPartyRequestCreate, accountId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementAddParty( this, addPartyRequestCreate, accountId, options, )); } /** * Update Party * * @remarks * Updates a Party. */ async updateParty( partyRequestUpdate: components.PartyRequestUpdate, accountId: string, partyId: string, updateMask?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementUpdateParty( this, partyRequestUpdate, accountId, partyId, updateMask, options, )); } /** * Replace Party * * @remarks * Replaces a party on an account */ async replaceParty( replacePartyRequestCreate: components.ReplacePartyRequestCreate, accountId: string, partyId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementReplaceParty( this, replacePartyRequestCreate, accountId, partyId, options, )); } /** * Remove Party * * @remarks * Remove a party from an account */ async removeParty( removePartyRequestCreate: components.RemovePartyRequestCreate, accountId: string, partyId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementRemoveParty( this, removePartyRequestCreate, accountId, partyId, options, )); } /** * Close Account * * @remarks * CUSTOM Places an ACCT_MAINT_CLOSURE_PREP_BY_CORRESPONDENT restriction on the Account ready for closure. */ async closeAccount( closeAccountRequestCreate: components.CloseAccountRequestCreate, accountId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementCloseAccount( this, closeAccountRequestCreate, accountId, options, )); } /** * Create Trusted Contact * * @remarks * Creates a new Trusted Contact for an account. */ async createTrustedContact( trustedContactCreate: components.TrustedContactCreate, accountId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementCreateTrustedContact( this, trustedContactCreate, accountId, options, )); } /** * Update Trusted Contact * * @remarks * Updates a Trusted Contact. */ async updateTrustedContact( trustedContactUpdate: components.TrustedContactUpdate, accountId: string, trustedContactId: string, updateMask?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementUpdateTrustedContact( this, trustedContactUpdate, accountId, trustedContactId, updateMask, options, )); } /** * Delete Trusted Contact * * @remarks * DELETE Deletes a Trusted Contact for an Account. */ async deleteTrustedContact( accountId: string, trustedContactId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementDeleteTrustedContact( this, accountId, trustedContactId, options, )); } /** * Create Interested Party * * @remarks * Creates an Interested Party record for an Account. */ async createInterestedParty( interestedPartyCreate: components.InterestedPartyCreate, accountId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementCreateInterestedParty( this, interestedPartyCreate, accountId, options, )); } /** * Update Interested Party * * @remarks * Updates an Interested Party. */ async updateInterestedParty( interestedPartyUpdate: components.InterestedPartyUpdate, accountId: string, interestedPartyId: string, updateMask?: string | undefined, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementUpdateInterestedParty( this, interestedPartyUpdate, accountId, interestedPartyId, updateMask, options, )); } /** * Delete Interested Party * * @remarks * Deletes an Interested Party associated from an Account. */ async deleteInterestedParty( accountId: string, interestedPartyId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementDeleteInterestedParty( this, accountId, interestedPartyId, options, )); } /** * List Available Restrictions * * @remarks * Gets a list of possible Restrictions that can be placed on an Account based on Enrollments. */ async listAvailableRestrictions( accountId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementListAvailableRestrictions( this, accountId, options, )); } /** * Create Restriction * * @remarks * Applies a Restriction to an account that suspends one or more Entitlements. */ async createRestriction( restrictionCreate: components.RestrictionCreate, accountId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementCreateRestriction( this, restrictionCreate, accountId, options, )); } /** * End Restriction * * @remarks * Ends a Restriction on an Account. */ async endRestriction( endRestrictionRequestCreate: components.EndRestrictionRequestCreate, accountId: string, restrictionId: string, options?: RequestOptions, ): Promise { return unwrapAsync(accountManagementEndRestriction( this, endRestrictionRequestCreate, accountId, restrictionId, options, )); } }