Package ai.extend

Class ExtendClient

  • Direct Known Subclasses:
    ExtendClientWrapper

    public class ExtendClient
    extends ExtendClientBase
    The Extend API client, with additional polling and webhook utilities.

    Extends the generated ExtendClientBase, so all generated methods (parse, edit, extract, classify, split, files, extractors, classifiers, splitters, workflows, evaluation sets, etc.) are available directly.

    Additionally provides:

    • createAndPoll on all run resources (extractRuns, classifyRuns, etc.)
    • webhooks() for signature verification

    Basic Usage

    
     // Reads EXTEND_API_KEY from the environment automatically
     ExtendClient client = ExtendClient.builder().build();
    
     // ...or set the key explicitly
     ExtendClient client = ExtendClient.builder()
         .apiKey("your-api-key")
         .build();
    
     // Synchronous convenience methods (inherited from ExtendClientBase)
     ParseRun parseResult = client.parse(ParseRequest.builder().file(...).build());
     ExtractRun extractResult = client.extract(ExtractRequest.builder().file(...).build());
    
     // Create and poll an extract run
     ExtractRun response = client.extractRuns().createAndPoll(
         ExtractRunsCreateRequest.builder()
             .file(...)
             .extractor(...)
             .build()
     );
     

    Webhook Verification

    
     Map<String, Object> event = client.webhooks().verifyAndParse(
         requestBody,
         requestHeaders,
         signingSecret
     );
     
    • Constructor Detail

      • ExtendClient

        public ExtendClient​(ClientOptions clientOptions)
    • Method Detail

      • webhooks

        public Webhooks webhooks()
        Returns the webhook utilities for signature verification.
      • extractRuns

        public ExtractRunsClient extractRuns()
        Returns the extract runs client with createAndPoll support. All standard methods (create, list, retrieve, delete, cancel) are also available.
        Overrides:
        extractRuns in class ExtendClientBase
      • classifyRuns

        public ClassifyRunsClient classifyRuns()
        Returns the classify runs client with createAndPoll support. All standard methods (create, list, retrieve, delete, cancel) are also available.
        Overrides:
        classifyRuns in class ExtendClientBase
      • splitRuns

        public SplitRunsClient splitRuns()
        Returns the split runs client with createAndPoll support. All standard methods (create, list, retrieve, delete, cancel) are also available.
        Overrides:
        splitRuns in class ExtendClientBase
      • parseRuns

        public ParseRunsClient parseRuns()
        Returns the parse runs client with createAndPoll support. All standard methods (create, retrieve, delete) are also available.
        Overrides:
        parseRuns in class ExtendClientBase
      • editRuns

        public EditRunsClient editRuns()
        Returns the edit runs client with createAndPoll support. All standard methods (create, retrieve, delete) are also available.
        Overrides:
        editRuns in class ExtendClientBase
      • workflowRuns

        public WorkflowRunsClient workflowRuns()
        Returns the workflow runs client with createAndPoll support. All standard methods (create, list, retrieve, update, delete, cancel, createBatch) are also available.
        Overrides:
        workflowRuns in class ExtendClientBase