/* * 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 IssueTrackingCollectionTicketsUpdateGlobals = { /** * 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 IssueTrackingCollectionTicketsUpdateRequest = { /** * ID of the ticket you are acting upon. */ ticketId: 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; ticket: components.TicketInput; }; export type IssueTrackingCollectionTicketsUpdateResponse = { httpMeta: components.HTTPMetadata; /** * Update a Ticket */ updateTicketResponse?: components.UpdateTicketResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketsUpdateGlobals$inboundSchema: z.ZodType< IssueTrackingCollectionTicketsUpdateGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type IssueTrackingCollectionTicketsUpdateGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketsUpdateGlobals$outboundSchema: z.ZodType< IssueTrackingCollectionTicketsUpdateGlobals$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketsUpdateGlobals > = 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 IssueTrackingCollectionTicketsUpdateGlobals$ { /** @deprecated use `IssueTrackingCollectionTicketsUpdateGlobals$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketsUpdateGlobals$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsUpdateGlobals$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketsUpdateGlobals$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsUpdateGlobals$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketsUpdateGlobals$Outbound; } export function issueTrackingCollectionTicketsUpdateGlobalsToJSON( issueTrackingCollectionTicketsUpdateGlobals: IssueTrackingCollectionTicketsUpdateGlobals, ): string { return JSON.stringify( IssueTrackingCollectionTicketsUpdateGlobals$outboundSchema.parse( issueTrackingCollectionTicketsUpdateGlobals, ), ); } export function issueTrackingCollectionTicketsUpdateGlobalsFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketsUpdateGlobals, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketsUpdateGlobals$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketsUpdateGlobals' from JSON`, ); } /** @internal */ export const IssueTrackingCollectionTicketsUpdateRequest$inboundSchema: z.ZodType< IssueTrackingCollectionTicketsUpdateRequest, z.ZodTypeDef, unknown > = z.object({ ticket_id: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), collection_id: z.string(), Ticket: components.TicketInput$inboundSchema, }).transform((v) => { return remap$(v, { "ticket_id": "ticketId", "collection_id": "collectionId", "Ticket": "ticket", }); }); /** @internal */ export type IssueTrackingCollectionTicketsUpdateRequest$Outbound = { ticket_id: string; serviceId?: string | undefined; raw: boolean; collection_id: string; Ticket: components.TicketInput$Outbound; }; /** @internal */ export const IssueTrackingCollectionTicketsUpdateRequest$outboundSchema: z.ZodType< IssueTrackingCollectionTicketsUpdateRequest$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketsUpdateRequest > = z.object({ ticketId: z.string(), serviceId: z.string().optional(), raw: z.boolean().default(false), collectionId: z.string(), ticket: components.TicketInput$outboundSchema, }).transform((v) => { return remap$(v, { ticketId: "ticket_id", collectionId: "collection_id", ticket: "Ticket", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace IssueTrackingCollectionTicketsUpdateRequest$ { /** @deprecated use `IssueTrackingCollectionTicketsUpdateRequest$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketsUpdateRequest$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsUpdateRequest$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketsUpdateRequest$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsUpdateRequest$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketsUpdateRequest$Outbound; } export function issueTrackingCollectionTicketsUpdateRequestToJSON( issueTrackingCollectionTicketsUpdateRequest: IssueTrackingCollectionTicketsUpdateRequest, ): string { return JSON.stringify( IssueTrackingCollectionTicketsUpdateRequest$outboundSchema.parse( issueTrackingCollectionTicketsUpdateRequest, ), ); } export function issueTrackingCollectionTicketsUpdateRequestFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketsUpdateRequest, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketsUpdateRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketsUpdateRequest' from JSON`, ); } /** @internal */ export const IssueTrackingCollectionTicketsUpdateResponse$inboundSchema: z.ZodType< IssueTrackingCollectionTicketsUpdateResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, UpdateTicketResponse: components.UpdateTicketResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "UpdateTicketResponse": "updateTicketResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type IssueTrackingCollectionTicketsUpdateResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; UpdateTicketResponse?: components.UpdateTicketResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketsUpdateResponse$outboundSchema: z.ZodType< IssueTrackingCollectionTicketsUpdateResponse$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketsUpdateResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, updateTicketResponse: components.UpdateTicketResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", updateTicketResponse: "UpdateTicketResponse", 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 IssueTrackingCollectionTicketsUpdateResponse$ { /** @deprecated use `IssueTrackingCollectionTicketsUpdateResponse$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketsUpdateResponse$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsUpdateResponse$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketsUpdateResponse$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsUpdateResponse$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketsUpdateResponse$Outbound; } export function issueTrackingCollectionTicketsUpdateResponseToJSON( issueTrackingCollectionTicketsUpdateResponse: IssueTrackingCollectionTicketsUpdateResponse, ): string { return JSON.stringify( IssueTrackingCollectionTicketsUpdateResponse$outboundSchema.parse( issueTrackingCollectionTicketsUpdateResponse, ), ); } export function issueTrackingCollectionTicketsUpdateResponseFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketsUpdateResponse, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketsUpdateResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketsUpdateResponse' from JSON`, ); }