/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; import { safeParse } from "../../lib/schemas.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { OAuthRefreshTokenCredentials, OAuthRefreshTokenCredentials$inboundSchema, OAuthRefreshTokenCredentials$Outbound, OAuthRefreshTokenCredentials$outboundSchema, } from "./oauthrefreshtokencredentials.js"; export type AuthenticatorJiraConnection = { provider: "jira"; credentials: OAuthRefreshTokenCredentials; }; /** @internal */ export const AuthenticatorJiraConnection$inboundSchema: z.ZodType< AuthenticatorJiraConnection, z.ZodTypeDef, unknown > = z.object({ provider: z.literal("jira"), credentials: OAuthRefreshTokenCredentials$inboundSchema, }); /** @internal */ export type AuthenticatorJiraConnection$Outbound = { provider: "jira"; credentials: OAuthRefreshTokenCredentials$Outbound; }; /** @internal */ export const AuthenticatorJiraConnection$outboundSchema: z.ZodType< AuthenticatorJiraConnection$Outbound, z.ZodTypeDef, AuthenticatorJiraConnection > = z.object({ provider: z.literal("jira"), credentials: OAuthRefreshTokenCredentials$outboundSchema, }); export function authenticatorJiraConnectionToJSON( authenticatorJiraConnection: AuthenticatorJiraConnection, ): string { return JSON.stringify( AuthenticatorJiraConnection$outboundSchema.parse( authenticatorJiraConnection, ), ); } export function authenticatorJiraConnectionFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AuthenticatorJiraConnection$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AuthenticatorJiraConnection' from JSON`, ); }