# bookclerk_library::entities::node_upload_sessions

SeaORM entity for `node_upload_sessions`: one title's streamed upload
from a branch node to a shared node (H-4 design, section 6). Written by
`control_plane::uploads`.

| Item | Kind | Summary |
| --- | --- | --- |
| [`Model`](#model) | struct | Row shape for one upload. |
| [`ColumnIter`](#columniter) | struct | An iterator over the variants of [Column] |
| [`Entity`](#entity) | struct | Generated by sea-orm-macros |
| [`PrimaryKeyIter`](#primarykeyiter) | struct | An iterator over the variants of [PrimaryKey] |
| [`ActiveModel`](#activemodel) | struct | Generated by sea-orm-macros |
| [`RelationIter`](#relationiter) | struct | An iterator over the variants of [Relation] |
| [`Column`](#column) | enum | Generated by sea-orm-macros |
| [`PrimaryKey`](#primarykey) | enum | Generated by sea-orm-macros |
| [`Relation`](#relation) | enum | Declared SeaORM relations (none). |

## Structs

### Model

```rust
pub struct Model {
    pub upload_id: String,
    pub token_hash: String,
    pub node_id: String,
    pub job_id: String,
    pub lease_generation: i64,
    pub receiving_node_id: String,
    pub holding_id: String,
    pub primary_key: String,
    pub manifest_json: String,
    pub received_json: String,
    pub state: String,
    pub created_at: String,
    pub expires_at: String,
    pub committed_at: Option<String>,
}
```

Row shape for one upload.

**Fields**

- `upload_id`: Upload id (hyphenated UUID).
- `token_hash`: `hash_token` of the bearer token; the token itself is never stored.
- `node_id`: Branch node the upload was granted to.
- `job_id`: Acquire job the upload belongs to.
- `lease_generation`: Lease generation the grant was made under; the upload is accepted
  only while it is the job's live fence for this node.
- `receiving_node_id`: Shared node that streams the files to its destinations.
- `holding_id`: The title's holding (`holdings.id`): the account holding of a job
  upload, or the node holding of a branch's catalog upload; empty for
  a job's closing upload.
- `primary_key`: Storage key of the title's primary audio file.
- `manifest_json`: The declared files and PDF key (JSON object `{files, pdfKey}`, each
  file `{key, size, sha256, content_type}`).
- `received_json`: Indexes of the files written to every destination (JSON list).
- `state`: `open`, `committed` or `aborted`.
- `created_at`: RFC 3339 grant time.
- `expires_at`: RFC 3339 time after which the token is refused.
- `committed_at`: RFC 3339 commit time.

#### Model::into_ex

```rust
pub fn into_ex(self) -> Self
```

Generated by sea-orm-macros

Implements: `Clone`, `Debug`, `Eq`, `From<Model>`, `FromQueryResult`, `IntoActiveModel<ActiveModel>`, `ModelTrait`, `PartialEq`, `TryFrom<ActiveModel>`, `TryIntoModel<Model>`

### ColumnIter

```rust
pub struct ColumnIter {
    /* private fields */
}
```

An iterator over the variants of [Column](#column)

Implements: `Clone`, `Debug`, `DoubleEndedIterator`, `ExactSizeIterator`, `FusedIterator`, `Iterator`

### Entity

```rust
pub struct Entity;
```

Generated by sea-orm-macros

Implements: `Clone`, `Copy`, `Debug`, `Default`, `EntityName`, `EntityTrait`, `Iden`, `IdenStatic`

### PrimaryKeyIter

```rust
pub struct PrimaryKeyIter {
    /* private fields */
}
```

An iterator over the variants of [PrimaryKey](#primarykey)

Implements: `Clone`, `Debug`, `DoubleEndedIterator`, `ExactSizeIterator`, `FusedIterator`, `Iterator`

### ActiveModel

```rust
pub struct ActiveModel {
    pub upload_id: ActiveValue<String>,
    pub token_hash: ActiveValue<String>,
    pub node_id: ActiveValue<String>,
    pub job_id: ActiveValue<String>,
    pub lease_generation: ActiveValue<i64>,
    pub receiving_node_id: ActiveValue<String>,
    pub holding_id: ActiveValue<String>,
    pub primary_key: ActiveValue<String>,
    pub manifest_json: ActiveValue<String>,
    pub received_json: ActiveValue<String>,
    pub state: ActiveValue<String>,
    pub created_at: ActiveValue<String>,
    pub expires_at: ActiveValue<String>,
    pub committed_at: ActiveValue<Option<String>>,
}
```

Generated by sea-orm-macros

**Fields**

- `upload_id`: Generated by sea-orm-macros
- `token_hash`: Generated by sea-orm-macros
- `node_id`: Generated by sea-orm-macros
- `job_id`: Generated by sea-orm-macros
- `lease_generation`: Generated by sea-orm-macros
- `receiving_node_id`: Generated by sea-orm-macros
- `holding_id`: Generated by sea-orm-macros
- `primary_key`: Generated by sea-orm-macros
- `manifest_json`: Generated by sea-orm-macros
- `received_json`: Generated by sea-orm-macros
- `state`: Generated by sea-orm-macros
- `created_at`: Generated by sea-orm-macros
- `expires_at`: Generated by sea-orm-macros
- `committed_at`: Generated by sea-orm-macros

Implements: `ActiveModelBehavior`, `ActiveModelTrait`, `Clone`, `Debug`, `Default`, `From<Model>`, `IntoActiveModel<ActiveModel>`, `PartialEq`, `TryFrom<ActiveModel>`, `TryIntoModel<Model>`

### RelationIter

```rust
pub struct RelationIter {
    /* private fields */
}
```

An iterator over the variants of [Relation](#relation)

Implements: `Clone`, `Debug`, `DoubleEndedIterator`, `ExactSizeIterator`, `FusedIterator`, `Iterator`

## Enums

### Column

```rust
pub enum Column {
    UploadId,
    TokenHash,
    NodeId,
    JobId,
    LeaseGeneration,
    ReceivingNodeId,
    HoldingId,
    PrimaryKey,
    ManifestJson,
    ReceivedJson,
    State,
    CreatedAt,
    ExpiresAt,
    CommittedAt,
}
```

Generated by sea-orm-macros

**Variants**

- `UploadId`: Generated by sea-orm-macros
- `TokenHash`: Generated by sea-orm-macros
- `NodeId`: Generated by sea-orm-macros
- `JobId`: Generated by sea-orm-macros
- `LeaseGeneration`: Generated by sea-orm-macros
- `ReceivingNodeId`: Generated by sea-orm-macros
- `HoldingId`: Generated by sea-orm-macros
- `PrimaryKey`: Generated by sea-orm-macros
- `ManifestJson`: Generated by sea-orm-macros
- `ReceivedJson`: Generated by sea-orm-macros
- `State`: Generated by sea-orm-macros
- `CreatedAt`: Generated by sea-orm-macros
- `ExpiresAt`: Generated by sea-orm-macros
- `CommittedAt`: Generated by sea-orm-macros

Implements: `Clone`, `ColumnTrait`, `Copy`, `Debug`, `FromStr`, `Iden`, `IdenStatic`, `IntoEnumIterator`

### PrimaryKey

```rust
pub enum PrimaryKey {
    UploadId,
}
```

Generated by sea-orm-macros

**Variants**

- `UploadId`: Generated by sea-orm-macros

Implements: `Clone`, `Copy`, `Debug`, `Iden`, `IdenStatic`, `IntoEnumIterator`, `PrimaryKeyToColumn`, `PrimaryKeyTrait`

### Relation

```rust
pub enum Relation {}
```

Declared SeaORM relations (none).

Implements: `Clone`, `Copy`, `Debug`, `IntoEnumIterator`, `RelationTrait`
