/* * 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 DeleteFoldersFolderIdSharingsSharingIdRequest = { /** * Hashed ID of the folder */ folderId: string; /** * ID of the sharing to be deleted */ sharingId: string; }; export type DeleteFoldersFolderIdSharingsSharingIdShare = { id: number; name: string; type: string; email: string; }; export type DeleteFoldersFolderIdSharingsSharingIdFolder = { 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 DeleteFoldersFolderIdSharingsSharingIdResponse = { id: number; isAdmin: boolean; canShare: boolean; canDownload: boolean; canUpload: boolean; share: DeleteFoldersFolderIdSharingsSharingIdShare; folder: DeleteFoldersFolderIdSharingsSharingIdFolder; /** * 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 DeleteFoldersFolderIdSharingsSharingIdRequest$Outbound = { folderId: string; sharingId: string; }; /** @internal */ export const DeleteFoldersFolderIdSharingsSharingIdRequest$outboundSchema: z.ZodType< DeleteFoldersFolderIdSharingsSharingIdRequest$Outbound, z.ZodTypeDef, DeleteFoldersFolderIdSharingsSharingIdRequest > = z.object({ folderId: z.string(), sharingId: z.string(), }); export function deleteFoldersFolderIdSharingsSharingIdRequestToJSON( deleteFoldersFolderIdSharingsSharingIdRequest: DeleteFoldersFolderIdSharingsSharingIdRequest, ): string { return JSON.stringify( DeleteFoldersFolderIdSharingsSharingIdRequest$outboundSchema.parse( deleteFoldersFolderIdSharingsSharingIdRequest, ), ); } /** @internal */ export const DeleteFoldersFolderIdSharingsSharingIdShare$inboundSchema: z.ZodType< DeleteFoldersFolderIdSharingsSharingIdShare, z.ZodTypeDef, unknown > = z.object({ id: z.number().int(), name: z.string(), type: z.string(), email: z.string(), }); export function deleteFoldersFolderIdSharingsSharingIdShareFromJSON( jsonString: string, ): SafeParseResult< DeleteFoldersFolderIdSharingsSharingIdShare, SDKValidationError > { return safeParse( jsonString, (x) => DeleteFoldersFolderIdSharingsSharingIdShare$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'DeleteFoldersFolderIdSharingsSharingIdShare' from JSON`, ); } /** @internal */ export const DeleteFoldersFolderIdSharingsSharingIdFolder$inboundSchema: z.ZodType< DeleteFoldersFolderIdSharingsSharingIdFolder, z.ZodTypeDef, unknown > = z.object({ id: z.number().int(), name: z.string(), }); export function deleteFoldersFolderIdSharingsSharingIdFolderFromJSON( jsonString: string, ): SafeParseResult< DeleteFoldersFolderIdSharingsSharingIdFolder, SDKValidationError > { return safeParse( jsonString, (x) => DeleteFoldersFolderIdSharingsSharingIdFolder$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'DeleteFoldersFolderIdSharingsSharingIdFolder' from JSON`, ); } /** @internal */ export const DeleteFoldersFolderIdSharingsSharingIdResponse$inboundSchema: z.ZodType< DeleteFoldersFolderIdSharingsSharingIdResponse, 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(() => DeleteFoldersFolderIdSharingsSharingIdShare$inboundSchema ), folder: z.lazy(() => DeleteFoldersFolderIdSharingsSharingIdFolder$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 deleteFoldersFolderIdSharingsSharingIdResponseFromJSON( jsonString: string, ): SafeParseResult< DeleteFoldersFolderIdSharingsSharingIdResponse, SDKValidationError > { return safeParse( jsonString, (x) => DeleteFoldersFolderIdSharingsSharingIdResponse$inboundSchema.parse( JSON.parse(x), ), `Failed to parse 'DeleteFoldersFolderIdSharingsSharingIdResponse' from JSON`, ); }