sideko_rest_api 0.9.2

Rust API Client
Documentation
# sdk

## Module Functions

### List SDKs <a name="list"></a>

**API Endpoint**: `GET /sdk`

#### Parameters

| Parameter     | Required | Description                      | Example                                              |
| ------------- | :------: | -------------------------------- | ---------------------------------------------------- |
| `api_name`    || Filter by API name or ID (uuid)  | `"my-project".to_string()`                           |
| `api_version` || Filter by API Version ID (uuid)  | `"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()` |
| `successful`  || Filter by SDK generation success | `true`                                               |

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

#### Response

##### Type

Vec of [SdkGeneration](/src/models/sdk_generation.rs)

##### Example

```rust
vec![SdkGeneration {api_version_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), created_at: "1970-01-01T00:00:00".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), language: SdkLanguageEnum::Csharp, name: "my_sdk_py".to_string(), released: true, repo_url: Some("https://github.com/sideko-inc/sideko".to_string()), successful: true, version: "0.1.0".to_string()}]
```

### Generate SDK <a name="generate"></a>

**API Endpoint**: `POST /sdk`

#### Parameters

| Parameter           | Required | Deprecated | Description                                                                   | Example                                                 |
| ------------------- | :------: | :--------: | ----------------------------------------------------------------------------- | ------------------------------------------------------- |
| `config`            |||                                                                               | `UploadFile::from_path("uploads/config.yaml").unwrap()` |
| `language`          |||                                                                               | `SdkLanguageEnum::Csharp`                               |
| `allow_lint_errors` ||| force generate the SDK even if there are linting errors                       | `true`                                                  |
| `api_version`       |||                                                                               | `ApiVersion::VersionTypeEnum(VersionTypeEnum::Latest)`  |
| `github_actions`    ||| Deprecated, will have no effect. Use `sync_github_actions` in the SKD config. | `true`                                                  |
| `sdk_version`       |||                                                                               | `"0.1.0".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
    .sdk()
    .generate(sideko_rest_api::resources::sdk::GenerateRequest {
        config: sideko_rest_api::UploadFile::from_path("uploads/config.yaml")
            .unwrap(),
        language: sideko_rest_api::models::SdkLanguageEnum::Csharp,
        ..Default::default()
    })
    .await;
```

### Generate an SDK and automatically push to the linked version control system <a name="generate_and_push"></a>

**API Endpoint**: `POST /sdk/repo`

#### Parameters

| Parameter           | Required | Deprecated | Description                                                                   | Example                                                 |
| ------------------- | :------: | :--------: | ----------------------------------------------------------------------------- | ------------------------------------------------------- |
| `config`            |||                                                                               | `UploadFile::from_path("uploads/config.yaml").unwrap()` |
| `language`          |||                                                                               | `SdkLanguageEnum::Csharp`                               |
| `repo_name`         |||                                                                               | `"string".to_string()`                                  |
| `allow_lint_errors` ||| force generate the SDK even if there are linting errors                       | `true`                                                  |
| `api_version`       |||                                                                               | `ApiVersion::VersionTypeEnum(VersionTypeEnum::Latest)`  |
| `github_actions`    ||| Deprecated, will have no effect. Use `sync_github_actions` in the SKD config. | `true`                                                  |
| `sdk_version`       |||                                                                               | `"0.1.0".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
    .sdk()
    .generate_and_push(sideko_rest_api::resources::sdk::GenerateAndPushRequest {
        config: sideko_rest_api::UploadFile::from_path("uploads/config.yaml")
            .unwrap(),
        language: sideko_rest_api::models::SdkLanguageEnum::Csharp,
        repo_name: "string".to_string(),
        ..Default::default()
    })
    .await;
```

#### Response

##### Type

[SdkGeneration](/src/models/sdk_generation.rs)

##### Example

```rust
SdkGeneration {api_version_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), created_at: "1970-01-01T00:00:00".to_string(), id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(), language: SdkLanguageEnum::Csharp, name: "my_sdk_py".to_string(), released: true, repo_url: Some("https://github.com/sideko-inc/sideko".to_string()), successful: true, version: "0.1.0".to_string()}
```

### Update SDK <a name="update"></a>

**API Endpoint**: `POST /sdk/update`

#### Parameters

| Parameter           | Required | Description                                             | Example                                                 |
| ------------------- | :------: | ------------------------------------------------------- | ------------------------------------------------------- |
| `config`            ||                                                         | `UploadFile::from_path("uploads/config.yaml").unwrap()` |
| `prev_sdk_git`      || compressed .tar.gz of .git/ directory of previous SDK   | `UploadFile::from_path("uploads/git.tar.gz").unwrap()`  |
| `prev_sdk_id`       ||                                                         | `"3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string()`    |
| `allow_lint_errors` || force generate the SDK even if there are linting errors | `true`                                                  |
| `api_version`       ||                                                         | `ApiVersion::VersionTypeEnum(VersionTypeEnum::Latest)`  |
| `sdk_version`       ||                                                         | `VersionOrBump::VersionBumpEnum(VersionBumpEnum::Auto)` |

#### 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
    .sdk()
    .update(sideko_rest_api::resources::sdk::UpdateRequest {
        config: sideko_rest_api::UploadFile::from_path("uploads/config.yaml")
            .unwrap(),
        prev_sdk_git: sideko_rest_api::UploadFile::from_path("uploads/git.tar.gz")
            .unwrap(),
        prev_sdk_id: "3e4666bf-d5e5-4aa7-b8ce-cefe41c7568a".to_string(),
        ..Default::default()
    })
    .await;
```

## Submodules

- [config]config/README.md - config
- [doc]doc/README.md - doc
- [metadata]metadata/README.md - metadata