sideko_rest_api 0.9.2

Rust API Client
Documentation
# doc.version.topbar

## Module Functions

### Delete Topbar Item <a name="delete_item"></a>

**API Endpoint**: `DELETE /doc_project/{doc_name}/version/{doc_version}/topbar/{item_id}`

#### Parameters

| Parameter     | Required | Description | Example                                                            |
| ------------- | :------: | ----------- | ------------------------------------------------------------------ |
| `doc_name`    ||             | `"my-project".to_string()`                                         |
| `doc_version` ||             | `IdOrInt::Str("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string())` |
| `item_id`     ||             | `"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()`               |

#### Example Snippet

```rust
let client = sideko_rest_api::SidekoClient::default()
    .with_api_key_auth(&std::env::var("API_KEY").unwrap())
    .with_cookie_auth(&std::env::var("API_KEY").unwrap());
let res = client
    .doc()
    .version()
    .topbar()
    .delete_item(sideko_rest_api::resources::doc::version::topbar::DeleteItemRequest {
        doc_name: "my-project".to_string(),
        doc_version: sideko_rest_api::models::IdOrInt::Str(
            "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
        ),
        item_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
    })
    .await;
```

### List Topbar Items <a name="list_items"></a>

**API Endpoint**: `GET /doc_project/{doc_name}/version/{doc_version}/topbar`

#### Parameters

| Parameter     | Required | Description | Example                                                            |
| ------------- | :------: | ----------- | ------------------------------------------------------------------ |
| `doc_name`    ||             | `"my-project".to_string()`                                         |
| `doc_version` ||             | `IdOrInt::Str("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string())` |

#### Example Snippet

```rust
let client = sideko_rest_api::SidekoClient::default()
    .with_api_key_auth(&std::env::var("API_KEY").unwrap())
    .with_cookie_auth(&std::env::var("API_KEY").unwrap());
let res = client
    .doc()
    .version()
    .topbar()
    .list_items(sideko_rest_api::resources::doc::version::topbar::ListItemsRequest {
        doc_name: "my-project".to_string(),
        doc_version: sideko_rest_api::models::IdOrInt::Str(
            "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
        ),
    })
    .await;
```

#### Response

##### Type

Vec of [TopbarItem](/src/models/topbar_item.rs)

##### Example

```rust
vec![TopbarItem {component: SpaceComponent {created_at: "1970-01-01T00:00:00".to_string(), icon: Some("House".to_string()), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), label: "string".to_string(), slug: Some("string".to_string()), type_: ComponentTypeSpaceEnum::Space}, created_at: "1970-01-01T00:00:00".to_string(), doc_project_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order: 123}]
```

### Create Topbar Item <a name="create_item"></a>

**API Endpoint**: `POST /doc_project/{doc_name}/version/{doc_version}/topbar`

#### Parameters

| Parameter     | Required | Description | Example                                                                                                       |
| ------------- | :------: | ----------- | ------------------------------------------------------------------------------------------------------------- |
| `component`   ||             | `NewSpaceComponent {label: "string".to_string(), type_: ComponentTypeSpaceEnum::Space, ..Default::default()}` |
| `└─ icon`     ||             | `"string".to_string()`                                                                                        |
| `└─ label`    ||             | `"string".to_string()`                                                                                        |
| `└─ slug`     ||             | `"string".to_string()`                                                                                        |
| `└─ type_`    ||             | `ComponentTypeSpaceEnum::Space`                                                                               |
| `doc_name`    ||             | `"my-project".to_string()`                                                                                    |
| `doc_version` ||             | `IdOrInt::Str("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string())`                                            |

#### Example Snippet

```rust
let client = sideko_rest_api::SidekoClient::default()
    .with_api_key_auth(&std::env::var("API_KEY").unwrap())
    .with_cookie_auth(&std::env::var("API_KEY").unwrap());
let res = client
    .doc()
    .version()
    .topbar()
    .create_item(sideko_rest_api::resources::doc::version::topbar::CreateItemRequest {
        component: sideko_rest_api::models::NewSpaceComponent {
            label: "string".to_string(),
            type_: sideko_rest_api::models::ComponentTypeSpaceEnum::Space,
            ..Default::default()
        },
        doc_name: "my-project".to_string(),
        doc_version: sideko_rest_api::models::IdOrInt::Str(
            "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
        ),
    })
    .await;
```

#### Response

##### Type

[TopbarItem](/src/models/topbar_item.rs)

##### Example

```rust
TopbarItem {component: SpaceComponent {created_at: "1970-01-01T00:00:00".to_string(), icon: Some("House".to_string()), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), label: "string".to_string(), slug: Some("string".to_string()), type_: ComponentTypeSpaceEnum::Space}, created_at: "1970-01-01T00:00:00".to_string(), doc_project_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order: 123}
```

### Reorder Topbar <a name="reorder"></a>

**API Endpoint**: `POST /doc_project/{doc_name}/version/{doc_version}/topbar/reorder`

#### Parameters

| Parameter     | Required | Description | Example                                                                                        |
| ------------- | :------: | ----------- | ---------------------------------------------------------------------------------------------- |
| `data`        ||             | `vec![ReorderTopbarItem {id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order: 123}]` |
| `doc_name`    ||             | `"my-project".to_string()`                                                                     |
| `doc_version` ||             | `IdOrInt::Str("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string())`                             |

#### Example Snippet

```rust
let client = sideko_rest_api::SidekoClient::default()
    .with_api_key_auth(&std::env::var("API_KEY").unwrap())
    .with_cookie_auth(&std::env::var("API_KEY").unwrap());
let res = client
    .doc()
    .version()
    .topbar()
    .reorder(sideko_rest_api::resources::doc::version::topbar::ReorderRequest {
        data: vec![
            sideko_rest_api::models::ReorderTopbarItem { id :
            "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order : 123 }
        ],
        doc_name: "my-project".to_string(),
        doc_version: sideko_rest_api::models::IdOrInt::Str(
            "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
        ),
    })
    .await;
```

#### Response

##### Type

Vec of [TopbarItem](/src/models/topbar_item.rs)

##### Example

```rust
vec![TopbarItem {component: SpaceComponent {created_at: "1970-01-01T00:00:00".to_string(), icon: Some("House".to_string()), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), label: "string".to_string(), slug: Some("string".to_string()), type_: ComponentTypeSpaceEnum::Space}, created_at: "1970-01-01T00:00:00".to_string(), doc_project_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order: 123}]
```