-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9ef6b48
commit 3ca00d8
Showing
180 changed files
with
3,010 additions
and
1,406 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", ¶m_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, | ||
})) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, | ||
})) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.