/* * 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 IssueTrackingCollectionTicketsAddGlobals = { /** * 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 IssueTrackingCollectionTicketsAddRequest = { /** * 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; ticket: components.TicketInput; }; export type IssueTrackingCollectionTicketsAddResponse = { httpMeta: components.HTTPMetadata; /** * Create a Ticket */ createTicketResponse?: components.CreateTicketResponse | undefined; /** * Unexpected error */ unexpectedErrorResponse?: components.UnexpectedErrorResponse | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketsAddGlobals$inboundSchema: z.ZodType< IssueTrackingCollectionTicketsAddGlobals, z.ZodTypeDef, unknown > = z.object({ consumerId: z.string().optional(), appId: z.string().optional(), }); /** @internal */ export type IssueTrackingCollectionTicketsAddGlobals$Outbound = { consumerId?: string | undefined; appId?: string | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketsAddGlobals$outboundSchema: z.ZodType< IssueTrackingCollectionTicketsAddGlobals$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketsAddGlobals > = 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 IssueTrackingCollectionTicketsAddGlobals$ { /** @deprecated use `IssueTrackingCollectionTicketsAddGlobals$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketsAddGlobals$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsAddGlobals$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketsAddGlobals$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsAddGlobals$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketsAddGlobals$Outbound; } export function issueTrackingCollectionTicketsAddGlobalsToJSON( issueTrackingCollectionTicketsAddGlobals: IssueTrackingCollectionTicketsAddGlobals, ): string { return JSON.stringify( IssueTrackingCollectionTicketsAddGlobals$outboundSchema.parse( issueTrackingCollectionTicketsAddGlobals, ), ); } export function issueTrackingCollectionTicketsAddGlobalsFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketsAddGlobals, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketsAddGlobals$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketsAddGlobals' from JSON`, ); } /** @internal */ export const IssueTrackingCollectionTicketsAddRequest$inboundSchema: z.ZodType< IssueTrackingCollectionTicketsAddRequest, z.ZodTypeDef, unknown > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), collection_id: z.string(), Ticket: components.TicketInput$inboundSchema, }).transform((v) => { return remap$(v, { "collection_id": "collectionId", "Ticket": "ticket", }); }); /** @internal */ export type IssueTrackingCollectionTicketsAddRequest$Outbound = { raw: boolean; serviceId?: string | undefined; collection_id: string; Ticket: components.TicketInput$Outbound; }; /** @internal */ export const IssueTrackingCollectionTicketsAddRequest$outboundSchema: z.ZodType< IssueTrackingCollectionTicketsAddRequest$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketsAddRequest > = z.object({ raw: z.boolean().default(false), serviceId: z.string().optional(), collectionId: z.string(), ticket: components.TicketInput$outboundSchema, }).transform((v) => { return remap$(v, { 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 IssueTrackingCollectionTicketsAddRequest$ { /** @deprecated use `IssueTrackingCollectionTicketsAddRequest$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketsAddRequest$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsAddRequest$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketsAddRequest$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsAddRequest$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketsAddRequest$Outbound; } export function issueTrackingCollectionTicketsAddRequestToJSON( issueTrackingCollectionTicketsAddRequest: IssueTrackingCollectionTicketsAddRequest, ): string { return JSON.stringify( IssueTrackingCollectionTicketsAddRequest$outboundSchema.parse( issueTrackingCollectionTicketsAddRequest, ), ); } export function issueTrackingCollectionTicketsAddRequestFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketsAddRequest, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketsAddRequest$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketsAddRequest' from JSON`, ); } /** @internal */ export const IssueTrackingCollectionTicketsAddResponse$inboundSchema: z.ZodType< IssueTrackingCollectionTicketsAddResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, CreateTicketResponse: components.CreateTicketResponse$inboundSchema .optional(), UnexpectedErrorResponse: components.UnexpectedErrorResponse$inboundSchema .optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "CreateTicketResponse": "createTicketResponse", "UnexpectedErrorResponse": "unexpectedErrorResponse", }); }); /** @internal */ export type IssueTrackingCollectionTicketsAddResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; CreateTicketResponse?: components.CreateTicketResponse$Outbound | undefined; UnexpectedErrorResponse?: | components.UnexpectedErrorResponse$Outbound | undefined; }; /** @internal */ export const IssueTrackingCollectionTicketsAddResponse$outboundSchema: z.ZodType< IssueTrackingCollectionTicketsAddResponse$Outbound, z.ZodTypeDef, IssueTrackingCollectionTicketsAddResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, createTicketResponse: components.CreateTicketResponse$outboundSchema .optional(), unexpectedErrorResponse: components.UnexpectedErrorResponse$outboundSchema .optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", createTicketResponse: "CreateTicketResponse", 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 IssueTrackingCollectionTicketsAddResponse$ { /** @deprecated use `IssueTrackingCollectionTicketsAddResponse$inboundSchema` instead. */ export const inboundSchema = IssueTrackingCollectionTicketsAddResponse$inboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsAddResponse$outboundSchema` instead. */ export const outboundSchema = IssueTrackingCollectionTicketsAddResponse$outboundSchema; /** @deprecated use `IssueTrackingCollectionTicketsAddResponse$Outbound` instead. */ export type Outbound = IssueTrackingCollectionTicketsAddResponse$Outbound; } export function issueTrackingCollectionTicketsAddResponseToJSON( issueTrackingCollectionTicketsAddResponse: IssueTrackingCollectionTicketsAddResponse, ): string { return JSON.stringify( IssueTrackingCollectionTicketsAddResponse$outboundSchema.parse( issueTrackingCollectionTicketsAddResponse, ), ); } export function issueTrackingCollectionTicketsAddResponseFromJSON( jsonString: string, ): SafeParseResult< IssueTrackingCollectionTicketsAddResponse, SDKValidationError > { return safeParse( jsonString, (x) => IssueTrackingCollectionTicketsAddResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'IssueTrackingCollectionTicketsAddResponse' from JSON`, ); }