@cisco-meraki/dashboard-api-tools
Version:
Typescript library for interacting with Meraki's public API
29 lines (28 loc) • 872 B
TypeScript
import { ApiResponse, Options } from "./apiUtils";
declare type Errors = string[];
declare type ActionBatchStatus = {
completed: boolean;
failed: boolean;
errors: Errors;
createdResources?: Record<string, unknown>;
};
declare type Action = {
resource: string | null;
operation: "create" | "update" | "destroy";
body: Record<string, unknown>;
};
declare type ActionBatchResponse = {
id: string;
organizationId: string;
confirmed: boolean;
synchronous: boolean;
status: ActionBatchStatus;
actions: Action[];
};
declare type ActionBatchOptions = {
maxPollingTime?: number;
interval?: number;
synchronous?: boolean;
};
declare const batchedApiRequest: (orgId: string, actions: Action[], authOptions: Options, opts?: ActionBatchOptions) => Promise<ApiResponse<ActionBatchResponse>>;
export { batchedApiRequest };