-
Notifications
You must be signed in to change notification settings - Fork 4k
/
Copy pathdatabooleandto.ts
62 lines (54 loc) · 1.7 KB
/
databooleandto.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type DataBooleanDto = {
data: boolean;
};
/** @internal */
export const DataBooleanDto$inboundSchema: z.ZodType<
DataBooleanDto,
z.ZodTypeDef,
unknown
> = z.object({
data: z.boolean(),
});
/** @internal */
export type DataBooleanDto$Outbound = {
data: boolean;
};
/** @internal */
export const DataBooleanDto$outboundSchema: z.ZodType<
DataBooleanDto$Outbound,
z.ZodTypeDef,
DataBooleanDto
> = z.object({
data: z.boolean(),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace DataBooleanDto$ {
/** @deprecated use `DataBooleanDto$inboundSchema` instead. */
export const inboundSchema = DataBooleanDto$inboundSchema;
/** @deprecated use `DataBooleanDto$outboundSchema` instead. */
export const outboundSchema = DataBooleanDto$outboundSchema;
/** @deprecated use `DataBooleanDto$Outbound` instead. */
export type Outbound = DataBooleanDto$Outbound;
}
export function dataBooleanDtoToJSON(dataBooleanDto: DataBooleanDto): string {
return JSON.stringify(DataBooleanDto$outboundSchema.parse(dataBooleanDto));
}
export function dataBooleanDtoFromJSON(
jsonString: string,
): SafeParseResult<DataBooleanDto, SDKValidationError> {
return safeParse(
jsonString,
(x) => DataBooleanDto$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'DataBooleanDto' from JSON`,
);
}