@twilio-labs/serverless-api
Version:
API-wrapper for the Twilio Serverless API
48 lines (47 loc) • 2.51 kB
TypeScript
/** @module @twilio-labs/serverless-api/dist/api */
import { TwilioServerlessApiClient } from '../client';
import { EnvironmentVariables, VariableResource } from '../types';
/**
* Lists all variables for a given environment
*
* @export
* @param {string} environmentSid the environment to get the variables for
* @param {string} serviceSid the service the environment belongs to
* @param {TwilioServerlessApiClient} client API client
* @returns {Promise<VariableResource[]>}
*/
export declare function listVariablesForEnvironment(environmentSid: string, serviceSid: string, client: TwilioServerlessApiClient): Promise<VariableResource[]>;
/**
* Sets or updates the values passed in an object of environment variables for a specfic environment
*
* @export
* @param {EnvironmentVariables} envVariables the object of variables
* @param {string} environmentSid the environment the varibales should be set for
* @param {string} serviceSid the service the environment belongs to
* @param {TwilioServerlessApiClient} client API client
* @param {boolean} [removeRedundantOnes=false] whether to remove variables that are not passed but are currently set
* @returns {Promise<void>}
*/
export declare function setEnvironmentVariables(envVariables: EnvironmentVariables, environmentSid: string, serviceSid: string, client: TwilioServerlessApiClient, removeRedundantOnes?: boolean): Promise<void>;
/**
* Deletes a given variable from a given environment
*
* @export
* @param {string} variableSid the SID of the variable to delete
* @param {string} environmentSid the environment the variable belongs to
* @param {string} serviceSid the service the environment belongs to
* @param {TwilioServerlessApiClient} client API client instance
* @returns {Promise<boolean>}
*/
export declare function deleteEnvironmentVariable(variableSid: string, environmentSid: string, serviceSid: string, client: TwilioServerlessApiClient): Promise<boolean>;
/**
* Deletes all variables matching the passed keys from an environment
*
* @export
* @param {string[]} keys the keys of the variables to delete
* @param {string} environmentSid the environment the variables belong to
* @param {string} serviceSid the service the environment belongs to
* @param {TwilioServerlessApiClient} client API client instance
* @returns {Promise<boolean>}
*/
export declare function removeEnvironmentVariables(keys: string[], environmentSid: string, serviceSid: string, client: TwilioServerlessApiClient): Promise<boolean>;