sideko_rest_api 0.9.2

Rust API Client
Documentation
# doc.deployment

## Module Functions

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

Retrieves all deployments for a doc project

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

#### Parameters

| Parameter  | Required | Description | Example                         |
| ---------- | :------: | ----------- | ------------------------------- |
| `doc_name` |    ✓     |             | `"my-project".to_string()`      |
| `limit`    |    ✗     |             | `123`                           |
| `target`   |    ✗     |             | `DeploymentTargetEnum::Preview` |

#### 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()
    .deployment()
    .list(sideko_rest_api::resources::doc::deployment::ListRequest {
        doc_name: "my-project".to_string(),
        ..Default::default()
    })
    .await;
```

#### Response

##### Type

Vec of [Deployment](/src/models/deployment.rs)

##### Example

```rust
vec![Deployment {created_at: "1970-01-01T00:00:00".to_string(), current_preview: true, current_prod: true, doc_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}, id: "string".to_string(), metadata: std::collections::HashMap::<String, serde_json::Value>::new(), status: DeploymentStatusEnum::Building, target: DeploymentTargetEnum::Preview}]
```

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

Retrieves single deployment

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

#### Parameters

| Parameter       | Required | Description | Example                                              |
| --------------- | :------: | ----------- | ---------------------------------------------------- |
| `deployment_id` |    ✓     |             | `"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()` |
| `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()
    .deployment()
    .get(sideko_rest_api::resources::doc::deployment::GetRequest {
        deployment_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
        doc_name: "my-project".to_string(),
    })
    .await;
```

#### Response

##### Type

[Deployment](/src/models/deployment.rs)

##### Example

```rust
Deployment {created_at: "1970-01-01T00:00:00".to_string(), current_preview: true, current_prod: true, doc_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}, id: "string".to_string(), metadata: std::collections::HashMap::<String, serde_json::Value>::new(), status: DeploymentStatusEnum::Building, target: DeploymentTargetEnum::Preview}
```

### Trigger Documentation Deployment <a name="trigger"></a>

Deploys a new generated version of documentation with guides & linked APIs

**API Endpoint**: `POST /doc_project/{doc_name}/deployment`

#### Parameters

| Parameter        | Required | Description | Example                                              |
| ---------------- | :------: | ----------- | ---------------------------------------------------- |
| `doc_name`       |    ✓     |             | `"my-project".to_string()`                           |
| `target`         |    ✓     |             | `DeploymentTargetEnum::Preview`                      |
| `doc_version_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()
    .deployment()
    .trigger(sideko_rest_api::resources::doc::deployment::TriggerRequest {
        target: sideko_rest_api::models::DeploymentTargetEnum::Preview,
        doc_name: "my-project".to_string(),
        ..Default::default()
    })
    .await;
```

#### Response

##### Type

[Deployment](/src/models/deployment.rs)

##### Example

```rust
Deployment {created_at: "1970-01-01T00:00:00".to_string(), current_preview: true, current_prod: true, doc_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}, id: "string".to_string(), metadata: std::collections::HashMap::<String, serde_json::Value>::new(), status: DeploymentStatusEnum::Building, target: DeploymentTargetEnum::Preview}
```