Skip to content

Commit

Permalink
Tembo client regen (#1142)
Browse files Browse the repository at this point in the history
  • Loading branch information
DarrenBaldwin07 authored Feb 3, 2025
1 parent 9ef6b48 commit 3ca00d8
Show file tree
Hide file tree
Showing 180 changed files with 3,010 additions and 1,406 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cargo-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
with:
contains_the_file: Cargo.toml
changed_relative_to_ref: origin/${{ github.base_ref || 'not-a-branch' }}
ignore_dirs: ".coredb examples tembo-cli/temboclient tembo-cli/tembodataclient inference-gateway"
ignore_dirs: ".coredb examples tembo-cli/tembo_api_client tembo-cli/tembodataclient inference-gateway"

lint:
name: Run linters
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions tembo-cli/temboclient/Cargo.toml → cp-client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "temboclient"
name = "tembo-api-client"
version = "1.0.4"
authors = ["OpenAPI Generator team and contributors"]
description = "Platform API for Tembo Cloud </br> </br> To find a Tembo Data API, please find it here: </br> </br> [AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) "
description = "Control Plane API client for Tembo Cloud </br> </br> To find a Tembo Data API, please find it here: </br> </br> [AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/) "
# Override this license by providing a License Object in the OpenAPI.
license = "Unlicense"
edition = "2018"
Expand Down
115 changes: 115 additions & 0 deletions cp-client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
# Rust API client for tembo_api_client

Platform API for Tembo Cloud
</br>
</br>
To find a Tembo Data API, please find it here:
</br>
</br>
[AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/)

## Overview

This API client was generated by the [OpenAPI Generator](https://openapi-generator.tech) project. By using the [openapi-spec](https://openapis.org) from a remote server, you can easily generate an API client.

- API version: v1.0.0
- Package version: v1.0.0
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`

## Installation

Put the package under your project folder in a directory named `tembo_api_client` and add the following to `Cargo.toml` under `[dependencies]`:

```
tembo_api_client = { path = "./tembo_api_client" }
```

## Documentation for API Endpoints

All URIs are relative to _http://localhost_

| Class | Method | HTTP request | Description |
| ------------- | ------------------------------------------------------------ | -------------------------------------------------------- | ---------------------------------------------------- |
| _AppApi_ | [**get_all_apps**](docs/AppApi.md#get_all_apps) | **GET** /api/v1/apps | Attributes for all apps |
| _AppApi_ | [**get_app**](docs/AppApi.md#get_app) | **GET** /api/v1/apps/{type} | Get the attributes of a single App |
| _InstanceApi_ | [**create_instance**](docs/InstanceApi.md#create_instance) | **POST** /api/v1/orgs/{org_id}/instances | Create a new Tembo instance |
| _InstanceApi_ | [**delete_instance**](docs/InstanceApi.md#delete_instance) | **DELETE** /api/v1/orgs/{org_id}/instances/{instance_id} | Delete an existing Tembo instance |
| _InstanceApi_ | [**get_all**](docs/InstanceApi.md#get_all) | **GET** /api/v1/orgs/{org_id}/instances | Get all Tembo instances in an organization |
| _InstanceApi_ | [**get_instance**](docs/InstanceApi.md#get_instance) | **GET** /api/v1/orgs/{org_id}/instances/{instance_id} | Get an existing Tembo instance |
| _InstanceApi_ | [**get_schema**](docs/InstanceApi.md#get_schema) | **GET** /api/v1/orgs/instances/schema | Get the json-schema for an instance |
| _InstanceApi_ | [**instance_event**](docs/InstanceApi.md#instance_event) | **POST** /api/v1/orgs/{org_id}/instances/{instance_id} | Lifecycle events for a Tembo instance |
| _InstanceApi_ | [**patch_instance**](docs/InstanceApi.md#patch_instance) | **PATCH** /api/v1/orgs/{org_id}/instances/{instance_id} | Update attributes on an existing Tembo instance |
| _InstanceApi_ | [**put_instance**](docs/InstanceApi.md#put_instance) | **PUT** /api/v1/orgs/{org_id}/instances/{instance_id} | Replace all attributes of an existing Tembo instance |
| _InstanceApi_ | [**restore_instance**](docs/InstanceApi.md#restore_instance) | **POST** /api/v1/orgs/{org_id}/restore | Restore a Tembo instance |
| _StackApi_ | [**get_all_entities**](docs/StackApi.md#get_all_entities) | **GET** /api/v1/stacks | Attributes for all stacks |
| _StackApi_ | [**get_entity**](docs/StackApi.md#get_entity) | **GET** /api/v1/stacks/{type} | Get the attributes of a single stack |

## Documentation For Models

- [AppConfig](docs/AppConfig.md)
- [AppService](docs/AppService.md)
- [AppType](docs/AppType.md)
- [AppTypeOneOf](docs/AppTypeOneOf.md)
- [AppTypeOneOf1](docs/AppTypeOneOf1.md)
- [AppTypeOneOf2](docs/AppTypeOneOf2.md)
- [AppTypeOneOf3](docs/AppTypeOneOf3.md)
- [AppTypeOneOf4](docs/AppTypeOneOf4.md)
- [AppTypeOneOf5](docs/AppTypeOneOf5.md)
- [ConnectionInfo](docs/ConnectionInfo.md)
- [ConnectionPooler](docs/ConnectionPooler.md)
- [Cpu](docs/Cpu.md)
- [CreateInstance](docs/CreateInstance.md)
- [EnvVar](docs/EnvVar.md)
- [EnvVarRef](docs/EnvVarRef.md)
- [Environment](docs/Environment.md)
- [ErrorResponseSchema](docs/ErrorResponseSchema.md)
- [Extension](docs/Extension.md)
- [ExtensionInstallLocation](docs/ExtensionInstallLocation.md)
- [ExtensionInstallLocationStatus](docs/ExtensionInstallLocationStatus.md)
- [ExtensionStatus](docs/ExtensionStatus.md)
- [HeaderConfig](docs/HeaderConfig.md)
- [Infrastructure](docs/Infrastructure.md)
- [Ingress](docs/Ingress.md)
- [IngressType](docs/IngressType.md)
- [Instance](docs/Instance.md)
- [InstanceEvent](docs/InstanceEvent.md)
- [IntOrString](docs/IntOrString.md)
- [IntOrStringOneOf](docs/IntOrStringOneOf.md)
- [IntOrStringOneOf1](docs/IntOrStringOneOf1.md)
- [Memory](docs/Memory.md)
- [Middleware](docs/Middleware.md)
- [MiddlewareOneOf](docs/MiddlewareOneOf.md)
- [MiddlewareOneOf1](docs/MiddlewareOneOf1.md)
- [MiddlewareOneOf2](docs/MiddlewareOneOf2.md)
- [PatchInstance](docs/PatchInstance.md)
- [PgBouncer](docs/PgBouncer.md)
- [PgConfig](docs/PgConfig.md)
- [PoolerPgbouncerPoolMode](docs/PoolerPgbouncerPoolMode.md)
- [PoolerTemplateSpecContainersResources](docs/PoolerTemplateSpecContainersResources.md)
- [PoolerTemplateSpecContainersResourcesClaims](docs/PoolerTemplateSpecContainersResourcesClaims.md)
- [Probe](docs/Probe.md)
- [Probes](docs/Probes.md)
- [ReplacePathRegexConfig](docs/ReplacePathRegexConfig.md)
- [ReplacePathRegexConfigType](docs/ReplacePathRegexConfigType.md)
- [Resource](docs/Resource.md)
- [ResourceRequirements](docs/ResourceRequirements.md)
- [Restore](docs/Restore.md)
- [RestoreInstance](docs/RestoreInstance.md)
- [Routing](docs/Routing.md)
- [StackType](docs/StackType.md)
- [State](docs/State.md)
- [Storage](docs/Storage.md)
- [StorageConfig](docs/StorageConfig.md)
- [StripPrefixConfig](docs/StripPrefixConfig.md)
- [TrunkInstall](docs/TrunkInstall.md)
- [TrunkInstallStatus](docs/TrunkInstallStatus.md)
- [UpdateInstance](docs/UpdateInstance.md)
- [VolumeMount](docs/VolumeMount.md)

To get access to the crate's generated documentation, use:

```
cargo doc --open
```

## Author
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
113 changes: 113 additions & 0 deletions cp-client/src/apis/ai_api.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
/*
* Tembo Cloud
*
* Platform API for Tembo Cloud </br> </br> To find a Tembo Data API, please find it here: </br> </br> [AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/)
*
* The version of the OpenAPI document: v1.0.0
*
* Generated by: https://openapi-generator.tech
*/

use super::{configuration, Error};
use crate::{apis::ResponseContent, models};
use reqwest;
use serde::{Deserialize, Serialize};

/// struct for typed errors of method [`ask`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum AskError {
Status400(serde_json::Value),
Status401(models::ErrorResponseSchema),
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`search`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum SearchError {
Status400(serde_json::Value),
Status401(models::ErrorResponseSchema),
UnknownValue(serde_json::Value),
}

/// Ask a question to Tembo Docs
pub async fn ask(
configuration: &configuration::Configuration,
query: &str,
) -> Result<models::AskResult, Error<AskError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query = query;

let uri_str = format!("{}/api/v1/ask/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

req_builder = req_builder.query(&[("query", &p_query.to_string())]);
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

let status = resp.status();

if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
serde_json::from_str(&content).map_err(Error::from)
} else {
let content = resp.text().await?;
let entity: Option<AskError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}

/// Search Tembo Docs Database
pub async fn search(
configuration: &configuration::Configuration,
query: &str,
limit: Option<i32>,
) -> Result<models::SearchResponse, Error<SearchError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_query = query;
let p_limit = limit;

let uri_str = format!("{}/api/v1/search/", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

req_builder = req_builder.query(&[("query", &p_query.to_string())]);
if let Some(ref param_value) = p_limit {
req_builder = req_builder.query(&[("limit", &param_value.to_string())]);
}
if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

let status = resp.status();

if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
serde_json::from_str(&content).map_err(Error::from)
} else {
let content = resp.text().await?;
let entity: Option<SearchError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
101 changes: 101 additions & 0 deletions cp-client/src/apis/app_api.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
/*
* Tembo Cloud
*
* Platform API for Tembo Cloud </br> </br> To find a Tembo Data API, please find it here: </br> </br> [AWS US East 1](https://api.data-1.use1.tembo.io/swagger-ui/)
*
* The version of the OpenAPI document: v1.0.0
*
* Generated by: https://openapi-generator.tech
*/

use super::{configuration, Error};
use crate::{apis::ResponseContent, models};
use reqwest;
use serde::{Deserialize, Serialize};

/// struct for typed errors of method [`get_all_apps`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetAllAppsError {
Status401(models::ErrorResponseSchema),
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`get_app`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum GetAppError {
Status400(serde_json::Value),
Status401(models::ErrorResponseSchema),
UnknownValue(serde_json::Value),
}

/// Attributes for all apps
pub async fn get_all_apps(
configuration: &configuration::Configuration,
) -> Result<Vec<serde_json::Value>, Error<GetAllAppsError>> {
let uri_str = format!("{}/api/v1/apps", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

let status = resp.status();

if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
serde_json::from_str(&content).map_err(Error::from)
} else {
let content = resp.text().await?;
let entity: Option<GetAllAppsError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}

/// Get the attributes of a single App
pub async fn get_app(
configuration: &configuration::Configuration,
r#type: &str,
) -> Result<serde_json::Value, Error<GetAppError>> {
// add a prefix to parameters to efficiently prevent name collisions
let p_type = r#type;

let uri_str = format!("{}/api/v1/apps/{type}", configuration.base_path, type=crate::apis::urlencode(p_type));
let mut req_builder = configuration.client.request(reqwest::Method::GET, &uri_str);

if let Some(ref user_agent) = configuration.user_agent {
req_builder = req_builder.header(reqwest::header::USER_AGENT, user_agent.clone());
}
if let Some(ref token) = configuration.bearer_access_token {
req_builder = req_builder.bearer_auth(token.to_owned());
};

let req = req_builder.build()?;
let resp = configuration.client.execute(req).await?;

let status = resp.status();

if !status.is_client_error() && !status.is_server_error() {
let content = resp.text().await?;
serde_json::from_str(&content).map_err(Error::from)
} else {
let content = resp.text().await?;
let entity: Option<GetAppError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent {
status,
content,
entity,
}))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ pub struct Configuration {
pub oauth_access_token: Option<String>,
pub bearer_access_token: Option<String>,
pub api_key: Option<ApiKey>,
// TODO: take an oauth2 token source, similar to the go one
}

pub type BasicAuth = (String, Option<String>);
Expand Down
Loading

0 comments on commit 3ca00d8

Please sign in to comment.