UNPKG

@azure-tools/typespec-java

Version:

TypeSpec library for emitting Java client from the TypeSpec REST protocol binding

43 lines 1.8 kB
import { ComplexSchema, ObjectSchema, Schema, SchemaType } from "@autorest/codemodel"; import { DeepPartial } from "@azure-tools/codegen"; import { SchemaUsage } from "./usage.js"; /** an OR relationship between several schemas * * @note - this expresses that the schema can be * any combination of the schema types given, which means * that this restricts the types to just <ObjectSchemaTypes> * because it does not make sense that a value can be a 'primitive' * and an 'object' at the same time. Nor does it make sense * that a value can be two primitive types at the same time. */ export interface OrSchema extends ComplexSchema, SchemaUsage { /** the set of schemas that this schema is composed of. Every schema is optional */ anyOf: Array<ObjectSchema>; } export declare class OrSchema extends Schema implements OrSchema { constructor(name: string, description: string, objectInitializer?: DeepPartial<OrSchema>); } /** an XOR relationship between several schemas * * @note because this indicates that the actual schema * can be any one of the possible types, there is no * restriction on the type that it may be. (bool or object or number is ok) */ export interface XorSchema extends Schema { /** the set of schemas that this must be one and only one of. */ oneOf: Array<Schema>; } export declare class XorSchema extends Schema implements XorSchema { constructor(name: string, description: string, objectInitializer?: DeepPartial<XorSchema>); } /** a NOT relationship between schemas * * @fearthecowboy - I don't think we're going to implement this. */ export interface NotSchema extends Schema { /** the schema type */ type: SchemaType.Not; /** the schema that this may not be. */ not: Schema; } //# sourceMappingURL=relationship.d.ts.map