aws-iot-device-sdk-v2
Version:
NodeJS API for the AWS IoT service
63 lines (62 loc) • 4.01 kB
TypeScript
import { CrtError, mqtt_request_response } from "aws-crt";
import { ServiceError } from "./mqtt_request_response";
export interface StreamingOperationConfig {
operationName: string;
serviceModel: RequestResponseServiceModel;
client: mqtt_request_response.RequestResponseClient;
modelConfig: any;
}
export interface RequestResponseOperationConfig {
operationName: string;
serviceModel: RequestResponseServiceModel;
client: mqtt_request_response.RequestResponseClient;
request: any;
}
export type MessageDeserializer = (payload: ArrayBuffer) => any;
export interface RequestResponsePath {
topic: string;
correlationTokenJsonPath?: string;
deserializer: MessageDeserializer;
}
export interface RequestResponseOperationModel {
inputShapeName: string;
payloadTransformer: (request: any) => ArrayBuffer;
subscriptionGenerator: (request: any) => Array<string>;
responsePathGenerator: (request: any) => Array<RequestResponsePath>;
publishTopicGenerator: (request: any) => string;
correlationTokenApplicator: (request: any) => [any, string | undefined];
}
export interface StreamingOperationModel {
inputShapeName: string;
subscriptionGenerator: (config: any) => string;
deserializer: MessageDeserializer;
}
export interface RequestResponseServiceModel {
requestResponseOperations: Map<string, RequestResponseOperationModel>;
streamingOperations: Map<string, StreamingOperationModel>;
shapeValidators: Map<string, (value: any) => void>;
}
export declare function doRequestResponse<ResponseType>(options: RequestResponseOperationConfig): Promise<ResponseType>;
export declare function createServiceError(description: string, internalError?: CrtError, modeledError?: any): ServiceError;
export declare function validateValueAsTopicSegment(value: any, propertyName?: string): void;
export declare function validateOptionalValueAsNumber(value: any, propertyName?: string): void;
export declare function validateValueAsNumber(value: any, propertyName?: string): void;
export declare function validateValueAsString(value: any, propertyName?: string): void;
export declare function validateValueAsOptionalString(value: any, propertyName?: string): void;
export declare function validateValueAsInteger(value: any, propertyName?: string): void;
export declare function validateValueAsOptionalInteger(value: any, propertyName?: string): void;
export declare function validateValueAsBoolean(value: any, propertyName?: string): void;
export declare function validateValueAsOptionalBoolean(value: any, propertyName?: string): void;
export declare function validateValueAsDate(value: any, propertyName?: string): void;
export declare function validateValueAsOptionalDate(value: any, propertyName?: string): void;
export declare function validateValueAsBlob(value: any, propertyName?: string): void;
export declare function validateValueAsOptionalBlob(value: any, propertyName?: string): void;
export declare function validateValueAsAny(value: any, propertyName?: string): void;
export declare function validateValueAsOptionalAny(value: any, propertyName?: string): void;
export type ElementValidator = (value: any) => void;
export declare function validateValueAsArray(value: any, elementValidator: ElementValidator, propertyName?: string): void;
export declare function validateValueAsOptionalArray(value: any, elementValidator: ElementValidator, propertyName?: string): void;
export declare function validateValueAsMap(value: any, keyValidator: ElementValidator, valueValidator: ElementValidator, propertyName?: string): void;
export declare function validateValueAsOptionalMap(value: any, keyValidator: ElementValidator, valueValidator: ElementValidator, propertyName?: string): void;
export declare function validateValueAsObject(value: any, elementValidator: ElementValidator, propertyName: string): void;
export declare function validateValueAsOptionalObject(value: any, elementValidator: ElementValidator, propertyName: string): void;