Skip to content

Commit

Permalink
rust: Format models/*
Browse files Browse the repository at this point in the history
Reduce the diff with the upcoming new codegen.
  • Loading branch information
svix-jplatte committed Jan 16, 2025
1 parent e1196a9 commit 7a004ac
Show file tree
Hide file tree
Showing 191 changed files with 5,116 additions and 4,890 deletions.
6 changes: 2 additions & 4 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@ use hyper_util::client::legacy::{connect::HttpConnector, Client as HyperClient};
pub mod api;
pub mod error;
mod model_ext;
#[allow(clippy::all)]
mod models;
mod request;
pub mod webhooks;

#[rustfmt::skip]
#[allow(dead_code, clippy::all)]
mod models;

pub struct Configuration {
pub base_path: String,
pub user_agent: Option<String>,
Expand Down
39 changes: 19 additions & 20 deletions rust/src/models/aggregate_event_types_out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,31 @@
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.1.1
*
*
* Generated by: https://openapi-generator.tech
*/

#[allow(unused_imports)]
use crate::models;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AggregateEventTypesOut {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "status")]
pub status: models::BackgroundTaskStatus,
#[serde(rename = "task")]
pub task: models::BackgroundTaskType,
}

impl AggregateEventTypesOut {
pub fn new(id: String, status: models::BackgroundTaskStatus, task: models::BackgroundTaskType) -> AggregateEventTypesOut {
AggregateEventTypesOut {
id,
status,
task,
}
}
}
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AggregateEventTypesOut {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "status")]
pub status: models::BackgroundTaskStatus,
#[serde(rename = "task")]
pub task: models::BackgroundTaskType,
}

impl AggregateEventTypesOut {
pub fn new(
id: String,
status: models::BackgroundTaskStatus,
task: models::BackgroundTaskType,
) -> AggregateEventTypesOut {
AggregateEventTypesOut { id, status, task }
}
}
52 changes: 26 additions & 26 deletions rust/src/models/app_portal_access_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,38 @@
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.1.1
*
*
* Generated by: https://openapi-generator.tech
*/

#[allow(unused_imports)]
use crate::models;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AppPortalAccessIn {
#[serde(rename = "application", skip_serializing_if = "Option::is_none")]
pub application: Option<Box<models::ApplicationIn>>,
/// How long the token will be valid for, in seconds. Valid values are between 1 hour and 7 days. The default is 7 days.
#[serde(rename = "expiry", skip_serializing_if = "Option::is_none")]
pub expiry: Option<i32>,
/// The set of feature flags the created token will have access to.
#[serde(rename = "featureFlags", skip_serializing_if = "Option::is_none")]
pub feature_flags: Option<Vec<String>>,
/// Whether the app portal should be in read-only mode.
#[serde(rename = "readOnly", skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
}

impl AppPortalAccessIn {
pub fn new() -> AppPortalAccessIn {
AppPortalAccessIn {
application: None,
expiry: None,
feature_flags: None,
read_only: None,
}
}
}
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AppPortalAccessIn {
#[serde(rename = "application", skip_serializing_if = "Option::is_none")]
pub application: Option<Box<models::ApplicationIn>>,
/// How long the token will be valid for, in seconds. Valid values are
/// between 1 hour and 7 days. The default is 7 days.
#[serde(rename = "expiry", skip_serializing_if = "Option::is_none")]
pub expiry: Option<i32>,
/// The set of feature flags the created token will have access to.
#[serde(rename = "featureFlags", skip_serializing_if = "Option::is_none")]
pub feature_flags: Option<Vec<String>>,
/// Whether the app portal should be in read-only mode.
#[serde(rename = "readOnly", skip_serializing_if = "Option::is_none")]
pub read_only: Option<bool>,
}

impl AppPortalAccessIn {
pub fn new() -> AppPortalAccessIn {
AppPortalAccessIn {
application: None,
expiry: None,
feature_flags: None,
read_only: None,
}
}
}
30 changes: 13 additions & 17 deletions rust/src/models/app_portal_access_out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,25 @@
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.1.1
*
*
* Generated by: https://openapi-generator.tech
*/

#[allow(unused_imports)]
use crate::models;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AppPortalAccessOut {
#[serde(rename = "token")]
pub token: String,
#[serde(rename = "url")]
pub url: String,
}

impl AppPortalAccessOut {
pub fn new(token: String, url: String) -> AppPortalAccessOut {
AppPortalAccessOut {
token,
url,
}
}
}
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AppPortalAccessOut {
#[serde(rename = "token")]
pub token: String,
#[serde(rename = "url")]
pub url: String,
}

impl AppPortalAccessOut {
pub fn new(token: String, url: String) -> AppPortalAccessOut {
AppPortalAccessOut { token, url }
}
}
42 changes: 21 additions & 21 deletions rust/src/models/app_usage_stats_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,33 @@
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.1.1
*
*
* Generated by: https://openapi-generator.tech
*/

#[allow(unused_imports)]
use crate::models;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AppUsageStatsIn {
/// Specific app IDs or UIDs to aggregate stats for. Note that if none of the given IDs or UIDs are resolved, a 422 response will be given.
#[serde(rename = "appIds", skip_serializing_if = "Option::is_none")]
pub app_ids: Option<Vec<String>>,
#[serde(rename = "since")]
pub since: String,
#[serde(rename = "until")]
pub until: String,
}

impl AppUsageStatsIn {
pub fn new(since: String, until: String) -> AppUsageStatsIn {
AppUsageStatsIn {
app_ids: None,
since,
until,
}
}
}
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AppUsageStatsIn {
/// Specific app IDs or UIDs to aggregate stats for. Note that if none of
/// the given IDs or UIDs are resolved, a 422 response will be given.
#[serde(rename = "appIds", skip_serializing_if = "Option::is_none")]
pub app_ids: Option<Vec<String>>,
#[serde(rename = "since")]
pub since: String,
#[serde(rename = "until")]
pub until: String,
}

impl AppUsageStatsIn {
pub fn new(since: String, until: String) -> AppUsageStatsIn {
AppUsageStatsIn {
app_ids: None,
since,
until,
}
}
}
53 changes: 29 additions & 24 deletions rust/src/models/app_usage_stats_out.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,41 @@
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.1.1
*
*
* Generated by: https://openapi-generator.tech
*/

#[allow(unused_imports)]
use crate::models;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AppUsageStatsOut {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "status")]
pub status: models::BackgroundTaskStatus,
#[serde(rename = "task")]
pub task: models::BackgroundTaskType,
/// Any app IDs or UIDs received in the request that weren't found. Stats will be produced for all the others.
#[serde(rename = "unresolvedAppIds")]
pub unresolved_app_ids: Vec<String>,
}

impl AppUsageStatsOut {
pub fn new(id: String, status: models::BackgroundTaskStatus, task: models::BackgroundTaskType, unresolved_app_ids: Vec<String>) -> AppUsageStatsOut {
AppUsageStatsOut {
id,
status,
task,
unresolved_app_ids,
}
}
}
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AppUsageStatsOut {
#[serde(rename = "id")]
pub id: String,
#[serde(rename = "status")]
pub status: models::BackgroundTaskStatus,
#[serde(rename = "task")]
pub task: models::BackgroundTaskType,
/// Any app IDs or UIDs received in the request that weren't found. Stats
/// will be produced for all the others.
#[serde(rename = "unresolvedAppIds")]
pub unresolved_app_ids: Vec<String>,
}

impl AppUsageStatsOut {
pub fn new(
id: String,
status: models::BackgroundTaskStatus,
task: models::BackgroundTaskType,
unresolved_app_ids: Vec<String>,
) -> AppUsageStatsOut {
AppUsageStatsOut {
id,
status,
task,
unresolved_app_ids,
}
}
}
47 changes: 23 additions & 24 deletions rust/src/models/application_in.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,35 @@
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.1.1
*
*
* Generated by: https://openapi-generator.tech
*/

#[allow(unused_imports)]
use crate::models;
#[allow(unused_imports)]
use serde::{Deserialize, Serialize};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ApplicationIn {
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, String>>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")]
pub rate_limit: Option<i32>,
/// Optional unique identifier for the application.
#[serde(rename = "uid", skip_serializing_if = "Option::is_none")]
pub uid: Option<String>,
}

impl ApplicationIn {
pub fn new(name: String) -> ApplicationIn {
ApplicationIn {
metadata: None,
name,
rate_limit: None,
uid: None,
}
}
}
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ApplicationIn {
#[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
pub metadata: Option<std::collections::HashMap<String, String>>,
#[serde(rename = "name")]
pub name: String,
#[serde(rename = "rateLimit", skip_serializing_if = "Option::is_none")]
pub rate_limit: Option<i32>,
/// Optional unique identifier for the application.
#[serde(rename = "uid", skip_serializing_if = "Option::is_none")]
pub uid: Option<String>,
}

impl ApplicationIn {
pub fn new(name: String) -> ApplicationIn {
ApplicationIn {
metadata: None,
name,
rate_limit: None,
uid: None,
}
}
}
Loading

0 comments on commit 7a004ac

Please sign in to comment.