/* * 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 * as components from "../components/index.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; export type IssueTrackingCollectionTicketCommentsAddGlobals = { /** * ID of the consumer which you want to get or push data from */ consumerId?: string | undefined; /** * The ID of your Unify application */ appId?: string | undefined; }; export type IssueTrackingCollectionTicketCommentsAddRequest = { /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; /** * Provide the service id you want to call (e.g., pipedrive). Only needed when a consumer has activated multiple integrations for a Unified API. */ serviceId?: string | undefined; /** * The collection ID */ collectionId: string; /** * ID of the ticket you are acting upon. */ ticketId: string; collectionTicketComment: components.CollectionTicketCommentInput; }; export type IssueTrackingCollectionTicketCommentsAddResponse = { httpMeta: components.HTTPMetadata; /** * Create a Comment */ createCommentResponse?: components.CreateCommentResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketCommentsAddGlobals$inboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsAddGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type IssueTrackingCollectionTicketCommentsAddGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketCommentsAddGlobals$outboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsAddGlobals$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketCommentsAddGlobals > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IssueTrackingCollectionTicketCommentsAddGlobals$ { /** @deprecated use `IssueTrackingCollectionTicketCommentsAddGlobals$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketCommentsAddGlobals$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsAddGlobals$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketCommentsAddGlobals$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsAddGlobals$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketCommentsAddGlobals$Outbound; } export function issueTrackingCollectionTicketCommentsAddGlobalsToJSON( issueTrackingCollectionTicketCommentsAddGlobals: IssueTrackingCollectionTicketCommentsAddGlobals, ): string { return JSON.stringify( IssueTrackingCollectionTicketCommentsAddGlobals$outboundSchema.parse( issueTrackingCollectionTicketCommentsAddGlobals, ), ); } export function issueTrackingCollectionTicketCommentsAddGlobalsFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketCommentsAddGlobals, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketCommentsAddGlobals$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketCommentsAddGlobals' from JSON`, ); } /** @internal */ export const IssueTrackingCollectionTicketCommentsAddRequest$inboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsAddRequest, z.ZodTypeDef, unknown > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), collection_id: z.string(), ticket_id: z.string(), CollectionTicketComment: components.CollectionTicketCommentInput$inboundSchema, }).transform((v) => { return remap$(v, { "collection_id": "collectionId", "ticket_id": "ticketId", "CollectionTicketComment": "collectionTicketComment", }); }); /** @internal */ export type IssueTrackingCollectionTicketCommentsAddRequest$Outbound = { raw: boolean; serviceId?: string | undefined; collection_id: string; ticket_id: string; CollectionTicketComment: components.CollectionTicketCommentInput$Outbound; }; /** @internal */ export const IssueTrackingCollectionTicketCommentsAddRequest$outboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsAddRequest$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketCommentsAddRequest > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), collectionId: z.string(), ticketId: z.string(), collectionTicketComment: components.CollectionTicketCommentInput$outboundSchema, }).transform((v) => { return remap$(v, { collectionId: "collection_id", ticketId: "ticket_id", collectionTicketComment: "CollectionTicketComment", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IssueTrackingCollectionTicketCommentsAddRequest$ { /** @deprecated use `IssueTrackingCollectionTicketCommentsAddRequest$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketCommentsAddRequest$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsAddRequest$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketCommentsAddRequest$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsAddRequest$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketCommentsAddRequest$Outbound; } export function issueTrackingCollectionTicketCommentsAddRequestToJSON( issueTrackingCollectionTicketCommentsAddRequest: IssueTrackingCollectionTicketCommentsAddRequest, ): string { return JSON.stringify( IssueTrackingCollectionTicketCommentsAddRequest$outboundSchema.parse( issueTrackingCollectionTicketCommentsAddRequest, ), ); } export function issueTrackingCollectionTicketCommentsAddRequestFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketCommentsAddRequest, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketCommentsAddRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketCommentsAddRequest' from JSON`, ); } /** @internal */ export const IssueTrackingCollectionTicketCommentsAddResponse$inboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsAddResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateCommentResponse: components.CreateCommentResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateCommentResponse": "createCommentResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type IssueTrackingCollectionTicketCommentsAddResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; CreateCommentResponse?: components.CreateCommentResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketCommentsAddResponse$outboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsAddResponse$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketCommentsAddResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, createCommentResponse: components.CreateCommentResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", createCommentResponse: "CreateCommentResponse", unexpectedErrorResponse: "UnexpectedErrorResponse", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IssueTrackingCollectionTicketCommentsAddResponse$ { /** @deprecated use `IssueTrackingCollectionTicketCommentsAddResponse$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketCommentsAddResponse$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsAddResponse$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketCommentsAddResponse$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsAddResponse$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketCommentsAddResponse$Outbound; } export function issueTrackingCollectionTicketCommentsAddResponseToJSON( issueTrackingCollectionTicketCommentsAddResponse: IssueTrackingCollectionTicketCommentsAddResponse, ): string { return JSON.stringify( IssueTrackingCollectionTicketCommentsAddResponse$outboundSchema.parse( issueTrackingCollectionTicketCommentsAddResponse, ), ); } export function issueTrackingCollectionTicketCommentsAddResponseFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketCommentsAddResponse, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketCommentsAddResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketCommentsAddResponse' from JSON`, ); }