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
6 changes: 5 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.7.10
- API version: v0.7.14
- Package version: 1.0.0
- Generator version: 7.13.0
- Build package: `org.openapitools.codegen.languages.RustClientCodegen`
Expand All @@ -29,6 +29,7 @@ Class | Method | HTTP request | Description
------------ | ------------- | ------------- | -------------
*DefaultApi* | [**acknowledge_alert**](docs/DefaultApi.md#acknowledge_alert) | **POST** /alerts/{alert_seq}/acknowledge | Acknowledge alert
*DefaultApi* | [**acknowledge_all_alerts**](docs/DefaultApi.md#acknowledge_all_alerts) | **POST** /alerts/acknowledge-all | Acknowledge all alerts
*DefaultApi* | [**activate_schedules**](docs/DefaultApi.md#activate_schedules) | **PATCH** /schedules/activate | Activate multiple schedules
*DefaultApi* | [**cancel_run**](docs/DefaultApi.md#cancel_run) | **POST** /apps/{name}/runs/{seq} | Cancel run
*DefaultApi* | [**claim_device_login_ticket**](docs/DefaultApi.md#claim_device_login_ticket) | **POST** /login/device/claim | Claim a device login ticket
*DefaultApi* | [**create_account**](docs/DefaultApi.md#create_account) | **POST** /accounts | Create account
Expand All @@ -43,6 +44,7 @@ Class | Method | HTTP request | Description
*DefaultApi* | [**create_secret**](docs/DefaultApi.md#create_secret) | **POST** /secrets | Create secret
*DefaultApi* | [**create_session**](docs/DefaultApi.md#create_session) | **POST** /session | Create session
*DefaultApi* | [**create_team**](docs/DefaultApi.md#create_team) | **POST** /teams | Create team
*DefaultApi* | [**deactivate_schedules**](docs/DefaultApi.md#deactivate_schedules) | **PATCH** /schedules/deactivate | Deactivate multiple schedules
*DefaultApi* | [**delete_alert**](docs/DefaultApi.md#delete_alert) | **DELETE** /alerts/{alert_id} | Delete alert
*DefaultApi* | [**delete_api_key**](docs/DefaultApi.md#delete_api_key) | **DELETE** /api-keys | Delete API key
*DefaultApi* | [**delete_app**](docs/DefaultApi.md#delete_app) | **DELETE** /apps/{name} | Delete app
Expand Down Expand Up @@ -119,6 +121,8 @@ Class | Method | HTTP request | Description
- [AppStatistics](docs/AppStatistics.md)
- [AppSummary](docs/AppSummary.md)
- [AppVersion](docs/AppVersion.md)
- [BatchScheduleParams](docs/BatchScheduleParams.md)
- [BatchScheduleResponse](docs/BatchScheduleResponse.md)
- [CancelRunResponse](docs/CancelRunResponse.md)
- [Catalog](docs/Catalog.md)
- [CatalogProperty](docs/CatalogProperty.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.7.10
* The version of the OpenAPI document: v0.7.14
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
118 changes: 117 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.7.10
* The version of the OpenAPI document: v0.7.14
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand All @@ -23,6 +23,12 @@ pub struct AcknowledgeAlertParams {
pub alert_seq: i64
}

/// struct for passing parameters to the method [`activate_schedules`]
#[derive(Clone, Debug)]
pub struct ActivateSchedulesParams {
pub batch_schedule_params: models::BatchScheduleParams
}

/// struct for passing parameters to the method [`cancel_run`]
#[derive(Clone, Debug)]
pub struct CancelRunParams {
Expand Down Expand Up @@ -104,6 +110,12 @@ pub struct CreateTeamParams {
pub create_team_params: models::CreateTeamParams
}

/// struct for passing parameters to the method [`deactivate_schedules`]
#[derive(Clone, Debug)]
pub struct DeactivateSchedulesParams {
pub batch_schedule_params: models::BatchScheduleParams
}

/// struct for passing parameters to the method [`delete_alert`]
#[derive(Clone, Debug)]
pub struct DeleteAlertParams {
Expand Down Expand Up @@ -573,6 +585,14 @@ pub enum AcknowledgeAllAlertsSuccess {
UnknownValue(serde_json::Value),
}

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

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

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

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

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

/// struct for typed errors of method [`cancel_run`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down Expand Up @@ -1309,6 +1345,14 @@ pub enum CreateTeamError {
UnknownValue(serde_json::Value),
}

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

/// struct for typed errors of method [`delete_alert`]
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(untagged)]
Expand Down Expand Up @@ -1879,6 +1923,42 @@ pub async fn acknowledge_all_alerts(configuration: &configuration::Configuration
}
}

/// Activate multiple schedules to enable their execution.
pub async fn activate_schedules(configuration: &configuration::Configuration, params: ActivateSchedulesParams) -> Result<ResponseContent<ActivateSchedulesSuccess>, Error<ActivateSchedulesError>> {

let uri_str = format!("{}/schedules/activate", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &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());
};
req_builder = req_builder.json(&params.batch_schedule_params);

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<ActivateSchedulesSuccess> = serde_json::from_str(&content).ok();
Ok(ResponseContent { tower_trace_id, status, content, entity })
} else {
let content = resp.text().await?;
let entity: Option<ActivateSchedulesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { tower_trace_id, status, content, entity }))
}
}

/// Cancel a run
pub async fn cancel_run(configuration: &configuration::Configuration, params: CancelRunParams) -> Result<ResponseContent<CancelRunSuccess>, Error<CancelRunError>> {

Expand Down Expand Up @@ -2368,6 +2448,42 @@ pub async fn create_team(configuration: &configuration::Configuration, params: C
}
}

/// Deactivate multiple schedules to disable their execution.
pub async fn deactivate_schedules(configuration: &configuration::Configuration, params: DeactivateSchedulesParams) -> Result<ResponseContent<DeactivateSchedulesSuccess>, Error<DeactivateSchedulesError>> {

let uri_str = format!("{}/schedules/deactivate", configuration.base_path);
let mut req_builder = configuration.client.request(reqwest::Method::PATCH, &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());
};
req_builder = req_builder.json(&params.batch_schedule_params);

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<DeactivateSchedulesSuccess> = serde_json::from_str(&content).ok();
Ok(ResponseContent { tower_trace_id, status, content, entity })
} else {
let content = resp.text().await?;
let entity: Option<DeactivateSchedulesError> = serde_json::from_str(&content).ok();
Err(Error::ResponseError(ResponseContent { tower_trace_id, status, content, entity }))
}
}

/// Permanently delete an alert
pub async fn delete_alert(configuration: &configuration::Configuration, params: DeleteAlertParams) -> Result<ResponseContent<DeleteAlertSuccess>, Error<DeleteAlertError>> {

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.7.10
* The version of the OpenAPI document: v0.7.14
* 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.7.10
* The version of the OpenAPI document: v0.7.14
* 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.7.10
* The version of the OpenAPI document: v0.7.14
* 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.7.10
* The version of the OpenAPI document: v0.7.14
* 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.7.10
* The version of the OpenAPI document: v0.7.14
* 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.7.10
* The version of the OpenAPI document: v0.7.14
* 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.7.10
* The version of the OpenAPI document: v0.7.14
* 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.7.10
* The version of the OpenAPI document: v0.7.14
* 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.7.10
* The version of the OpenAPI document: v0.7.14
* 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.7.10
* The version of the OpenAPI document: v0.7.14
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
32 changes: 32 additions & 0 deletions crates/tower-api/src/models/batch_schedule_params.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* Tower API
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.7.14
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/

use crate::models;
use serde::{Deserialize, Serialize, Deserializer};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BatchScheduleParams {
/// A URL to the JSON Schema for this object.
#[serde(rename = "$schema", skip_serializing_if = "Option::is_none")]
pub schema: Option<String>,
/// The IDs of the schedules to modify
#[serde(rename = "ids")]
pub ids: Vec<String>,
}

impl BatchScheduleParams {
pub fn new(ids: Vec<String>) -> BatchScheduleParams {
BatchScheduleParams {
schema: None,
ids,
}
}
}

31 changes: 31 additions & 0 deletions crates/tower-api/src/models/batch_schedule_response.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
/*
* Tower API
*
* REST API to interact with Tower Services.
*
* The version of the OpenAPI document: v0.7.14
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/

use crate::models;
use serde::{Deserialize, Serialize, Deserializer};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BatchScheduleResponse {
/// A URL to the JSON Schema for this object.
#[serde(rename = "$schema", skip_serializing_if = "Option::is_none")]
pub schema: Option<String>,
#[serde(rename = "schedules")]
pub schedules: Vec<models::Schedule>,
}

impl BatchScheduleResponse {
pub fn new(schedules: Vec<models::Schedule>) -> BatchScheduleResponse {
BatchScheduleResponse {
schema: None,
schedules,
}
}
}

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.7.10
* The version of the OpenAPI document: v0.7.14
* 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.7.10
* The version of the OpenAPI document: v0.7.14
* Contact: hello@tower.dev
* Generated by: https://openapi-generator.tech
*/
Expand Down
Loading
Loading