liveBook · Manning

OutputConfig

As explained in API Design Patterns

OutputConfig is a configuration interface specifying how an export operation transforms and transports outgoing data.

OutputConfig specifies how an export operation transforms API resources into bytes and transports those bytes to external storage. It keeps serialization, compression, encryption, and file-splitting settings separate from the DataDestination that handles storage access. section 23.2 section 23.3.3

Use OutputConfig to control the exported representation, while keeping resource selection outside the configuration.

  • Choose a serialization format such as JSON or CSV. section 23.3.3
  • Configure compression, including ZIP or BZ2, and optionally apply other transformations such as encryption. section 23.2 section 23.3.3
  • Define filename templates and maximum file sizes when one export may produce multiple files. section 23.3.3
  • Keep filters on the export request rather than inside OutputConfig; filtering selects resources before serialization. section 23.3.8

Exporting Message resources

An export request can combine a MessageOutputConfig with a DataDestination and a filter. For example, configure CSV output with a filename template such as "messages-part-${number}", a maximum file size, and ZIP compression, then export only matching resources. section 23.3.3 section 23.3.8

Listing 23.6 Example input and output configuration for Message resources
interface MessageInputConfig {           #1    
  // The content type of the input.
  // Choices: "json", "csv", undefined (auto-detected)
  contentType?: string;
 
  // Choices: "zip", "bz2", undefined (not compressed)
  compressionFormat?: string;
}
 
interface MessageOutputConfig {          #1
  // The content type for serialization.
  // Choices: "json", "csv", undefined for default.
  contentType?: string;
 
  // Use ${number} for a zero-padded file ID number.
  // Content type will be appended with file extension (e.g., ".json").
  // Default: "messages-part-${number}"
  filenameTemplate?: string;
 
  maxFileSizeMb?: number;
 
  // Choices: "zip", "bz2", undefined (not compressed)
  compressionFormat?: string;
}

Use the configuration listing to inspect the complete Message-specific shape and its defaults. section 23.3.3

How API Design Patterns covers it

How deep it goes
Defines format, filenames, size limits, and compression, while deferring resource selection to export-request filtering.
Examples
Uses Message resources exported as CSV with partitioned filenames, size limits, and ZIP or BZ2 compression.
What it assumes
Assumes API resources, serialization, and external storage; separates retrieval from processing rather than teaching storage implementation.
What you can do after
Operate/configure export requests with explicit serialization, partitioning, compression, destination, and filtering choices.
How it connects
Connects data transformation with DataDestination, serialization, compression, encryption, and filtering.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of API Design Patterns. The section links point to the parts of the book it draws on.