@studyportals/sp-r2d2
Version:
A framework that contains various components used when developing projects that will be deployed via AWS λ.
34 lines (33 loc) • 1.3 kB
TypeScript
/**
* Provides the necessary functionality to interact with S3.
*/
export interface IS3Adapter {
/**
* Puts the specified JSON serialization into the S3 bucket,
* associating it with the given key.
*
* @param key The key with whom the JSON serialization will be associated.
* @param json The JSON serialziation that is to be stored.
*/
putJSON(key: string, json: string): Promise<void>;
/**
* Gets the JSON serialization associated with the specified key.
* Documents with an unsupported ContentType value will be rejected.
*
* @param key The key associated with the desired JSON serialization.
*/
getJSON(key: string): Promise<string>;
/**
* Gets the JSON serialization associated with the specified key.
*
* @param key The key associated with the desired JSON serialization.
* @param enforceContentType Specifies whether documents with an unsupported ContentType value should be rejected.
*/
getJSON(key: string, enforceContentType: boolean): Promise<string>;
/**
* Deletes the content associated with the specified key.
*
* @param key The key associated with the content that is to be removed.
*/
delete(key: string): Promise<void>;
}