@microsoft.azure/autorest.incubator
Version:
AutoRest incubator project
33 lines • 2.23 kB
TypeScript
import { KnownMediaType } from '#common/media-types';
import { Expression, ExpressionOrLiteral } from '#csharp/code-dom/expression';
import { OneOrMoreStatements } from '#csharp/code-dom/statements/statement';
import { TypeDeclaration } from '#csharp/code-dom/type-declaration';
import { Variable } from '#csharp/code-dom/variable';
import { EnhancedTypeDeclaration } from './extended-type-declaration';
import { Schema } from '#csharp/lowlevel-generator/code-model';
export declare function pushTempVar(): string;
export declare function popTempVar(): void;
export declare abstract class Primitive implements EnhancedTypeDeclaration {
schema: Schema;
abstract isRequired: boolean;
abstract isXmlAttribute: boolean;
abstract declaration: string;
abstract jsonType: TypeDeclaration;
protected ToStringMethod: string;
constructor(schema: Schema);
/** validatePresence on primitives is generally not required; the nullability determines requiredness... */
validatePresence(property: Variable): string;
abstract validateValue(property: Variable): string;
private readonly baseType;
protected castJsonTypeToPrimitive(tmpValue: string, defaultValue: string): string;
protected castXmlTypeToPrimitive(tmpValue: string, defaultValue: string): string;
deserializeFromContainerMember(mediaType: KnownMediaType, container: ExpressionOrLiteral, serializedName: string, defaultValue: Expression): Expression;
deserializeFromNode(mediaType: KnownMediaType, node: ExpressionOrLiteral, defaultValue: Expression): Expression;
/** emits an expression to deserialize content from a string */
deserializeFromString(mediaType: KnownMediaType, content: ExpressionOrLiteral, defaultValue: Expression): Expression | undefined;
/** emits an expression serialize this to a HttpContent */
serializeToContent(mediaType: KnownMediaType, value: ExpressionOrLiteral): Expression;
serializeToNode(mediaType: KnownMediaType, value: ExpressionOrLiteral, serializedName: string): Expression;
serializeToContainerMember(mediaType: KnownMediaType, value: ExpressionOrLiteral, container: Variable, serializedName: string): OneOrMoreStatements;
}
//# sourceMappingURL=primitive.d.ts.map