# doc.version.sidebar
## Module Functions
### Delete Sidebar Item <a name="delete_item"></a>
**API Endpoint**: `DELETE /doc_project/{doc_name}/version/{doc_version}/sidebar/{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()
.sidebar()
.delete_item(sideko_rest_api::resources::doc::version::sidebar::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 Sidebar Items <a name="list_items"></a>
**API Endpoint**: `GET /doc_project/{doc_name}/version/{doc_version}/sidebar`
#### Parameters
| Parameter | Required | Description | Example |
| ------------- | :------: | ----------- | ------------------------------------------------------------------ |
| `doc_name` | ✓ | | `"my-project".to_string()` |
| `doc_version` | ✓ | | `IdOrInt::Str("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string())` |
| `space_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()
.sidebar()
.list_items(sideko_rest_api::resources::doc::version::sidebar::ListItemsRequest {
doc_name: "my-project".to_string(),
doc_version: sideko_rest_api::models::IdOrInt::Str(
"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
),
..Default::default()
})
.await;
```
#### Response
##### Type
Vec of [SidebarItem](/src/models/sidebar_item.rs)
##### Example
```rust
vec![]
```
### Create Sidebar Item <a name="create_item"></a>
**API Endpoint**: `POST /doc_project/{doc_name}/version/{doc_version}/sidebar`
#### Parameters
| Parameter | Required | Description | Example |
| ------------- | :------: | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `component` | ✓ | | `NewSidebarItemComponent::NewDropdownComponent(NewDropdownComponent {icon: Some("House".to_string()), label: "string".to_string(), type_: ComponentTypeDropdownEnum::Dropdown, ..Default::default()})` |
| `doc_name` | ✓ | | `"my-project".to_string()` |
| `doc_version` | ✓ | | `IdOrInt::Str("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string())` |
| `parent_id` | ✗ | Parent sidebar item to nest new sidebar item within | `"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()` |
| `position` | ✗ | | `NewSidebarItemPositionEnum::Bottom` |
| `space_id` | ✗ | Space in which the new sidebar item should be added. If not provided the item will be added to the sidebar in the default space | `"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()
.sidebar()
.create_item(sideko_rest_api::resources::doc::version::sidebar::CreateItemRequest {
component: sideko_rest_api::models::NewSidebarItemComponent::NewDropdownComponent(sideko_rest_api::models::NewDropdownComponent {
icon: Some("House".to_string()),
label: "string".to_string(),
type_: sideko_rest_api::models::ComponentTypeDropdownEnum::Dropdown,
..Default::default()
}),
doc_name: "my-project".to_string(),
doc_version: sideko_rest_api::models::IdOrInt::Str(
"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
),
..Default::default()
})
.await;
```
#### Response
##### Type
[SidebarItem](/src/models/sidebar_item.rs)
##### Example
```rust
SidebarItem {children: vec![], component: SidebarItemComponent::DropdownComponent(DropdownComponent {created_at: "1970-01-01T00:00:00".to_string(), default_open: true, icon: Some("House".to_string()), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), label: "string".to_string(), type_: ComponentTypeDropdownEnum::Dropdown}), created_at: "1970-01-01T00:00:00".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order: 123, parent_id: Some("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()), space_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()}
```
### Reorder Sidebar <a name="reorder"></a>
**API Endpoint**: `POST /doc_project/{doc_name}/version/{doc_version}/sidebar/reorder`
#### Parameters
| Parameter | Required | Description | Example |
| ------------- | :------: | ----------- | --------------------------------------------------------------------------------------------------------------------- |
| `doc_name` | ✓ | | `"my-project".to_string()` |
| `doc_version` | ✓ | | `IdOrInt::Str("3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string())` |
| `items` | ✓ | | `vec![ReorderSidebarItem {id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order: 123, ..Default::default()}]` |
| `space_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()
.sidebar()
.reorder(sideko_rest_api::resources::doc::version::sidebar::ReorderRequest {
items: vec![
sideko_rest_api::models::ReorderSidebarItem { id :
"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), order : 123,
..Default::default() }
],
doc_name: "my-project".to_string(),
doc_version: sideko_rest_api::models::IdOrInt::Str(
"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
),
..Default::default()
})
.await;
```
#### Response
##### Type
Vec of [SidebarItem](/src/models/sidebar_item.rs)
##### Example
```rust
vec![]
```