/* * 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 { SDKValidationError } from "../errors/sdkvalidationerror.js"; import { SharedLink, SharedLink$inboundSchema, SharedLink$Outbound, SharedLink$outboundSchema, } from "./sharedlink.js"; /** * Shared Link */ export type GetSharedLinkResponse = { /** * HTTP Response Status Code */ statusCode: number; /** * HTTP Response Status */ status: string; /** * Apideck ID of service provider */ service: string; /** * Unified API resource name */ resource: string; /** * Operation performed */ operation: string; data: SharedLink; }; /** @internal */ export const GetSharedLinkResponse$inboundSchema: z.ZodType< GetSharedLinkResponse, z.ZodTypeDef, unknown > = z.object({ status_code: z.number().int(), status: z.string(), service: z.string(), resource: z.string(), operation: z.string(), data: SharedLink$inboundSchema, }).transform((v) => { return remap$(v, { "status_code": "statusCode", }); }); /** @internal */ export type GetSharedLinkResponse$Outbound = { status_code: number; status: string; service: string; resource: string; operation: string; data: SharedLink$Outbound; }; /** @internal */ export const GetSharedLinkResponse$outboundSchema: z.ZodType< GetSharedLinkResponse$Outbound, z.ZodTypeDef, GetSharedLinkResponse > = z.object({ statusCode: z.number().int(), status: z.string(), service: z.string(), resource: z.string(), operation: z.string(), data: SharedLink$outboundSchema, }).transform((v) => { return remap$(v, { statusCode: "status_code", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace GetSharedLinkResponse$ { /** @deprecated use `GetSharedLinkResponse$inboundSchema` instead. */ export const inboundSchema = GetSharedLinkResponse$inboundSchema; /** @deprecated use `GetSharedLinkResponse$outboundSchema` instead. */ export const outboundSchema = GetSharedLinkResponse$outboundSchema; /** @deprecated use `GetSharedLinkResponse$Outbound` instead. */ export type Outbound = GetSharedLinkResponse$Outbound; } export function getSharedLinkResponseToJSON( getSharedLinkResponse: GetSharedLinkResponse, ): string { return JSON.stringify( GetSharedLinkResponse$outboundSchema.parse(getSharedLinkResponse), ); } export function getSharedLinkResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => GetSharedLinkResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'GetSharedLinkResponse' from JSON`, ); }