/* * 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 AccountsEndRestrictionRequest = { /** * The account id. */ accountId: string; /** * The restriction id. */ restrictionId: string; endRestrictionRequestCreate: components.EndRestrictionRequestCreate; }; export type AccountsEndRestrictionResponse = { httpMeta: components.HTTPMetadata; /** * INVALID_ARGUMENT: The request is not valid, additional information may be present in the BadRequest details. */ status?: components.Status | undefined; }; /** @internal */ export const AccountsEndRestrictionRequest$inboundSchema: z.ZodType< AccountsEndRestrictionRequest, z.ZodTypeDef, unknown > = z.object({ account_id: z.string(), restriction_id: z.string(), EndRestrictionRequestCreate: components.EndRestrictionRequestCreate$inboundSchema, }).transform((v) => { return remap$(v, { "account_id": "accountId", "restriction_id": "restrictionId", "EndRestrictionRequestCreate": "endRestrictionRequestCreate", }); }); /** @internal */ export type AccountsEndRestrictionRequest$Outbound = { account_id: string; restriction_id: string; EndRestrictionRequestCreate: components.EndRestrictionRequestCreate$Outbound; }; /** @internal */ export const AccountsEndRestrictionRequest$outboundSchema: z.ZodType< AccountsEndRestrictionRequest$Outbound, z.ZodTypeDef, AccountsEndRestrictionRequest > = z.object({ accountId: z.string(), restrictionId: z.string(), endRestrictionRequestCreate: components.EndRestrictionRequestCreate$outboundSchema, }).transform((v) => { return remap$(v, { accountId: "account_id", restrictionId: "restriction_id", endRestrictionRequestCreate: "EndRestrictionRequestCreate", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsEndRestrictionRequest$ { /** @deprecated use `AccountsEndRestrictionRequest$inboundSchema` instead. */ export const inboundSchema = AccountsEndRestrictionRequest$inboundSchema; /** @deprecated use `AccountsEndRestrictionRequest$outboundSchema` instead. */ export const outboundSchema = AccountsEndRestrictionRequest$outboundSchema; /** @deprecated use `AccountsEndRestrictionRequest$Outbound` instead. */ export type Outbound = AccountsEndRestrictionRequest$Outbound; } export function accountsEndRestrictionRequestToJSON( accountsEndRestrictionRequest: AccountsEndRestrictionRequest, ): string { return JSON.stringify( AccountsEndRestrictionRequest$outboundSchema.parse( accountsEndRestrictionRequest, ), ); } export function accountsEndRestrictionRequestFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsEndRestrictionRequest$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsEndRestrictionRequest' from JSON`, ); } /** @internal */ export const AccountsEndRestrictionResponse$inboundSchema: z.ZodType< AccountsEndRestrictionResponse, z.ZodTypeDef, unknown > = z.object({ HttpMeta: components.HTTPMetadata$inboundSchema, Status: components.Status$inboundSchema.optional(), }).transform((v) => { return remap$(v, { "HttpMeta": "httpMeta", "Status": "status", }); }); /** @internal */ export type AccountsEndRestrictionResponse$Outbound = { HttpMeta: components.HTTPMetadata$Outbound; Status?: components.Status$Outbound | undefined; }; /** @internal */ export const AccountsEndRestrictionResponse$outboundSchema: z.ZodType< AccountsEndRestrictionResponse$Outbound, z.ZodTypeDef, AccountsEndRestrictionResponse > = z.object({ httpMeta: components.HTTPMetadata$outboundSchema, status: components.Status$outboundSchema.optional(), }).transform((v) => { return remap$(v, { httpMeta: "HttpMeta", status: "Status", }); }); /** * @internal * @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module. */ export namespace AccountsEndRestrictionResponse$ { /** @deprecated use `AccountsEndRestrictionResponse$inboundSchema` instead. */ export const inboundSchema = AccountsEndRestrictionResponse$inboundSchema; /** @deprecated use `AccountsEndRestrictionResponse$outboundSchema` instead. */ export const outboundSchema = AccountsEndRestrictionResponse$outboundSchema; /** @deprecated use `AccountsEndRestrictionResponse$Outbound` instead. */ export type Outbound = AccountsEndRestrictionResponse$Outbound; } export function accountsEndRestrictionResponseToJSON( accountsEndRestrictionResponse: AccountsEndRestrictionResponse, ): string { return JSON.stringify( AccountsEndRestrictionResponse$outboundSchema.parse( accountsEndRestrictionResponse, ), ); } export function accountsEndRestrictionResponseFromJSON( jsonString: string, ): SafeParseResult { return safeParse( jsonString, (x) => AccountsEndRestrictionResponse$inboundSchema.parse(JSON.parse(x)), `Failed to parse 'AccountsEndRestrictionResponse' from JSON`, ); }