/* * 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 IssueTrackingCollectionTicketCommentsUpdateGlobals = { /** * 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 IssueTrackingCollectionTicketCommentsUpdateRequest = { /** * ID of the record you are acting upon. */ id: string; /** * 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; /** * Include raw response. Mostly used for debugging purposes */ raw?: boolean | undefined; /** * The collection ID */ collectionId: string; /** * ID of the ticket you are acting upon. */ ticketId: string; collectionTicketComment: components.CollectionTicketCommentInput; }; export type IssueTrackingCollectionTicketCommentsUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Update a Comment */ updateCommentResponse?: components.UpdateCommentResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketCommentsUpdateGlobals$inboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type IssueTrackingCollectionTicketCommentsUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketCommentsUpdateGlobals$outboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsUpdateGlobals$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketCommentsUpdateGlobals > = 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 IssueTrackingCollectionTicketCommentsUpdateGlobals$ { /** @deprecated use `IssueTrackingCollectionTicketCommentsUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketCommentsUpdateGlobals$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketCommentsUpdateGlobals$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsUpdateGlobals$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketCommentsUpdateGlobals$Outbound; } export function issueTrackingCollectionTicketCommentsUpdateGlobalsToJSON( issueTrackingCollectionTicketCommentsUpdateGlobals: IssueTrackingCollectionTicketCommentsUpdateGlobals, ): string { return JSON.stringify( IssueTrackingCollectionTicketCommentsUpdateGlobals$outboundSchema.parse( issueTrackingCollectionTicketCommentsUpdateGlobals, ), ); } export function issueTrackingCollectionTicketCommentsUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketCommentsUpdateGlobals, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketCommentsUpdateGlobals$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketCommentsUpdateGlobals' from JSON`, ); } /** @internal */ export const IssueTrackingCollectionTicketCommentsUpdateRequest$inboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsUpdateRequest, z.ZodTypeDef, unknown > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), 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 IssueTrackingCollectionTicketCommentsUpdateRequest$Outbound = { id: string; serviceId?: string | undefined; raw: boolean; collection_id: string; ticket_id: string; CollectionTicketComment: components.CollectionTicketCommentInput$Outbound; }; /** @internal */ export const IssueTrackingCollectionTicketCommentsUpdateRequest$outboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsUpdateRequest$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketCommentsUpdateRequest > = z.object({ id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), 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 IssueTrackingCollectionTicketCommentsUpdateRequest$ { /** @deprecated use `IssueTrackingCollectionTicketCommentsUpdateRequest$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketCommentsUpdateRequest$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsUpdateRequest$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketCommentsUpdateRequest$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsUpdateRequest$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketCommentsUpdateRequest$Outbound; } export function issueTrackingCollectionTicketCommentsUpdateRequestToJSON( issueTrackingCollectionTicketCommentsUpdateRequest: IssueTrackingCollectionTicketCommentsUpdateRequest, ): string { return JSON.stringify( IssueTrackingCollectionTicketCommentsUpdateRequest$outboundSchema.parse( issueTrackingCollectionTicketCommentsUpdateRequest, ), ); } export function issueTrackingCollectionTicketCommentsUpdateRequestFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketCommentsUpdateRequest, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketCommentsUpdateRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketCommentsUpdateRequest' from JSON`, ); } /** @internal */ export const IssueTrackingCollectionTicketCommentsUpdateResponse$inboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateCommentResponse: components.UpdateCommentResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateCommentResponse": "updateCommentResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type IssueTrackingCollectionTicketCommentsUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateCommentResponse?: components.UpdateCommentResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketCommentsUpdateResponse$outboundSchema: z.ZodType< IssueTrackingCollectionTicketCommentsUpdateResponse$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketCommentsUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateCommentResponse: components.UpdateCommentResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateCommentResponse: "UpdateCommentResponse", 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 IssueTrackingCollectionTicketCommentsUpdateResponse$ { /** @deprecated use `IssueTrackingCollectionTicketCommentsUpdateResponse$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketCommentsUpdateResponse$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsUpdateResponse$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketCommentsUpdateResponse$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketCommentsUpdateResponse$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketCommentsUpdateResponse$Outbound; } export function issueTrackingCollectionTicketCommentsUpdateResponseToJSON( issueTrackingCollectionTicketCommentsUpdateResponse: IssueTrackingCollectionTicketCommentsUpdateResponse, ): string { return JSON.stringify( IssueTrackingCollectionTicketCommentsUpdateResponse$outboundSchema.parse( issueTrackingCollectionTicketCommentsUpdateResponse, ), ); } export function issueTrackingCollectionTicketCommentsUpdateResponseFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketCommentsUpdateResponse, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketCommentsUpdateResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketCommentsUpdateResponse' from JSON`, ); }