Available languages: [Python](https://databento.com/docs/api-historical/helpers/batch-download-params.python.md) · [C++](https://databento.com/docs/api-historical/helpers/batch-download-params.cpp.md) · [Rust](https://databento.com/docs/api-historical/helpers/batch-download-params.rust.md) · [HTTP](https://databento.com/docs/api-historical/helpers/batch-download-params.http.md)

Source: https://databento.com/docs/api-historical/helpers/batch-download-params


### DownloadParams

The parameter struct and builder for [HistoricalClient::batch::download](https://databento.com/docs/api-historical/batch/batch-download.md).

The builder can be instantiated with the associated function `builder()`, and the struct is created from the builder with the `build()` method.
For every field, there is an identically named setter method on the builder.

#### API method

```rust
pub struct DownloadParams {
    pub output_dir: PathBuf,
    pub job_id: String,
    pub filename_to_download: Option<String>,
}
```

#### Fields

| Parameter | Type | Description |
| `output_dir` | PathBuf | The directory to download the file(s) to. |
| `job_id` | String | The batch job identifier. |
| `filename_to_download` | Option\ | The specific file to download. If `None` then will download all files for the batch job. |

#### Example usage

```rust
use std::path::PathBuf;

use databento::historical::batch::DownloadParams;
use time::macros::datetime;

assert_eq!(
    DownloadParams {
        output_dir: PathBuf::from("/tmp"),
        job_id: "GLBX-20230926-ANMGJK7JB6".to_owned(),
        filename_to_download: None,
    },
    DownloadParams::builder()
        .output_dir("/tmp")
        .job_id("GLBX-20230926-ANMGJK7JB6")
        .build()
);
```
