/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import * as z from "zod/v3"; 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"; export type GetFoldersFolderIdSharingsSharingIdRequest = { /** * Hashed ID for the folder for which you'd like to see sharings. */ folderId: string; /** * The ID of the specific sharing object that you want to see. */ sharingId: number; }; export type GetFoldersFolderIdSharingsSharingIdShare = { id: number; name: string; type: string; email: string; }; export type GetFoldersFolderIdSharingsSharingIdFolder = { id: number; name: string; }; /** * A sharing is an object that links either a contact or a contact group to a folder, including information about the contacts' permissions to that folder. * * @remarks */ export type GetFoldersFolderIdSharingsSharingIdResponse = { id: number; isAdmin: boolean; canShare: boolean; canDownload: boolean; canUpload: boolean; share: GetFoldersFolderIdSharingsSharingIdShare; folder: GetFoldersFolderIdSharingsSharingIdFolder; /** * A cursor for stable pagination based on current `sort_by` order. You can pass this to `cursor[before]` or `cursor[after]` as a parameter to fetch the records before or after this record in the same sort order. This is only populated if records were fetched with `cursor[enabled]`, or `cursor[before]` or `cursor[after]`. */ cursor?: string | null | undefined; }; /** @internal */ export type GetFoldersFolderIdSharingsSharingIdRequest$Outbound = { folderId: string; sharingId: number; }; /** @internal */ export const GetFoldersFolderIdSharingsSharingIdRequest$outboundSchema: z.ZodType< GetFoldersFolderIdSharingsSharingIdRequest$Outbound, z.ZodTypeDef, GetFoldersFolderIdSharingsSharingIdRequest > = z.object({ folderId: z.string(), sharingId: z.number().int(), }); export function getFoldersFolderIdSharingsSharingIdRequestToJSON( getFoldersFolderIdSharingsSharingIdRequest: GetFoldersFolderIdSharingsSharingIdRequest, ): string { return JSON.stringify( GetFoldersFolderIdSharingsSharingIdRequest$outboundSchema.parse( getFoldersFolderIdSharingsSharingIdRequest, ), ); } /** @internal */ export const GetFoldersFolderIdSharingsSharingIdShare$inboundSchema: z.ZodType< GetFoldersFolderIdSharingsSharingIdShare, z.ZodTypeDef, unknown > = z.object({ id: z.number().int(), name: z.string(), type: z.string(), email: z.string(), }); export function getFoldersFolderIdSharingsSharingIdShareFromJSON( jsonString: string, ): SafeParseResult< GetFoldersFolderIdSharingsSharingIdShare, SDKValidationError > { return safeParse( jsonString, (x) => GetFoldersFolderIdSharingsSharingIdShare$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetFoldersFolderIdSharingsSharingIdShare' from JSON`, ); } /** @internal */ export const GetFoldersFolderIdSharingsSharingIdFolder$inboundSchema: z.ZodType< GetFoldersFolderIdSharingsSharingIdFolder, z.ZodTypeDef, unknown > = z.object({ id: z.number().int(), name: z.string(), }); export function getFoldersFolderIdSharingsSharingIdFolderFromJSON( jsonString: string, ): SafeParseResult< GetFoldersFolderIdSharingsSharingIdFolder, SDKValidationError > { return safeParse( jsonString, (x) => GetFoldersFolderIdSharingsSharingIdFolder$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetFoldersFolderIdSharingsSharingIdFolder' from JSON`, ); } /** @internal */ export const GetFoldersFolderIdSharingsSharingIdResponse$inboundSchema: z.ZodType< GetFoldersFolderIdSharingsSharingIdResponse, z.ZodTypeDef, unknown > = z.object({ id: z.number().int(), is_admin: z.boolean(), can_share: z.boolean(), can_download: z.boolean(), can_upload: z.boolean(), share: z.lazy(() => GetFoldersFolderIdSharingsSharingIdShare$inboundSchema), folder: z.lazy(() => GetFoldersFolderIdSharingsSharingIdFolder$inboundSchema ), cursor: z.nullable(z.string()).optional(), }).transform((v) => { return remap$(v, { "is_admin": "isAdmin", "can_share": "canShare", "can_download": "canDownload", "can_upload": "canUpload", }); }); export function getFoldersFolderIdSharingsSharingIdResponseFromJSON( jsonString: string, ): SafeParseResult< GetFoldersFolderIdSharingsSharingIdResponse, SDKValidationError > { return safeParse( jsonString, (x) => GetFoldersFolderIdSharingsSharingIdResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'GetFoldersFolderIdSharingsSharingIdResponse' from JSON`, ); }