# bookclerk_library::entities::node_enrollment_links

SeaORM entity for `node_enrollment_links`: single-use links that enroll a
branch node into this library. Only the hash of each link's secret is stored.

| Item | Kind | Summary |
| --- | --- | --- |
| [`Model`](#model) | struct | Row shape for one enrollment link. |
| [`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 link_id: String,
    pub token_hash: String,
    pub for_user_id: i64,
    pub label: String,
    pub created_by: String,
    pub created_at: String,
    pub expires_at: String,
    pub redeemed_at: Option<String>,
    pub redeemed_node_id: Option<String>,
    pub revoked_at: Option<String>,
    pub bring_accounts: i64,
}
```

Row shape for one enrollment link.

**Fields**

- `link_id`: Public link id (the second field of `bcn1.<link_id>.<secret>`).
- `token_hash`: `hash_token(secret)`. The secret itself is never stored.
- `for_user_id`: User who will own the enrolled node.
- `label`: Free-form label shown in listings.
- `created_by`: Audit id of the minter (`operator:<id>` or `user:<id>`).
- `created_at`: RFC 3339 mint time.
- `expires_at`: RFC 3339 expiry.
- `redeemed_at`: RFC 3339 redeem time, once redeemed.
- `redeemed_node_id`: Node the redeem created.
- `revoked_at`: RFC 3339 revoke time, once revoked.
- `bring_accounts`: `1` when the user who approved a branch sign-in chose "Bring my
  store connections to this branch": the redeem answer then carries
  the user's own shareable store accounts, sealed to the node.

#### 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 link_id: ActiveValue<String>,
    pub token_hash: ActiveValue<String>,
    pub for_user_id: ActiveValue<i64>,
    pub label: ActiveValue<String>,
    pub created_by: ActiveValue<String>,
    pub created_at: ActiveValue<String>,
    pub expires_at: ActiveValue<String>,
    pub redeemed_at: ActiveValue<Option<String>>,
    pub redeemed_node_id: ActiveValue<Option<String>>,
    pub revoked_at: ActiveValue<Option<String>>,
    pub bring_accounts: ActiveValue<i64>,
}
```

Generated by sea-orm-macros

**Fields**

- `link_id`: Generated by sea-orm-macros
- `token_hash`: Generated by sea-orm-macros
- `for_user_id`: Generated by sea-orm-macros
- `label`: Generated by sea-orm-macros
- `created_by`: Generated by sea-orm-macros
- `created_at`: Generated by sea-orm-macros
- `expires_at`: Generated by sea-orm-macros
- `redeemed_at`: Generated by sea-orm-macros
- `redeemed_node_id`: Generated by sea-orm-macros
- `revoked_at`: Generated by sea-orm-macros
- `bring_accounts`: 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 {
    LinkId,
    TokenHash,
    ForUserId,
    Label,
    CreatedBy,
    CreatedAt,
    ExpiresAt,
    RedeemedAt,
    RedeemedNodeId,
    RevokedAt,
    BringAccounts,
}
```

Generated by sea-orm-macros

**Variants**

- `LinkId`: Generated by sea-orm-macros
- `TokenHash`: Generated by sea-orm-macros
- `ForUserId`: Generated by sea-orm-macros
- `Label`: Generated by sea-orm-macros
- `CreatedBy`: Generated by sea-orm-macros
- `CreatedAt`: Generated by sea-orm-macros
- `ExpiresAt`: Generated by sea-orm-macros
- `RedeemedAt`: Generated by sea-orm-macros
- `RedeemedNodeId`: Generated by sea-orm-macros
- `RevokedAt`: Generated by sea-orm-macros
- `BringAccounts`: Generated by sea-orm-macros

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

### PrimaryKey

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

Generated by sea-orm-macros

**Variants**

- `LinkId`: 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`
