/** * This file was auto-generated by Fern from our API Definition. */ import * as environments from "../../../../environments"; import * as core from "../../../../core"; import * as Chariot from "../../../index"; export declare namespace Grants { interface Options { environment?: core.Supplier; token?: core.Supplier; fetcher?: core.FetchFunction; } interface RequestOptions { /** The maximum time to wait for a response in seconds. */ timeoutInSeconds?: number; /** The number of times to retry the request. Defaults to 2. */ maxRetries?: number; /** A hook to abort the request. */ abortSignal?: AbortSignal; } } export declare class Grants { protected readonly _options: Grants.Options; constructor(_options?: Grants.Options); /** * Returns a list of all grants for a given Connect. This API allows for paginating over many results. * * @param {Chariot.GrantsListRequest} request * @param {Grants.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Chariot.BadRequestError} * @throws {@link Chariot.UnauthorizedError} * @throws {@link Chariot.ForbiddenError} * @throws {@link Chariot.InternalServerError} * * @example * await client.grants.list({ * chariotApiKey: "live_xJd0lUrvpDkzeGBWZbuI2wbvEdM" * }) */ list(request: Chariot.GrantsListRequest, requestOptions?: Grants.RequestOptions): Promise>; /** * Create and submit a new grant. This should be used to capture a grant intent from an authorized DAFpay workflow session and submit the grant request to the DAF sponsor. * * * Error handling: * - The grant must be captured within 15 minutes of authorization otherwise the request will return status `410 Gone`. * - A grant can only be captured once from any given workflow session so any duplicate requests will return status `409 Conflict`. * - The amount must be in whole dollar increments (rounded to the nearest hundred) as currently DAFs only accept whole dollar grants otherwise the request will return status `400 Bad Request`. * - The amount must be greater than or equal to the minimum grant amount for the DAF otherwise the request will return status `400 Bad Request`. * - The amount must be less than or equal to the user's DAF account balance otherwise the request will return status `400 Bad Request`. * - Any inputs exceeding the maximum allowed length will be automatically truncated. * * * @param {Chariot.GrantsCreateRequest} request * @param {Grants.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Chariot.BadRequestError} * @throws {@link Chariot.UnauthorizedError} * @throws {@link Chariot.ForbiddenError} * @throws {@link Chariot.NotFoundError} * @throws {@link Chariot.ConflictError} * @throws {@link Chariot.GoneError} * @throws {@link Chariot.InternalServerError} * * @example * await client.grants.create({ * workflowSessionId: "workflowSessionId", * amount: 1.1 * }) */ create(request: Chariot.GrantsCreateRequest, requestOptions?: Grants.RequestOptions): Promise; /** * Retrieve a grant with the given ID. * * @param {string} id - The unique id of the grant. * The format should be a v4 UUID according to RFC 4122. * @param {Grants.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Chariot.BadRequestError} * @throws {@link Chariot.UnauthorizedError} * @throws {@link Chariot.ForbiddenError} * @throws {@link Chariot.NotFoundError} * @throws {@link Chariot.InternalServerError} * * @example * await client.grants.get("10229488-08d2-4629-b70c-a2f4f4d25344") */ get(id: string, requestOptions?: Grants.RequestOptions): Promise; /** * Update a grant object with the given ID. * This can be used to update the status or acknowledgement of the grant. * * @param {string} id - The unique id of the grant. * The format should be a v4 UUID according to RFC 4122. * @param {Chariot.GrantsUpdateRequest} request * @param {Grants.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Chariot.BadRequestError} * @throws {@link Chariot.UnauthorizedError} * @throws {@link Chariot.ForbiddenError} * @throws {@link Chariot.NotFoundError} * @throws {@link Chariot.InternalServerError} * * @example * await client.grants.update("10229488-08d2-4629-b70c-a2f4f4d25344") */ update(id: string, request?: Chariot.GrantsUpdateRequest, requestOptions?: Grants.RequestOptions): Promise; protected _getAuthorizationHeader(): Promise; }