UNPKG

@oystehr/sdk

Version:

Oystehr SDK

45 lines (42 loc) 2.25 kB
// AUTOGENERATED -- DO NOT EDIT import { FaxSendParams, FaxSendResponse, OystehrClientRequest } from '../..'; import { SDKResource } from '../../client/client'; import { OystehrConfig } from '../../config'; export class Fax extends SDKResource { constructor(config: OystehrConfig) { super(config); } #baseUrlThunk(): string { return this.config.services?.['faxApiUrl'] ?? 'https://fax-api.zapehr.com/v1'; } /** * Offboard a fax number. Oystehr's [offboard](https://docs.oystehr.com/oystehr/services/fax/number/) feature makes it easy to stop using the fax service and release the project's assigned fax number with a single API call. Please note there is no way to guarantee getting the same number back again, so if you think this can break your project in any way we recommend not offboarding and avoid sending faxes until you're sure. * * Access Policy Requirements: * Action: `Fax:Offboard` * Access Policy Resource: `Fax:Number` */ offboard(request?: OystehrClientRequest): Promise<void> { return this.request('/offboard', 'post', this.#baseUrlThunk.bind(this))(request); } /** * Onboard a fax number. Oystehr's [onboard](https://docs.oystehr.com/oystehr/services/fax/number/) feature makes it easy to start using the fax service and purchase a new fax number for your project with a single API call. * * Access Policy Requirements: * Action: `Fax:Onboard` * Access Policy Resource: `Fax:Number` */ onboard(request?: OystehrClientRequest): Promise<void> { return this.request('/onboard', 'post', this.#baseUrlThunk.bind(this))(request); } /** * Send a fax. Oystehr's [fax sending](https://docs.oystehr.com/oystehr/services/fax/send/) feature makes it easy to send a fax to a chosen recipient with a single API call. You can use this feature to send referrals, medical records, prescriptions, and other documents that require fax transmission e.g. for HIPAA compliance. * * Access Policy Requirements: * Action: `Fax:Send` * Access Policy Resource: `Fax:Fax` */ send(params: FaxSendParams, request?: OystehrClientRequest): Promise<FaxSendResponse> { return this.request('/send', 'post', this.#baseUrlThunk.bind(this))(params, request); } }