import { inspect, InspectOptions } from "util"; import TokenPage, { TokenPaginationPayload } from "../../../base/TokenPage"; import Response from "../../../http/response"; import V1 from "../V1"; import { ApiResponse } from "../../../base/ApiResponse"; /** * Request body for updating a SharedKey\'s friendlyName only */ export declare class PatchSharedKey { /** * Human-readable name for the SharedKey */ "friendlyName"?: string; constructor(payload: any); } /** * Request body for creating a new SharedKey */ export declare class PostSharedKey { /** * Human-readable name for the signing key (optional, defaults to blank) */ "friendlyName"?: string | null; constructor(payload: any); } /** * Options to pass to patch a SharedKeyInstance */ export interface SharedKeyContextPatchOptions { /** */ patchSharedKey: PatchSharedKey; } /** * Options to pass to create a SharedKeyInstance */ export interface SharedKeyListInstanceCreateOptions { /** */ postSharedKey: PostSharedKey; /** Idempotency key for mutation operations. Must be a UUIDv7 (other UUID versions are rejected with a 400). */ idempotencyKey?: string; } /** * Options to pass to each */ export interface SharedKeyListInstanceEachOptions { /** Number of items per page (max 100, reflecting the 50-resource account limit per resource type) */ pageSize?: number; /** Token for pagination */ pageToken?: string; /** Function to process each record. If this and a positional callback are passed, this one will be used */ callback?: (item: SharedKeyInstance, done: (err?: Error) => void) => void; /** Function to be called upon completion of streaming */ done?: Function; /** Upper limit for the number of records to return. each() guarantees never to return more than limit. Default is no limit */ limit?: number; } /** * Options to pass to list */ export interface SharedKeyListInstanceOptions { /** Number of items per page (max 100, reflecting the 50-resource account limit per resource type) */ pageSize?: number; /** Token for pagination */ pageToken?: string; /** Upper limit for the number of records to return. list() guarantees never to return more than limit. Default is no limit */ limit?: number; } /** * Options to pass to page */ export interface SharedKeyListInstancePageOptions { /** Number of items per page (max 100, reflecting the 50-resource account limit per resource type) */ pageSize?: number; /** Token for pagination */ pageToken?: string; } export interface SharedKeyContext { /** * Remove a SharedKeyInstance * * @param callback - Callback to handle processed record * * @returns Resolves to processed boolean */ remove(callback?: (error: Error | null, item?: boolean) => any): Promise; /** * Remove a SharedKeyInstance and return HTTP info * * @param callback - Callback to handle processed record * * @returns Resolves to processed boolean with HTTP metadata */ removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Fetch a SharedKeyInstance * * @param callback - Callback to handle processed record * * @returns Resolves to processed SharedKeyInstance */ fetch(callback?: (error: Error | null, item?: SharedKeyInstance) => any): Promise; /** * Fetch a SharedKeyInstance and return HTTP info * * @param callback - Callback to handle processed record * * @returns Resolves to processed SharedKeyInstance with HTTP metadata */ fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Patch a SharedKeyInstance * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed SharedKeyInstance */ patch(params: PatchSharedKey, headers?: any, callback?: (error: Error | null, item?: SharedKeyInstance) => any): Promise; /** * Patch a SharedKeyInstance and return HTTP info * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed SharedKeyInstance with HTTP metadata */ patchWithHttpInfo(params: PatchSharedKey, headers?: any, callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Provide a user-friendly representation */ toJSON(): any; [inspect.custom](_depth: any, options: InspectOptions): any; } export interface SharedKeyContextSolution { sharedKeyId: string; } export declare class SharedKeyContextImpl implements SharedKeyContext { protected _version: V1; protected _solution: SharedKeyContextSolution; protected _uri: string; constructor(_version: V1, sharedKeyId: string); remove(callback?: (error: Error | null, item?: boolean) => any): Promise; removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; fetch(callback?: (error: Error | null, item?: SharedKeyInstance) => any): Promise; fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; patch(params: PatchSharedKey, headers?: any, callback?: (error: Error | null, item?: SharedKeyInstance) => any): Promise; patchWithHttpInfo(params: PatchSharedKey, headers?: any, callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Provide a user-friendly representation * * @returns Object */ toJSON(): SharedKeyContextSolution; [inspect.custom](_depth: any, options: InspectOptions): string; } /** * Nested model for PatchSharedKey */ export interface PatchSharedKey { friendlyName?: string; } /** * Nested model for PostSharedKey */ export interface PostSharedKey { friendlyName?: string | null; } interface SharedKeyPayload extends TokenPaginationPayload { sharedKeys: SharedKeyResource[]; } /** * Response model for SharedKeySummary operations */ interface SharedKeySummary_ResponseResource { id: string; friendlyName: string; createdAt: Date; updatedAt: Date; } /** * Response model for SharedKeyWithSecret operations */ interface SharedKeyWithSecret_ResponseResource { id: string; friendlyName: string; createdAt: Date; updatedAt: Date; secret: string; } /** * Response model for SharedKey operations */ interface SharedKey_ResponseResource { id: string; friendlyName: string; createdAt: Date; updatedAt: Date; } /** * Union type for all possible response models */ type SharedKeyResource = SharedKeySummary_ResponseResource | SharedKeyWithSecret_ResponseResource | SharedKey_ResponseResource; export declare class SharedKeyInstance { protected _version: V1; protected _solution: SharedKeyContextSolution; protected _context?: SharedKeyContext; constructor(_version: V1, _payload: SharedKeyResource, sharedKeyId?: string); id?: string; friendlyName?: string; createdAt?: Date; updatedAt?: Date; /** * Signing secret (only returned on POST, cannot be retrieved later) */ secret?: string; private get _proxy(); /** * Remove a SharedKeyInstance * * @param callback - Callback to handle processed record * * @returns Resolves to processed boolean */ remove(callback?: (error: Error | null, item?: boolean) => any): Promise; /** * Remove a SharedKeyInstance and return HTTP info * * @param callback - Callback to handle processed record * * @returns Resolves to processed boolean with HTTP metadata */ removeWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Fetch a SharedKeyInstance * * @param callback - Callback to handle processed record * * @returns Resolves to processed SharedKeyInstance */ fetch(callback?: (error: Error | null, item?: SharedKeyInstance) => any): Promise; /** * Fetch a SharedKeyInstance and return HTTP info * * @param callback - Callback to handle processed record * * @returns Resolves to processed SharedKeyInstance with HTTP metadata */ fetchWithHttpInfo(callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Patch a SharedKeyInstance * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed SharedKeyInstance */ patch(params: PatchSharedKey, headers?: any, callback?: (error: Error | null, item?: SharedKeyInstance) => any): Promise; /** * Patch a SharedKeyInstance and return HTTP info * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed SharedKeyInstance with HTTP metadata */ patchWithHttpInfo(params: PatchSharedKey, headers?: any, callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Provide a user-friendly representation * * @returns Object */ toJSON(): { id: string; friendlyName: string; createdAt: Date; updatedAt: Date; secret: string; }; [inspect.custom](_depth: any, options: InspectOptions): string; } export interface SharedKeySolution { } export interface SharedKeyListInstance { _version: V1; _solution: SharedKeySolution; _uri: string; (sharedKeyId: string): SharedKeyContext; get(sharedKeyId: string): SharedKeyContext; /** * Create a SharedKeyInstance * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed SharedKeyInstance */ create(params: PostSharedKey, headers?: any, callback?: (error: Error | null, item?: SharedKeyInstance) => any): Promise; /** * Create a SharedKeyInstance and return HTTP info * * @param params - Body for request * @param headers - header params for request * @param callback - Callback to handle processed record * * @returns Resolves to processed SharedKeyInstance with HTTP metadata */ createWithHttpInfo(params: PostSharedKey, headers?: any, callback?: (error: Error | null, item?: ApiResponse) => any): Promise>; /** * Streams SharedKeyInstance records from the API. * * This operation lazily loads records as efficiently as possible until the limit * is reached. * * The results are passed into the callback function, so this operation is memory * efficient. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { SharedKeyListInstanceEachOptions } [params] - Options for request * @param { function } [callback] - Function to process each record */ each(callback?: (item: SharedKeyInstance, done: (err?: Error) => void) => void): void; each(params: SharedKeyListInstanceEachOptions, callback?: (item: SharedKeyInstance, done: (err?: Error) => void) => void): void; /** * Streams SharedKeyInstance records from the API with HTTP metadata captured per page. * * This operation lazily loads records as efficiently as possible until the limit * is reached. HTTP metadata (status code, headers) is captured for each page request. * * The results are passed into the callback function, so this operation is memory * efficient. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { SharedKeyListInstanceEachOptions } [params] - Options for request * @param { function } [callback] - Function to process each record */ eachWithHttpInfo(callback?: (item: SharedKeyInstance, done: (err?: Error) => void) => void): void; eachWithHttpInfo(params: SharedKeyListInstanceEachOptions, callback?: (item: SharedKeyInstance, done: (err?: Error) => void) => void): void; /** * Retrieve a single target page of SharedKeyInstance records from the API. * * The request is executed immediately. * * @param { string } [targetUrl] - API-generated URL for the requested results page * @param { function } [callback] - Callback to handle list of records */ getPage(targetUrl: string, callback?: (error: Error | null, items: SharedKeyPage) => any): Promise; /** * Retrieve a single target page of SharedKeyInstance records from the API with HTTP metadata. * * The request is executed immediately. * * @param { string } [targetUrl] - API-generated URL for the requested results page * @param { function } [callback] - Callback to handle list of records with metadata */ getPageWithHttpInfo(targetUrl: string, callback?: (error: Error | null, items: ApiResponse) => any): Promise>; /** * Lists SharedKeyInstance records from the API as a list. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { SharedKeyListInstanceOptions } [params] - Options for request * @param { function } [callback] - Callback to handle list of records */ list(callback?: (error: Error | null, items: SharedKeyInstance[]) => any): Promise; list(params: SharedKeyListInstanceOptions, callback?: (error: Error | null, items: SharedKeyInstance[]) => any): Promise; /** * Lists SharedKeyInstance records from the API as a list with HTTP metadata. * * Returns all records along with HTTP metadata from the first page fetched. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { SharedKeyListInstanceOptions } [params] - Options for request * @param { function } [callback] - Callback to handle list of records with metadata */ listWithHttpInfo(callback?: (error: Error | null, items: ApiResponse) => any): Promise>; listWithHttpInfo(params: SharedKeyListInstanceOptions, callback?: (error: Error | null, items: ApiResponse) => any): Promise>; /** * Retrieve a single page of SharedKeyInstance records from the API. * * The request is executed immediately. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { SharedKeyListInstancePageOptions } [params] - Options for request * @param { function } [callback] - Callback to handle list of records */ page(callback?: (error: Error | null, items: SharedKeyPage) => any): Promise; page(params: SharedKeyListInstancePageOptions, callback?: (error: Error | null, items: SharedKeyPage) => any): Promise; /** * Retrieve a single page of SharedKeyInstance records from the API with HTTP metadata. * * The request is executed immediately. * * If a function is passed as the first argument, it will be used as the callback * function. * * @param { SharedKeyListInstancePageOptions } [params] - Options for request * @param { function } [callback] - Callback to handle list of records with metadata */ pageWithHttpInfo(callback?: (error: Error | null, items: ApiResponse) => any): Promise>; pageWithHttpInfo(params: SharedKeyListInstancePageOptions, callback?: (error: Error | null, items: ApiResponse) => any): Promise>; /** * Provide a user-friendly representation */ toJSON(): any; [inspect.custom](_depth: any, options: InspectOptions): any; } export declare function SharedKeyListInstance(version: V1): SharedKeyListInstance; export declare class SharedKeyPage extends TokenPage { /** * Initialize the SharedKeyPage * * @param version - Version of the resource * @param response - Response from the API * @param uri - URI of the resource * @param params - Query parameters * @param solution - Path solution */ constructor(version: V1, response: Response, uri: string, params: any, solution: SharedKeySolution); /** * Build an instance of SharedKeyInstance * * @param payload - Payload response from the API */ getInstance(payload: SharedKeyResource): SharedKeyInstance; [inspect.custom](depth: any, options: InspectOptions): string; } export {};