Skip to content

Commit fb78ea4

Browse files
committed
Change layout of rust struct/imports/func params to vertical
1 parent 1cc992c commit fb78ea4

File tree

251 files changed

+4666
-1399
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

251 files changed

+4666
-1399
lines changed

rust/.rustfmt.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
wrap_comments = true
22
imports_granularity = "Crate"
3+
fn_params_layout = "Vertical"
4+
struct_lit_width = 0
5+
imports_layout = "Vertical"
6+
fn_call_width = 0

rust/src/api/application.rs

Lines changed: 103 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
// this file is @generated
2-
use crate::{error::Result, models::*, Configuration};
2+
use crate::{
3+
error::Result,
4+
models::*,
5+
Configuration,
6+
};
37

48
#[derive(Default)]
59
pub struct ApplicationListOptions {
@@ -24,7 +28,9 @@ pub struct Application<'a> {
2428

2529
impl<'a> Application<'a> {
2630
pub(super) fn new(cfg: &'a Configuration) -> Self {
27-
Self { cfg }
31+
Self {
32+
cfg,
33+
}
2834
}
2935

3036
/// List of all the organization's applications.
@@ -38,12 +44,21 @@ impl<'a> Application<'a> {
3844
order,
3945
} = options.unwrap_or_default();
4046

41-
crate::request::Request::new(http1::Method::GET, "/api/v1/app")
42-
.with_optional_query_param("limit", limit)
43-
.with_optional_query_param("iterator", iterator)
44-
.with_optional_query_param("order", order)
45-
.execute(self.cfg)
46-
.await
47+
crate::request::Request::new(
48+
http1::Method::GET,
49+
"/api/v1/app",
50+
)
51+
.with_optional_query_param(
52+
"limit", limit,
53+
)
54+
.with_optional_query_param(
55+
"iterator", iterator,
56+
)
57+
.with_optional_query_param(
58+
"order", order,
59+
)
60+
.execute(self.cfg)
61+
.await
4762
}
4863

4964
/// Create a new application.
@@ -52,13 +67,21 @@ impl<'a> Application<'a> {
5267
application_in: ApplicationIn,
5368
options: Option<ApplicationCreateOptions>,
5469
) -> Result<ApplicationOut> {
55-
let ApplicationCreateOptions { idempotency_key } = options.unwrap_or_default();
70+
let ApplicationCreateOptions {
71+
idempotency_key,
72+
} = options.unwrap_or_default();
5673

57-
crate::request::Request::new(http1::Method::POST, "/api/v1/app")
58-
.with_optional_header_param("idempotency-key", idempotency_key)
59-
.with_body_param(application_in)
60-
.execute(self.cfg)
61-
.await
74+
crate::request::Request::new(
75+
http1::Method::POST,
76+
"/api/v1/app",
77+
)
78+
.with_optional_header_param(
79+
"idempotency-key",
80+
idempotency_key,
81+
)
82+
.with_body_param(application_in)
83+
.execute(self.cfg)
84+
.await
6285
}
6386

6487
/// Create the application with the given ID, or create a new one if it
@@ -68,22 +91,41 @@ impl<'a> Application<'a> {
6891
application_in: ApplicationIn,
6992
options: Option<ApplicationCreateOptions>,
7093
) -> Result<ApplicationOut> {
71-
let ApplicationCreateOptions { idempotency_key } = options.unwrap_or_default();
72-
73-
crate::request::Request::new(http1::Method::POST, "/api/v1/app")
74-
.with_query_param("get_if_exists", "true".to_owned())
75-
.with_optional_header_param("idempotency-key", idempotency_key)
76-
.with_body_param(application_in)
77-
.execute(self.cfg)
78-
.await
94+
let ApplicationCreateOptions {
95+
idempotency_key,
96+
} = options.unwrap_or_default();
97+
98+
crate::request::Request::new(
99+
http1::Method::POST,
100+
"/api/v1/app",
101+
)
102+
.with_query_param(
103+
"get_if_exists",
104+
"true".to_owned(),
105+
)
106+
.with_optional_header_param(
107+
"idempotency-key",
108+
idempotency_key,
109+
)
110+
.with_body_param(application_in)
111+
.execute(self.cfg)
112+
.await
79113
}
80114

81115
/// Get an application.
82-
pub async fn get(&self, app_id: String) -> Result<ApplicationOut> {
83-
crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}")
84-
.with_path_param("app_id", app_id)
85-
.execute(self.cfg)
86-
.await
116+
pub async fn get(
117+
&self,
118+
app_id: String,
119+
) -> Result<ApplicationOut> {
120+
crate::request::Request::new(
121+
http1::Method::GET,
122+
"/api/v1/app/{app_id}",
123+
)
124+
.with_path_param(
125+
"app_id", app_id,
126+
)
127+
.execute(self.cfg)
128+
.await
87129
}
88130

89131
/// Update an application.
@@ -92,20 +134,33 @@ impl<'a> Application<'a> {
92134
app_id: String,
93135
application_in: ApplicationIn,
94136
) -> Result<ApplicationOut> {
95-
crate::request::Request::new(http1::Method::PUT, "/api/v1/app/{app_id}")
96-
.with_path_param("app_id", app_id)
97-
.with_body_param(application_in)
98-
.execute(self.cfg)
99-
.await
137+
crate::request::Request::new(
138+
http1::Method::PUT,
139+
"/api/v1/app/{app_id}",
140+
)
141+
.with_path_param(
142+
"app_id", app_id,
143+
)
144+
.with_body_param(application_in)
145+
.execute(self.cfg)
146+
.await
100147
}
101148

102149
/// Delete an application.
103-
pub async fn delete(&self, app_id: String) -> Result<()> {
104-
crate::request::Request::new(http1::Method::DELETE, "/api/v1/app/{app_id}")
105-
.with_path_param("app_id", app_id)
106-
.returns_nothing()
107-
.execute(self.cfg)
108-
.await
150+
pub async fn delete(
151+
&self,
152+
app_id: String,
153+
) -> Result<()> {
154+
crate::request::Request::new(
155+
http1::Method::DELETE,
156+
"/api/v1/app/{app_id}",
157+
)
158+
.with_path_param(
159+
"app_id", app_id,
160+
)
161+
.returns_nothing()
162+
.execute(self.cfg)
163+
.await
109164
}
110165

111166
/// Partially update an application.
@@ -114,10 +169,15 @@ impl<'a> Application<'a> {
114169
app_id: String,
115170
application_patch: ApplicationPatch,
116171
) -> Result<ApplicationOut> {
117-
crate::request::Request::new(http1::Method::PATCH, "/api/v1/app/{app_id}")
118-
.with_path_param("app_id", app_id)
119-
.with_body_param(application_patch)
120-
.execute(self.cfg)
121-
.await
172+
crate::request::Request::new(
173+
http1::Method::PATCH,
174+
"/api/v1/app/{app_id}",
175+
)
176+
.with_path_param(
177+
"app_id", app_id,
178+
)
179+
.with_body_param(application_patch)
180+
.execute(self.cfg)
181+
.await
122182
}
123183
}

0 commit comments

Comments
 (0)