/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { subscribersPreferencesBulkUpdate } from "../funcs/subscribersPreferencesBulkUpdate.js"; import { subscribersPreferencesList } from "../funcs/subscribersPreferencesList.js"; import { subscribersPreferencesUpdate } from "../funcs/subscribersPreferencesUpdate.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"; export class Preferences extends ClientSDK { /** * Retrieve subscriber preferences * * @remarks * Retrieve subscriber channel preferences by its unique key identifier **subscriberId**. * This API returns all five channels preferences for all workflows and global preferences. */ async list( request: operations.SubscribersControllerGetSubscriberPreferencesRequest, options?: RequestOptions, ): Promise { return unwrapAsync(subscribersPreferencesList( this, request, options, )); } /** * Update subscriber preferences * * @remarks * Update subscriber preferences by its unique key identifier **subscriberId**. * **workflowId** is optional field, if provided, this API will update that workflow preference, * otherwise it will update global preferences */ async update( patchSubscriberPreferencesDto: components.PatchSubscriberPreferencesDto, subscriberId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< operations.SubscribersControllerUpdateSubscriberPreferencesResponse > { return unwrapAsync(subscribersPreferencesUpdate( this, patchSubscriberPreferencesDto, subscriberId, idempotencyKey, options, )); } /** * Bulk update subscriber preferences * * @remarks * Bulk update subscriber preferences by its unique key identifier **subscriberId**. * This API allows updating multiple workflow preferences in a single request. */ async bulkUpdate( bulkUpdateSubscriberPreferencesDto: components.BulkUpdateSubscriberPreferencesDto, subscriberId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< operations.SubscribersControllerBulkUpdateSubscriberPreferencesResponse > { return unwrapAsync(subscribersPreferencesBulkUpdate( this, bulkUpdateSubscriberPreferencesDto, subscriberId, idempotencyKey, options, )); } }