Skip to content

Commit f2f1046

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

File tree

251 files changed

+2491
-683
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

+2491
-683
lines changed

rust/.rustfmt.toml

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

rust/src/api/application.rs

Lines changed: 22 additions & 6 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.
@@ -52,7 +58,9 @@ impl<'a> Application<'a> {
5258
application_in: ApplicationIn,
5359
options: Option<ApplicationCreateOptions>,
5460
) -> Result<ApplicationOut> {
55-
let ApplicationCreateOptions { idempotency_key } = options.unwrap_or_default();
61+
let ApplicationCreateOptions {
62+
idempotency_key,
63+
} = options.unwrap_or_default();
5664

5765
crate::request::Request::new(http1::Method::POST, "/api/v1/app")
5866
.with_optional_header_param("idempotency-key", idempotency_key)
@@ -68,7 +76,9 @@ impl<'a> Application<'a> {
6876
application_in: ApplicationIn,
6977
options: Option<ApplicationCreateOptions>,
7078
) -> Result<ApplicationOut> {
71-
let ApplicationCreateOptions { idempotency_key } = options.unwrap_or_default();
79+
let ApplicationCreateOptions {
80+
idempotency_key,
81+
} = options.unwrap_or_default();
7282

7383
crate::request::Request::new(http1::Method::POST, "/api/v1/app")
7484
.with_query_param("get_if_exists", "true".to_owned())
@@ -79,7 +89,10 @@ impl<'a> Application<'a> {
7989
}
8090

8191
/// Get an application.
82-
pub async fn get(&self, app_id: String) -> Result<ApplicationOut> {
92+
pub async fn get(
93+
&self,
94+
app_id: String,
95+
) -> Result<ApplicationOut> {
8396
crate::request::Request::new(http1::Method::GET, "/api/v1/app/{app_id}")
8497
.with_path_param("app_id", app_id)
8598
.execute(self.cfg)
@@ -100,7 +113,10 @@ impl<'a> Application<'a> {
100113
}
101114

102115
/// Delete an application.
103-
pub async fn delete(&self, app_id: String) -> Result<()> {
116+
pub async fn delete(
117+
&self,
118+
app_id: String,
119+
) -> Result<()> {
104120
crate::request::Request::new(http1::Method::DELETE, "/api/v1/app/{app_id}")
105121
.with_path_param("app_id", app_id)
106122
.returns_nothing()

rust/src/api/authentication.rs

Lines changed: 30 additions & 12 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 AuthenticationAppPortalAccessOptions {
@@ -32,7 +36,9 @@ pub struct Authentication<'a> {
3236

3337
impl<'a> Authentication<'a> {
3438
pub(super) fn new(cfg: &'a Configuration) -> Self {
35-
Self { cfg }
39+
Self {
40+
cfg,
41+
}
3642
}
3743

3844
/// Use this function to get magic links (and authentication codes) for
@@ -43,7 +49,9 @@ impl<'a> Authentication<'a> {
4349
app_portal_access_in: AppPortalAccessIn,
4450
options: Option<AuthenticationAppPortalAccessOptions>,
4551
) -> Result<AppPortalAccessOut> {
46-
let AuthenticationAppPortalAccessOptions { idempotency_key } = options.unwrap_or_default();
52+
let AuthenticationAppPortalAccessOptions {
53+
idempotency_key,
54+
} = options.unwrap_or_default();
4755

4856
crate::request::Request::new(
4957
http1::Method::POST,
@@ -63,7 +71,9 @@ impl<'a> Authentication<'a> {
6371
application_token_expire_in: ApplicationTokenExpireIn,
6472
options: Option<AuthenticationExpireAllOptions>,
6573
) -> Result<()> {
66-
let AuthenticationExpireAllOptions { idempotency_key } = options.unwrap_or_default();
74+
let AuthenticationExpireAllOptions {
75+
idempotency_key,
76+
} = options.unwrap_or_default();
6777

6878
crate::request::Request::new(http1::Method::POST, "/api/v1/auth/app/{app_id}/expire-all")
6979
.with_path_param("app_id", app_id)
@@ -81,8 +91,9 @@ impl<'a> Authentication<'a> {
8191
app_id: String,
8292
options: Option<super::AuthenticationDashboardAccessOptions>,
8393
) -> Result<DashboardAccessOut> {
84-
let super::AuthenticationDashboardAccessOptions { idempotency_key } =
85-
options.unwrap_or_default();
94+
let super::AuthenticationDashboardAccessOptions {
95+
idempotency_key,
96+
} = options.unwrap_or_default();
8697

8798
crate::request::Request::new(
8899
http1::Method::POST,
@@ -97,8 +108,13 @@ impl<'a> Authentication<'a> {
97108
/// Logout an app token.
98109
///
99110
/// Trying to log out other tokens will fail.
100-
pub async fn logout(&self, options: Option<AuthenticationLogoutOptions>) -> Result<()> {
101-
let AuthenticationLogoutOptions { idempotency_key } = options.unwrap_or_default();
111+
pub async fn logout(
112+
&self,
113+
options: Option<AuthenticationLogoutOptions>,
114+
) -> Result<()> {
115+
let AuthenticationLogoutOptions {
116+
idempotency_key,
117+
} = options.unwrap_or_default();
102118

103119
crate::request::Request::new(http1::Method::POST, "/api/v1/auth/logout")
104120
.with_optional_header_param("idempotency-key", idempotency_key)
@@ -115,8 +131,9 @@ impl<'a> Authentication<'a> {
115131
stream_portal_access_in: StreamPortalAccessIn,
116132
options: Option<AuthenticationStreamPortalAccessOptions>,
117133
) -> Result<AppPortalAccessOut> {
118-
let AuthenticationStreamPortalAccessOptions { idempotency_key } =
119-
options.unwrap_or_default();
134+
let AuthenticationStreamPortalAccessOptions {
135+
idempotency_key,
136+
} = options.unwrap_or_default();
120137

121138
crate::request::Request::new(
122139
http1::Method::POST,
@@ -153,8 +170,9 @@ impl<'a> Authentication<'a> {
153170
rotate_poller_token_in: RotatePollerTokenIn,
154171
options: Option<AuthenticationRotateStreamPollerTokenOptions>,
155172
) -> Result<ApiTokenOut> {
156-
let AuthenticationRotateStreamPollerTokenOptions { idempotency_key } =
157-
options.unwrap_or_default();
173+
let AuthenticationRotateStreamPollerTokenOptions {
174+
idempotency_key,
175+
} = options.unwrap_or_default();
158176

159177
crate::request::Request::new(
160178
http1::Method::POST,

rust/src/api/background_task.rs

Lines changed: 12 additions & 3 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 BackgroundTaskListOptions {
@@ -25,7 +29,9 @@ pub struct BackgroundTask<'a> {
2529

2630
impl<'a> BackgroundTask<'a> {
2731
pub(super) fn new(cfg: &'a Configuration) -> Self {
28-
Self { cfg }
32+
Self {
33+
cfg,
34+
}
2935
}
3036

3137
/// List background tasks executed in the past 90 days.
@@ -52,7 +58,10 @@ impl<'a> BackgroundTask<'a> {
5258
}
5359

5460
/// Get a background task by ID.
55-
pub async fn get(&self, task_id: String) -> Result<BackgroundTaskOut> {
61+
pub async fn get(
62+
&self,
63+
task_id: String,
64+
) -> Result<BackgroundTaskOut> {
5665
crate::request::Request::new(http1::Method::GET, "/api/v1/background-task/{task_id}")
5766
.with_path_param("task_id", task_id)
5867
.execute(self.cfg)

rust/src/api/connector.rs

Lines changed: 19 additions & 5 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 ConnectorListOptions {
@@ -24,7 +28,9 @@ pub struct Connector<'a> {
2428

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

3036
/// List all connectors for an application.
@@ -52,7 +58,9 @@ impl<'a> Connector<'a> {
5258
connector_in: ConnectorIn,
5359
options: Option<ConnectorCreateOptions>,
5460
) -> Result<ConnectorOut> {
55-
let ConnectorCreateOptions { idempotency_key } = options.unwrap_or_default();
61+
let ConnectorCreateOptions {
62+
idempotency_key,
63+
} = options.unwrap_or_default();
5664

5765
crate::request::Request::new(http1::Method::POST, "/api/v1/connector")
5866
.with_optional_header_param("idempotency-key", idempotency_key)
@@ -62,7 +70,10 @@ impl<'a> Connector<'a> {
6270
}
6371

6472
/// Get a connector.
65-
pub async fn get(&self, connector_id: String) -> Result<ConnectorOut> {
73+
pub async fn get(
74+
&self,
75+
connector_id: String,
76+
) -> Result<ConnectorOut> {
6677
crate::request::Request::new(http1::Method::GET, "/api/v1/connector/{connector_id}")
6778
.with_path_param("connector_id", connector_id)
6879
.execute(self.cfg)
@@ -83,7 +94,10 @@ impl<'a> Connector<'a> {
8394
}
8495

8596
/// Delete a connector.
86-
pub async fn delete(&self, connector_id: String) -> Result<()> {
97+
pub async fn delete(
98+
&self,
99+
connector_id: String,
100+
) -> Result<()> {
87101
crate::request::Request::new(http1::Method::DELETE, "/api/v1/connector/{connector_id}")
88102
.with_path_param("connector_id", connector_id)
89103
.returns_nothing()

rust/src/api/endpoint.rs

Lines changed: 37 additions & 10 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 EndpointListOptions {
@@ -57,7 +61,9 @@ pub struct Endpoint<'a> {
5761

5862
impl<'a> Endpoint<'a> {
5963
pub(super) fn new(cfg: &'a Configuration) -> Self {
60-
Self { cfg }
64+
Self {
65+
cfg,
66+
}
6167
}
6268

6369
/// List the application's endpoints.
@@ -91,7 +97,9 @@ impl<'a> Endpoint<'a> {
9197
endpoint_in: EndpointIn,
9298
options: Option<EndpointCreateOptions>,
9399
) -> Result<EndpointOut> {
94-
let EndpointCreateOptions { idempotency_key } = options.unwrap_or_default();
100+
let EndpointCreateOptions {
101+
idempotency_key,
102+
} = options.unwrap_or_default();
95103

96104
crate::request::Request::new(http1::Method::POST, "/api/v1/app/{app_id}/endpoint")
97105
.with_path_param("app_id", app_id)
@@ -102,7 +110,11 @@ impl<'a> Endpoint<'a> {
102110
}
103111

104112
/// Get an endpoint.
105-
pub async fn get(&self, app_id: String, endpoint_id: String) -> Result<EndpointOut> {
113+
pub async fn get(
114+
&self,
115+
app_id: String,
116+
endpoint_id: String,
117+
) -> Result<EndpointOut> {
106118
crate::request::Request::new(
107119
http1::Method::GET,
108120
"/api/v1/app/{app_id}/endpoint/{endpoint_id}",
@@ -132,7 +144,11 @@ impl<'a> Endpoint<'a> {
132144
}
133145

134146
/// Delete an endpoint.
135-
pub async fn delete(&self, app_id: String, endpoint_id: String) -> Result<()> {
147+
pub async fn delete(
148+
&self,
149+
app_id: String,
150+
endpoint_id: String,
151+
) -> Result<()> {
136152
crate::request::Request::new(
137153
http1::Method::DELETE,
138154
"/api/v1/app/{app_id}/endpoint/{endpoint_id}",
@@ -239,7 +255,9 @@ impl<'a> Endpoint<'a> {
239255
recover_in: RecoverIn,
240256
options: Option<EndpointRecoverOptions>,
241257
) -> Result<RecoverOut> {
242-
let EndpointRecoverOptions { idempotency_key } = options.unwrap_or_default();
258+
let EndpointRecoverOptions {
259+
idempotency_key,
260+
} = options.unwrap_or_default();
243261

244262
crate::request::Request::new(
245263
http1::Method::POST,
@@ -276,7 +294,9 @@ impl<'a> Endpoint<'a> {
276294
replay_in: ReplayIn,
277295
options: Option<EndpointReplayMissingOptions>,
278296
) -> Result<ReplayOut> {
279-
let EndpointReplayMissingOptions { idempotency_key } = options.unwrap_or_default();
297+
let EndpointReplayMissingOptions {
298+
idempotency_key,
299+
} = options.unwrap_or_default();
280300

281301
crate::request::Request::new(
282302
http1::Method::POST,
@@ -319,7 +339,9 @@ impl<'a> Endpoint<'a> {
319339
endpoint_secret_rotate_in: EndpointSecretRotateIn,
320340
options: Option<EndpointRotateSecretOptions>,
321341
) -> Result<()> {
322-
let EndpointRotateSecretOptions { idempotency_key } = options.unwrap_or_default();
342+
let EndpointRotateSecretOptions {
343+
idempotency_key,
344+
} = options.unwrap_or_default();
323345

324346
crate::request::Request::new(
325347
http1::Method::POST,
@@ -342,7 +364,9 @@ impl<'a> Endpoint<'a> {
342364
event_example_in: EventExampleIn,
343365
options: Option<EndpointSendExampleOptions>,
344366
) -> Result<MessageOut> {
345-
let EndpointSendExampleOptions { idempotency_key } = options.unwrap_or_default();
367+
let EndpointSendExampleOptions {
368+
idempotency_key,
369+
} = options.unwrap_or_default();
346370

347371
crate::request::Request::new(
348372
http1::Method::POST,
@@ -363,7 +387,10 @@ impl<'a> Endpoint<'a> {
363387
endpoint_id: String,
364388
options: Option<EndpointGetStatsOptions>,
365389
) -> Result<EndpointStats> {
366-
let EndpointGetStatsOptions { since, until } = options.unwrap_or_default();
390+
let EndpointGetStatsOptions {
391+
since,
392+
until,
393+
} = options.unwrap_or_default();
367394

368395
crate::request::Request::new(
369396
http1::Method::GET,

0 commit comments

Comments
 (0)