import { Network } from './services/network'; import { Configuration } from './configuration'; declare type MediaCategory = 'media' | 'body' | 'history'; /** * @classdesc A Media represents a metadata information for the media upload * @property {String} sid - The server-assigned unique identifier for Media * @property {String} serviceSid - Service instance id which Media belongs/uploaded to * @property {Date} dateCreated - When the Media was created * @property {Date} dateUpdated - When the Media was updated * @property {Number} size - Size of media, bytes * @property {String} contentType - content type of media * @property {String} fileName - file name, if present, null otherwise * @property {MediaCategory} category - attachment category */ declare class Media { private state; private network; private config; constructor(config: Configuration, network: Network, data: any); get sid(): string; get serviceSid(): string; get dateCreated(): Date; get dateUpdated(): Date; get contentType(): string; get size(): number; /** @deprecated Use filename instead */ get fileName(): string; get filename(): string; get category(): MediaCategory; /** * Returns direct content URL to uploaded binary. This URL will expire after some time. * This function gets a new URL every time, preventing it from expiring but putting additional load on backend. * See getCachedContentUrl() for a function that reduces the amount of network requests. * * It is reasonable to build your own refresh logic upon these two functions: as soon as URL returned * by getCachedContentUrl() returns 40x status you should call getContentUrl() to refresh it. * * @returns {Promise} */ getContentUrl(): Promise; /** * Returns direct content URL to uploaded binary. This URL will expire after some time. * This function does not support getting a new URL however. Once set it will remain the same. * Use getContentUrl() to query a new one. * * It is reasonable to build your own refresh logic upon these two functions: as soon as URL returned * by getCachedContentUrl() returns 40x status you should call getContentUrl() to refresh it. * * @returns {Promise} */ getCachedContentUrl(): Promise; private _update; } export { Media, MediaCategory };