UNPKG

@autorest/powershell

Version:
38 lines 2.64 kB
import { KnownMediaType } from '@azure-tools/codemodel-v3'; import { ClassType } from '@azure-tools/codegen-csharp'; import { Expression, ExpressionOrLiteral } from '@azure-tools/codegen-csharp'; import { OneOrMoreStatements } from '@azure-tools/codegen-csharp'; import { Variable } from '@azure-tools/codegen-csharp'; import { PrimitiveSchema } from '@autorest/codemodel'; import { EnhancedTypeDeclaration } from './extended-type-declaration'; export declare function pushTempVar(): string; export declare function popTempVar(): void; export declare abstract class NewPrimitive implements EnhancedTypeDeclaration { schema: PrimitiveSchema; abstract isRequired: boolean; abstract isXmlAttribute: boolean; abstract declaration: string; abstract jsonType: ClassType; get isNullable(): boolean; get encode(): string; get defaultOfType(): Expression; get convertObjectMethod(): string; constructor(schema: PrimitiveSchema); /** validatePresence on primitives is generally not required; the nullability determines requiredness... */ validatePresence(eventListener: Variable, property: Variable): string; abstract validateValue(eventListener: Variable, property: Variable): string; protected get baseType(): string; 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 to deserialize content from a content/response */ deserializeFromResponse(mediaType: KnownMediaType, content: ExpressionOrLiteral, defaultValue: Expression): Expression | undefined; /** emits an expression serialize this to a HttpContent */ serializeToContent(mediaType: KnownMediaType, value: ExpressionOrLiteral, mode: Expression): Expression; serializeToNode(mediaType: KnownMediaType, value: ExpressionOrLiteral, serializedName: string, mode: Expression): Expression; serializeToContainerMember(mediaType: KnownMediaType, value: ExpressionOrLiteral, container: Variable, serializedName: string, mode: Expression): OneOrMoreStatements; } //# sourceMappingURL=primitive.d.ts.map