// (C) 2007-2020 GoodData Corporation import { ExecuteAFM as AFM, Execution } from "@gooddata/typings"; export type StatusCode = number; export type ISchemaAfmExecutionResponse = Execution.IExecutionResponseWrapper | StatusCode; export interface ISchemaAfmExecution { _description?: string; execution: AFM.IExecution; executionResponse?: ISchemaAfmExecutionResponse; executionResult?: Execution.IExecutionResultWrapper | StatusCode; } export function isErrorResponse(response: ISchemaAfmExecutionResponse): response is StatusCode { return typeof response === "number"; } export function isExecutionResponseWrapper( response: ISchemaAfmExecutionResponse, ): response is Execution.IExecutionResponseWrapper { return (response as Execution.IExecutionResponseWrapper).executionResponse !== undefined; }