@dolbyio/dolbyio-rest-apis-client
Version:
Node.JS wrapper for the Dolby.io REST APIs
61 lines (60 loc) • 2.83 kB
TypeScript
import { CreateSubscribeToken, SubscribeToken, UpdateSubscribeToken } from './types/subscribeToken';
/**
* Gets the specified subscribe token.
*
* @link https://docs.dolby.io/streaming-apis/reference/subscribetokenv1_readtoken
*
* @param apiSecret The API Secret used to authenticate this request.
* @param tokenId Identifier of the subscribe token to read.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a {@link SubscribeToken} object.
*/
export declare const read: (apiSecret: string, tokenId: number) => Promise<SubscribeToken>;
/**
* Deletes the subscribe token.
*
* @link https://docs.dolby.io/streaming-apis/reference/subscribetokenv1_deletetoken
*
* @param apiSecret The API Secret used to authenticate this request.
* @param tokenId Identifier of the subscribe token to delete.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a flag to indicate if the operation succeeded or not.
*/
export declare const deleteToken: (apiSecret: string, tokenId: number) => Promise<boolean>;
/**
* Updates the subscribe token.
*
* @link https://docs.dolby.io/streaming-apis/reference/subscribetokenv1_updatetoken
*
* @param apiSecret The API Secret used to authenticate this request.
* @param tokenId Identifier of the subscribe token to update.
* @param subscribeToken Settings of the subscribe token to update.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a {@link SubscribeToken} object.
*/
export declare const update: (apiSecret: string, tokenId: number, subscribeToken: UpdateSubscribeToken) => Promise<SubscribeToken>;
/**
* Lists all subscribe tokens with specific sorting and pagination.
*
* @link https://docs.dolby.io/streaming-apis/reference/subscribetokenv1_listtokens
*
* @param apiSecret The API Secret used to authenticate this request.
* @param sortBy How to sort the response.
* @param page Number of the page to retrieve.
* @param itemsOnPage Number of items per page.
* @param isDescending Sort by descending order.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives an array of {@link SubscribeToken} objects.
*/
export declare const list: (apiSecret: string, sortBy: 'Name' | 'AddedOn', page: number, itemsOnPage: number, isDescending?: boolean) => Promise<SubscribeToken[]>;
/**
* Creates a subscribe token.
*
* @link https://docs.dolby.io/streaming-apis/reference/subscribetokenv1_createtoken
*
* @param apiSecret The API Secret used to authenticate this request.
* @param subscribeToken Information about the new subscribe token.
*
* @returns A {@link !Promise Promise} whose fulfillment handler receives a {@link SubscribeToken} object.
*/
export declare const create: (apiSecret: string, subscribeToken: CreateSubscribeToken) => Promise<SubscribeToken>;