attio-js
Version:
Developer-friendly & type-safe JS/TS SDK based on the official OpenAPI spec of Attio.
134 lines (118 loc) • 4.27 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { remap as remap$ } from "../../lib/primitives.js";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type DeleteV2CommentsCommentIdRequest = {
commentId: string;
};
/**
* Success
*/
export type DeleteV2CommentsCommentIdResponse = {};
/** @internal */
export const DeleteV2CommentsCommentIdRequest$inboundSchema: z.ZodType<
DeleteV2CommentsCommentIdRequest,
z.ZodTypeDef,
unknown
> = z.object({
comment_id: z.string(),
}).transform((v) => {
return remap$(v, {
"comment_id": "commentId",
});
});
/** @internal */
export type DeleteV2CommentsCommentIdRequest$Outbound = {
comment_id: string;
};
/** @internal */
export const DeleteV2CommentsCommentIdRequest$outboundSchema: z.ZodType<
DeleteV2CommentsCommentIdRequest$Outbound,
z.ZodTypeDef,
DeleteV2CommentsCommentIdRequest
> = z.object({
commentId: z.string(),
}).transform((v) => {
return remap$(v, {
commentId: "comment_id",
});
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace DeleteV2CommentsCommentIdRequest$ {
/** @deprecated use `DeleteV2CommentsCommentIdRequest$inboundSchema` instead. */
export const inboundSchema = DeleteV2CommentsCommentIdRequest$inboundSchema;
/** @deprecated use `DeleteV2CommentsCommentIdRequest$outboundSchema` instead. */
export const outboundSchema = DeleteV2CommentsCommentIdRequest$outboundSchema;
/** @deprecated use `DeleteV2CommentsCommentIdRequest$Outbound` instead. */
export type Outbound = DeleteV2CommentsCommentIdRequest$Outbound;
}
export function deleteV2CommentsCommentIdRequestToJSON(
deleteV2CommentsCommentIdRequest: DeleteV2CommentsCommentIdRequest,
): string {
return JSON.stringify(
DeleteV2CommentsCommentIdRequest$outboundSchema.parse(
deleteV2CommentsCommentIdRequest,
),
);
}
export function deleteV2CommentsCommentIdRequestFromJSON(
jsonString: string,
): SafeParseResult<DeleteV2CommentsCommentIdRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => DeleteV2CommentsCommentIdRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'DeleteV2CommentsCommentIdRequest' from JSON`,
);
}
/** @internal */
export const DeleteV2CommentsCommentIdResponse$inboundSchema: z.ZodType<
DeleteV2CommentsCommentIdResponse,
z.ZodTypeDef,
unknown
> = z.object({});
/** @internal */
export type DeleteV2CommentsCommentIdResponse$Outbound = {};
/** @internal */
export const DeleteV2CommentsCommentIdResponse$outboundSchema: z.ZodType<
DeleteV2CommentsCommentIdResponse$Outbound,
z.ZodTypeDef,
DeleteV2CommentsCommentIdResponse
> = z.object({});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace DeleteV2CommentsCommentIdResponse$ {
/** @deprecated use `DeleteV2CommentsCommentIdResponse$inboundSchema` instead. */
export const inboundSchema = DeleteV2CommentsCommentIdResponse$inboundSchema;
/** @deprecated use `DeleteV2CommentsCommentIdResponse$outboundSchema` instead. */
export const outboundSchema =
DeleteV2CommentsCommentIdResponse$outboundSchema;
/** @deprecated use `DeleteV2CommentsCommentIdResponse$Outbound` instead. */
export type Outbound = DeleteV2CommentsCommentIdResponse$Outbound;
}
export function deleteV2CommentsCommentIdResponseToJSON(
deleteV2CommentsCommentIdResponse: DeleteV2CommentsCommentIdResponse,
): string {
return JSON.stringify(
DeleteV2CommentsCommentIdResponse$outboundSchema.parse(
deleteV2CommentsCommentIdResponse,
),
);
}
export function deleteV2CommentsCommentIdResponseFromJSON(
jsonString: string,
): SafeParseResult<DeleteV2CommentsCommentIdResponse, SDKValidationError> {
return safeParse(
jsonString,
(x) => DeleteV2CommentsCommentIdResponse$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'DeleteV2CommentsCommentIdResponse' from JSON`,
);
}