sideko_rest_api 0.9.2

Rust API Client
Documentation
# doc

## Module Functions

### Delete Documentation Project <a name="delete"></a>

**API Endpoint**: `DELETE /doc_project/{doc_name}`

#### Parameters

| Parameter  | Required | Description | Example                    |
| ---------- | :------: | ----------- | -------------------------- |
| `doc_name` |    ✓     |             | `"my-project".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()
    .delete(sideko_rest_api::resources::doc::DeleteRequest {
        doc_name: "my-project".to_string(),
    })
    .await;
```

### List Documentation Projects <a name="list"></a>

**API Endpoint**: `GET /doc_project`

#### 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().list().await;
```

#### Response

##### Type

Vec of [DocProject](/src/models/doc_project.rs)

##### Example

```rust
vec![DocProject {created_at: "1970-01-01T00:00:00".to_string(), current_version: DocVersion {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(), status: DocVersionStatusEnum::Draft, version: 1}, domains: DocProjectDomains {preview: Some("string".to_string()), production: Some("string".to_string())}, id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), logos: DocProjectLogos {dark: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()}), favicon: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()}), light: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()})}, name: "string".to_string(), settings: DocProjectSettings {action_button: DocProjectActionButton {enabled: true, label: Some("string".to_string()), url: Some("http://www.example.com".to_string())}, font: DocProjectFont {base_size: 123, family: FontFamilyEnum::Inter}, metadata: DocProjectMetadata {description: Some("string".to_string()), llms_txt: true, title: Some("string".to_string())}, template: DocProjectTemplate::ModernTemplate(ModernTemplate {dark: ModernTheme {primary: "string".to_string()}, light: ModernTheme {primary: "string".to_string()}, type_: TemplateTypeModernEnum::Modern}), theme_vars: DocProjectThemeVars {dark: vec![DocProjectThemeVar {name: "string".to_string(), value: "string".to_string()}], light: vec![DocProjectThemeVar {name: "string".to_string(), value: "string".to_string()}]}}}]
```

### Get Documentation Project <a name="get"></a>

**API Endpoint**: `GET /doc_project/{doc_name}`

#### Parameters

| Parameter  | Required | Description | Example                    |
| ---------- | :------: | ----------- | -------------------------- |
| `doc_name` |    ✓     |             | `"my-project".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()
    .get(sideko_rest_api::resources::doc::GetRequest {
        doc_name: "my-project".to_string(),
    })
    .await;
```

#### Response

##### Type

[DocProject](/src/models/doc_project.rs)

##### Example

```rust
DocProject {created_at: "1970-01-01T00:00:00".to_string(), current_version: DocVersion {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(), status: DocVersionStatusEnum::Draft, version: 1}, domains: DocProjectDomains {preview: Some("string".to_string()), production: Some("string".to_string())}, id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), logos: DocProjectLogos {dark: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()}), favicon: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()}), light: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()})}, name: "string".to_string(), settings: DocProjectSettings {action_button: DocProjectActionButton {enabled: true, label: Some("string".to_string()), url: Some("http://www.example.com".to_string())}, font: DocProjectFont {base_size: 123, family: FontFamilyEnum::Inter}, metadata: DocProjectMetadata {description: Some("string".to_string()), llms_txt: true, title: Some("string".to_string())}, template: DocProjectTemplate::ModernTemplate(ModernTemplate {dark: ModernTheme {primary: "string".to_string()}, light: ModernTheme {primary: "string".to_string()}, type_: TemplateTypeModernEnum::Modern}), theme_vars: DocProjectThemeVars {dark: vec![DocProjectThemeVar {name: "string".to_string(), value: "string".to_string()}], light: vec![DocProjectThemeVar {name: "string".to_string(), value: "string".to_string()}]}}}
```

### Check Preview Access <a name="check_preview"></a>

A simple check to see if the requesting user has access to the preview doc project

**API Endpoint**: `GET /doc_project/{doc_name}/preview`

#### Parameters

| Parameter  | Required | Description                                                  | Example                                                     |
| ---------- | :------: | ------------------------------------------------------------ | ----------------------------------------------------------- |
| `doc_name` |    ✓     |                                                              | `"my-project".to_string()`                                  |
| `pathname` |    ✗     | relative path within docgen site requesting view permissions | `"%2Freferences%my-api%2Fmy-get-documentation".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()
    .check_preview(sideko_rest_api::resources::doc::CheckPreviewRequest {
        doc_name: "my-project".to_string(),
        ..Default::default()
    })
    .await;
```

### Update Documentation Project <a name="patch"></a>

**API Endpoint**: `PATCH /doc_project/{doc_name}`

#### Parameters

| Parameter          | Required | Description            | Example                                                                                                                                                                                             |
| ------------------ | :------: | ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `doc_name`         |    ✓     |                        | `"my-project".to_string()`                                                                                                                                                                          |
| `logos`            |    ✗     |                        | `UpdateDocProjectLogos {..Default::default()}`                                                                                                                                                      |
| `└─ dark`          |    ✗     | asset id of dark logo  | `"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()`                                                                                                                                                |
| `└─ favicon`       |    ✗     | asset id of favicon    | `"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()`                                                                                                                                                |
| `└─ light`         |    ✗     | asset id of light logo | `"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()`                                                                                                                                                |
| `name`             |    ✗     |                        | `"my-company-docs".to_string()`                                                                                                                                                                     |
| `settings`         |    ✗     |                        | `UpdateDocProjectSettings {..Default::default()}`                                                                                                                                                   |
| `└─ action_button` |    ✗     |                        | `UpdateDocProjectSettingsActionButton {..Default::default()}`                                                                                                                                       |
| `└─ font`          |    ✗     |                        | `DocProjectFont {base_size: 123, family: FontFamilyEnum::Inter}`                                                                                                                                    |
| `└─ metadata`      |    ✗     |                        | `UpdateDocProjectSettingsMetadata {..Default::default()}`                                                                                                                                           |
| `└─ template`      |    ✗     |                        | `DocProjectTemplate::ModernTemplate(ModernTemplate {dark: ModernTheme {primary: "string".to_string()}, light: ModernTheme {primary: "string".to_string()}, type_: TemplateTypeModernEnum::Modern})` |

#### 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()
    .patch(sideko_rest_api::resources::doc::PatchRequest {
        name: Some("my-company-docs".to_string()),
        doc_name: "my-project".to_string(),
        ..Default::default()
    })
    .await;
```

#### Response

##### Type

[DocProject](/src/models/doc_project.rs)

##### Example

```rust
DocProject {created_at: "1970-01-01T00:00:00".to_string(), current_version: DocVersion {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(), status: DocVersionStatusEnum::Draft, version: 1}, domains: DocProjectDomains {preview: Some("string".to_string()), production: Some("string".to_string())}, id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), logos: DocProjectLogos {dark: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()}), favicon: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()}), light: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()})}, name: "string".to_string(), settings: DocProjectSettings {action_button: DocProjectActionButton {enabled: true, label: Some("string".to_string()), url: Some("http://www.example.com".to_string())}, font: DocProjectFont {base_size: 123, family: FontFamilyEnum::Inter}, metadata: DocProjectMetadata {description: Some("string".to_string()), llms_txt: true, title: Some("string".to_string())}, template: DocProjectTemplate::ModernTemplate(ModernTemplate {dark: ModernTheme {primary: "string".to_string()}, light: ModernTheme {primary: "string".to_string()}, type_: TemplateTypeModernEnum::Modern}), theme_vars: DocProjectThemeVars {dark: vec![DocProjectThemeVar {name: "string".to_string(), value: "string".to_string()}], light: vec![DocProjectThemeVar {name: "string".to_string(), value: "string".to_string()}]}}}
```

### Create Documentation Project <a name="create"></a>

**API Endpoint**: `POST /doc_project`

#### Parameters

| Parameter      | Required | Description                                                               | Example                                                                                                                                                                                             |
| -------------- | :------: | ------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `name`         |    ✓     |                                                                           | `"my-company-docs".to_string()`                                                                                                                                                                     |
| `font`         |    ✗     |                                                                           | `DocProjectFont {base_size: 123, family: FontFamilyEnum::Inter}`                                                                                                                                    |
| `└─ base_size` |    ✓     | base size (in px) of font. Headers, asides, etc. are all relative to this | `123`                                                                                                                                                                                               |
| `└─ family`    |    ✓     |                                                                           | `FontFamilyEnum::Inter`                                                                                                                                                                             |
| `template`     |    ✗     |                                                                           | `DocProjectTemplate::ModernTemplate(ModernTemplate {dark: ModernTheme {primary: "string".to_string()}, light: ModernTheme {primary: "string".to_string()}, type_: TemplateTypeModernEnum::Modern})` |

#### 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()
    .create(sideko_rest_api::resources::doc::CreateRequest {
        name: "my-company-docs".to_string(),
        ..Default::default()
    })
    .await;
```

#### Response

##### Type

[DocProject](/src/models/doc_project.rs)

##### Example

```rust
DocProject {created_at: "1970-01-01T00:00:00".to_string(), current_version: DocVersion {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(), status: DocVersionStatusEnum::Draft, version: 1}, domains: DocProjectDomains {preview: Some("string".to_string()), production: Some("string".to_string())}, id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), logos: DocProjectLogos {dark: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()}), favicon: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()}), light: Some(Asset {extension: "string".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), name: "string".to_string(), url: "http://www.example.com".to_string()})}, name: "string".to_string(), settings: DocProjectSettings {action_button: DocProjectActionButton {enabled: true, label: Some("string".to_string()), url: Some("http://www.example.com".to_string())}, font: DocProjectFont {base_size: 123, family: FontFamilyEnum::Inter}, metadata: DocProjectMetadata {description: Some("string".to_string()), llms_txt: true, title: Some("string".to_string())}, template: DocProjectTemplate::ModernTemplate(ModernTemplate {dark: ModernTheme {primary: "string".to_string()}, light: ModernTheme {primary: "string".to_string()}, type_: TemplateTypeModernEnum::Modern}), theme_vars: DocProjectThemeVars {dark: vec![DocProjectThemeVar {name: "string".to_string(), value: "string".to_string()}], light: vec![DocProjectThemeVar {name: "string".to_string(), value: "string".to_string()}]}}}
```

## Submodules

- [deployment](deployment/README.md) - deployment
- [preview](preview/README.md) - preview
- [version](version/README.md) - version