@autorest/go
Version:
AutoRest Go Generator
103 lines • 4.13 kB
TypeScript
import * as client from './client.js';
import * as param from './param.js';
import * as type from './type.js';
export type ResultType = AnyResult | BinaryResult | HeadAsBooleanResult | MonomorphicResult | PolymorphicResult | ModelResult;
export interface ResponseEnvelope {
name: string;
docs: type.Docs;
result?: ResultType;
headers: Array<HeaderResponse | HeaderMapResponse>;
method: client.Method | client.LROMethod | client.PageableMethod | client.LROPageableMethod;
}
export type ResultFormat = 'JSON' | 'XML' | 'Text';
export interface AnyResult {
fieldName: string;
docs: type.Docs;
httpStatusCodeType: Record<number, type.PossibleType>;
format: ResultFormat;
byValue: true;
}
export type BinaryResultFormat = 'binary';
export interface BinaryResult {
fieldName: string;
docs: type.Docs;
binaryFormat: BinaryResultFormat;
byValue: true;
}
export interface HeadAsBooleanResult {
fieldName: string;
docs: type.Docs;
headAsBoolean: true;
byValue: true;
}
export type MonomorphicResultType = type.BytesType | type.ConstantType | type.MapType | type.PrimitiveType | type.SliceType | type.TimeType;
export interface MonomorphicResult {
fieldName: string;
docs: type.Docs;
monomorphicType: MonomorphicResultType;
format: ResultFormat;
byValue: boolean;
xml?: type.XMLInfo;
}
export interface PolymorphicResult {
docs: type.Docs;
interfaceType: type.InterfaceType;
format: 'JSON';
}
export type ModelResultFormat = 'JSON' | 'XML';
export interface ModelResult {
docs: type.Docs;
modelType: type.ModelType;
format: ModelResultFormat;
}
export declare function isAnyResult(resultType: ResultType): resultType is AnyResult;
export declare function isBinaryResult(resultType: ResultType): resultType is BinaryResult;
export declare function isHeadAsBooleanResult(resultType: ResultType): resultType is HeadAsBooleanResult;
export declare function isHeaderMapResponse(resp: HeaderResponse | HeaderMapResponse): resp is HeaderMapResponse;
export declare function isMonomorphicResult(resultType: ResultType): resultType is MonomorphicResult;
export declare function isPolymorphicResult(resultType: ResultType): resultType is PolymorphicResult;
export declare function isModelResult(resultType: ResultType): resultType is ModelResult;
export declare function getResultPossibleType(resultType: ResultType): type.PossibleType;
export interface HeaderResponse {
fieldName: string;
docs: type.Docs;
type: param.HeaderType;
byValue: boolean;
headerName: string;
}
export interface HeaderMapResponse {
fieldName: string;
docs: type.Docs;
type: type.MapType;
byValue: boolean;
headerName: string;
collectionPrefix: string;
}
export declare class ResponseEnvelope implements ResponseEnvelope {
constructor(name: string, docs: type.Docs, forMethod: client.Method);
}
export declare class HeaderResponse implements HeaderResponse {
constructor(fieldName: string, type: param.HeaderType, headerName: string, byValue: boolean);
}
export declare class HeaderMapResponse implements HeaderMapResponse {
constructor(fieldName: string, type: type.MapType, collectionPrefix: string, headerName: string, byValue: boolean);
}
export declare class AnyResult implements AnyResult {
constructor(fieldName: string, format: ResultFormat, resultTypes: Record<number, type.PossibleType>);
}
export declare class BinaryResult implements BinaryResult {
constructor(fieldName: string, format: BinaryResultFormat);
}
export declare class HeadAsBooleanResult implements HeadAsBooleanResult {
constructor(fieldName: string);
}
export declare class MonomorphicResult implements MonomorphicResult {
constructor(fieldName: string, format: ResultFormat, type: MonomorphicResultType, byValue: boolean);
}
export declare class PolymorphicResult implements PolymorphicResult {
constructor(type: type.InterfaceType);
}
export declare class ModelResult implements ModelResult {
constructor(type: type.ModelType, format: ModelResultFormat);
}
//# sourceMappingURL=result.d.ts.map