Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion crates/tower-api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ For more information, please visit [https://tower.dev](https://tower.dev)

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: v0.11.7
- API version: v0.11.10
- Package version: 1.0.0
- Generator version: 7.19.0
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
Expand Down Expand Up @@ -72,6 +72,7 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**describe_default_catalog**](docs/DefaultApi.md#describe_default_catalog) | **GET** /storage/catalogs/default | Describe default catalog
*DefaultApi* | [**describe_device_login_session**](docs/DefaultApi.md#describe_device_login_session) | **GET** /login/device/{device_code} | Describe device login session
*DefaultApi* | [**describe_email_preferences**](docs/DefaultApi.md#describe_email_preferences) | **GET** /user/email-preferences | Describe email preferences
*DefaultApi* | [**describe_environment**](docs/DefaultApi.md#describe_environment) | **GET** /environments/{name} | Describe environment
*DefaultApi* | [**describe_organization_usage**](docs/DefaultApi.md#describe_organization_usage) | **GET** /usage | Describe organization usage
*DefaultApi* | [**describe_plan**](docs/DefaultApi.md#describe_plan) | **GET** /plan | Describe plan
*DefaultApi* | [**describe_run**](docs/DefaultApi.md#describe_run) | **GET** /apps/{name}/runs/{seq} | Describe run
Expand Down Expand Up @@ -217,6 +218,7 @@ Class | Method | HTTP request | Description
- [DescribeCatalogResponse](docs/DescribeCatalogResponse.md)
- [DescribeDeviceLoginSessionResponse](docs/DescribeDeviceLoginSessionResponse.md)
- [DescribeEmailPreferencesBody](docs/DescribeEmailPreferencesBody.md)
- [DescribeEnvironmentResponse](docs/DescribeEnvironmentResponse.md)
- [DescribePlanResponse](docs/DescribePlanResponse.md)
- [DescribeRunGraphResponse](docs/DescribeRunGraphResponse.md)
- [DescribeRunLinks](docs/DescribeRunLinks.md)
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/apis/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
84 changes: 83 additions & 1 deletion crates/tower-api/src/apis/default_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down Expand Up @@ -309,6 +309,13 @@ pub struct DescribeDeviceLoginSessionParams {
pub device_code: String,
}

/// struct for passing parameters to the method [`describe_environment`]
#[derive(Clone, Debug)]
pub struct DescribeEnvironmentParams {
/// The name of the environment.
pub name: String,
}

/// struct for passing parameters to the method [`describe_plan`]
#[derive(Clone, Debug)]
pub struct DescribePlanParams {
Expand Down Expand Up @@ -1178,6 +1185,14 @@ pub enum DescribeEmailPreferencesSuccess {
UnknownValue(serde_json::Value),
}

/// struct for typed successes of method [`describe_environment`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DescribeEnvironmentSuccess {
Status200(models::DescribeEnvironmentResponse),
UnknownValue(serde_json::Value),
}

/// struct for typed successes of method [`describe_organization_usage`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down Expand Up @@ -2062,6 +2077,14 @@ pub enum DescribeEmailPreferencesError {
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`describe_environment`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
pub enum DescribeEnvironmentError {
DefaultResponse(models::ErrorModel),
UnknownValue(serde_json::Value),
}

/// struct for typed errors of method [`describe_organization_usage`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down Expand Up @@ -5247,6 +5270,65 @@ pub async fn describe_email_preferences(
}
}

/// Describe an environment and counts of its resources
pub async fn describe_environment(
configuration: &configuration::Configuration,
params: DescribeEnvironmentParams,
) -> Result<ResponseContent<DescribeEnvironmentSuccess>, Error<DescribeEnvironmentError>> {
let uri_str = format!(
"{}/environments/{name}",
configuration.base_path,
name = crate::apis::urlencode(params.name)
);
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());
};
if let Some(ref apikey) = configuration.api_key {
let key = apikey.key.clone();
let value = match apikey.prefix {
Some(ref prefix) => format!("{} {}", prefix, key),
None => key,
};
req_builder = req_builder.header("X-API-Key", value);
};

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

let status = resp.status();

let tower_trace_id = resp
.headers()
.get("x-tower-trace-id")
.and_then(|v| v.to_str().ok())
.map_or(String::from(DEFAULT_TOWER_TRACE_ID), String::from);

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

/// Describe usage statistics for the user's organization for the current billing cycle.
pub async fn describe_organization_usage(
configuration: &configuration::Configuration,
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/apis/feature_flags_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/acknowledge_alert_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/alert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/api_key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/api_key_owner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/app_statistics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/app_summary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/app_version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/authentication_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/batch_schedule_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/batch_schedule_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/cancel_run_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/catalog_credentials.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/catalog_property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/create_account_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/create_account_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/create_api_key_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/create_api_key_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/create_app_params.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
2 changes: 1 addition & 1 deletion crates/tower-api/src/models/create_app_response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.11.7
* The version of the OpenAPI document: v0.11.10
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
Loading
Loading