/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { subscribersCredentialsAppend } from "../funcs/subscribersCredentialsAppend.js"; import { subscribersCredentialsDelete } from "../funcs/subscribersCredentialsDelete.js"; import { subscribersCredentialsUpdate } from "../funcs/subscribersCredentialsUpdate.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 Credentials extends ClientSDK { /** * Update provider credentials * * @remarks * Update credentials for a provider such as **slack** and **FCM**. * **providerId** is required field. This API creates the **deviceTokens** or replaces the existing ones. */ async update( updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto, subscriberId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< operations.SubscribersV1ControllerUpdateSubscriberChannelResponse > { return unwrapAsync(subscribersCredentialsUpdate( this, updateSubscriberChannelRequestDto, subscriberId, idempotencyKey, options, )); } /** * Upsert provider credentials * * @remarks * Upsert credentials for a provider such as **slack** and **FCM**. * **providerId** is required field. This API creates **deviceTokens** or appends to the existing ones. */ async append( updateSubscriberChannelRequestDto: components.UpdateSubscriberChannelRequestDto, subscriberId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< operations.SubscribersV1ControllerModifySubscriberChannelResponse > { return unwrapAsync(subscribersCredentialsAppend( this, updateSubscriberChannelRequestDto, subscriberId, idempotencyKey, options, )); } /** * Delete provider credentials * * @remarks * Delete subscriber credentials for a provider such as **slack** and **FCM** by **providerId**. * This action is irreversible and will remove the credentials for the provider for particular **subscriberId**. */ async delete( subscriberId: string, providerId: string, idempotencyKey?: string | undefined, options?: RequestOptions, ): Promise< | operations.SubscribersV1ControllerDeleteSubscriberCredentialsResponse | undefined > { return unwrapAsync(subscribersCredentialsDelete( this, subscriberId, providerId, idempotencyKey, options, )); } }