@docusign/iam-sdk
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@docusign/iam-sdk* API.
81 lines (72 loc) • 2.56 kB
text/typescript
/*
* Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
*/
import * as z from "zod";
import { safeParse } from "../../lib/schemas.js";
import { Result as SafeParseResult } from "../../types/fp.js";
import { SDKValidationError } from "../errors/sdkvalidationerror.js";
export type CreateAgreementSummaryRequest = {
accountId?: string | null | undefined;
agreementId?: string | null | undefined;
};
/** @internal */
export const CreateAgreementSummaryRequest$inboundSchema: z.ZodType<
CreateAgreementSummaryRequest,
z.ZodTypeDef,
unknown
> = z.object({
accountId: z.nullable(
z.string().default("00000000-0000-0000-0000-000000000000"),
),
agreementId: z.nullable(
z.string().default("00000000-0000-0000-0000-000000000000"),
),
});
/** @internal */
export type CreateAgreementSummaryRequest$Outbound = {
accountId: string | null;
agreementId: string | null;
};
/** @internal */
export const CreateAgreementSummaryRequest$outboundSchema: z.ZodType<
CreateAgreementSummaryRequest$Outbound,
z.ZodTypeDef,
CreateAgreementSummaryRequest
> = z.object({
accountId: z.nullable(
z.string().default("00000000-0000-0000-0000-000000000000"),
),
agreementId: z.nullable(
z.string().default("00000000-0000-0000-0000-000000000000"),
),
});
/**
* @internal
* @deprecated This namespace will be removed in future versions. Use schemas and types that are exported directly from this module.
*/
export namespace CreateAgreementSummaryRequest$ {
/** @deprecated use `CreateAgreementSummaryRequest$inboundSchema` instead. */
export const inboundSchema = CreateAgreementSummaryRequest$inboundSchema;
/** @deprecated use `CreateAgreementSummaryRequest$outboundSchema` instead. */
export const outboundSchema = CreateAgreementSummaryRequest$outboundSchema;
/** @deprecated use `CreateAgreementSummaryRequest$Outbound` instead. */
export type Outbound = CreateAgreementSummaryRequest$Outbound;
}
export function createAgreementSummaryRequestToJSON(
createAgreementSummaryRequest: CreateAgreementSummaryRequest,
): string {
return JSON.stringify(
CreateAgreementSummaryRequest$outboundSchema.parse(
createAgreementSummaryRequest,
),
);
}
export function createAgreementSummaryRequestFromJSON(
jsonString: string,
): SafeParseResult<CreateAgreementSummaryRequest, SDKValidationError> {
return safeParse(
jsonString,
(x) => CreateAgreementSummaryRequest$inboundSchema.parse(JSON.parse(x)),
`Failed to parse 'CreateAgreementSummaryRequest' from JSON`,
);
}