Skip to content

Commit ea52a5c

Browse files
authored
Add query parameter docs and reorder some things (#1560)
2 parents e2d4672 + f1dd24c commit ea52a5c

File tree

5 files changed

+87
-46
lines changed

5 files changed

+87
-46
lines changed

rust/src/api/application.rs

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ use crate::{apis::application_api, error::Result, models::*, Configuration};
33

44
#[derive(Default)]
55
pub struct ApplicationListOptions {
6-
pub iterator: Option<String>,
6+
/// Limit the number of returned items
77
pub limit: Option<i32>,
8+
9+
/// The iterator returned from a prior invocation
10+
pub iterator: Option<String>,
11+
12+
/// The sorting order of the returned items
813
pub order: Option<Ordering>,
914
}
1015

@@ -22,15 +27,16 @@ impl<'a> Application<'a> {
2227
options: Option<ApplicationListOptions>,
2328
) -> Result<ListResponseApplicationOut> {
2429
let ApplicationListOptions {
25-
iterator,
2630
limit,
31+
iterator,
2732
order,
2833
} = options.unwrap_or_default();
34+
2935
application_api::v1_period_application_period_list(
3036
self.cfg,
3137
application_api::V1PeriodApplicationPeriodListParams {
32-
iterator,
3338
limit,
39+
iterator,
3440
order,
3541
},
3642
)
@@ -94,6 +100,14 @@ impl<'a> Application<'a> {
94100
.await
95101
}
96102

103+
pub async fn delete(&self, app_id: String) -> Result<()> {
104+
application_api::v1_period_application_period_delete(
105+
self.cfg,
106+
application_api::V1PeriodApplicationPeriodDeleteParams { app_id },
107+
)
108+
.await
109+
}
110+
97111
pub async fn patch(
98112
&self,
99113
app_id: String,
@@ -108,12 +122,4 @@ impl<'a> Application<'a> {
108122
)
109123
.await
110124
}
111-
112-
pub async fn delete(&self, app_id: String) -> Result<()> {
113-
application_api::v1_period_application_period_delete(
114-
self.cfg,
115-
application_api::V1PeriodApplicationPeriodDeleteParams { app_id },
116-
)
117-
.await
118-
}
119125
}

rust/src/api/endpoint.rs

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,33 @@ use crate::{apis::endpoint_api, error::Result, models::*, Configuration};
33

44
#[derive(Default)]
55
pub struct EndpointListOptions {
6-
pub iterator: Option<String>,
6+
/// Limit the number of returned items
77
pub limit: Option<i32>,
8-
pub order: Option<Ordering>,
9-
}
108

11-
pub struct Endpoint<'a> {
12-
cfg: &'a Configuration,
9+
/// The iterator returned from a prior invocation
10+
pub iterator: Option<String>,
11+
12+
/// The sorting order of the returned items
13+
pub order: Option<Ordering>,
1314
}
1415

1516
#[derive(Default)]
1617
pub struct EndpointStatsOptions {
18+
/// Filter the range to data starting from this date
19+
///
20+
/// RFC3339 date string.
1721
pub since: Option<String>,
22+
23+
/// Filter the range to data ending by this date
24+
///
25+
/// RFC3339 date string.
1826
pub until: Option<String>,
1927
}
2028

29+
pub struct Endpoint<'a> {
30+
cfg: &'a Configuration,
31+
}
32+
2133
impl<'a> Endpoint<'a> {
2234
pub(super) fn new(cfg: &'a Configuration) -> Self {
2335
Self { cfg }
@@ -29,17 +41,18 @@ impl<'a> Endpoint<'a> {
2941
options: Option<EndpointListOptions>,
3042
) -> Result<ListResponseEndpointOut> {
3143
let EndpointListOptions {
32-
iterator,
3344
limit,
45+
iterator,
3446
order,
3547
} = options.unwrap_or_default();
48+
3649
endpoint_api::v1_period_endpoint_period_list(
3750
self.cfg,
3851
endpoint_api::V1PeriodEndpointPeriodListParams {
3952
app_id,
40-
order,
41-
iterator,
4253
limit,
54+
iterator,
55+
order,
4356
},
4457
)
4558
.await
@@ -52,6 +65,7 @@ impl<'a> Endpoint<'a> {
5265
options: Option<PostOptions>,
5366
) -> Result<EndpointOut> {
5467
let PostOptions { idempotency_key } = options.unwrap_or_default();
68+
5569
endpoint_api::v1_period_endpoint_period_create(
5670
self.cfg,
5771
endpoint_api::V1PeriodEndpointPeriodCreateParams {
@@ -91,6 +105,17 @@ impl<'a> Endpoint<'a> {
91105
.await
92106
}
93107

108+
pub async fn delete(&self, app_id: String, endpoint_id: String) -> Result<()> {
109+
endpoint_api::v1_period_endpoint_period_delete(
110+
self.cfg,
111+
endpoint_api::V1PeriodEndpointPeriodDeleteParams {
112+
app_id,
113+
endpoint_id,
114+
},
115+
)
116+
.await
117+
}
118+
94119
pub async fn patch(
95120
&self,
96121
app_id: String,
@@ -108,17 +133,6 @@ impl<'a> Endpoint<'a> {
108133
.await
109134
}
110135

111-
pub async fn delete(&self, app_id: String, endpoint_id: String) -> Result<()> {
112-
endpoint_api::v1_period_endpoint_period_delete(
113-
self.cfg,
114-
endpoint_api::V1PeriodEndpointPeriodDeleteParams {
115-
app_id,
116-
endpoint_id,
117-
},
118-
)
119-
.await
120-
}
121-
122136
pub async fn get_secret(
123137
&self,
124138
app_id: String,

rust/src/api/event_type.rs

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,19 @@ use crate::{apis::event_type_api, error::Result, models::*, Configuration};
33

44
#[derive(Default)]
55
pub struct EventTypeListOptions {
6-
pub iterator: Option<String>,
6+
/// Limit the number of returned items
77
pub limit: Option<i32>,
8-
pub with_content: Option<bool>,
8+
9+
/// The iterator returned from a prior invocation
10+
pub iterator: Option<String>,
11+
12+
/// When `true` archived (deleted but not expunged) items are included in
13+
/// the response
914
pub include_archived: Option<bool>,
15+
16+
/// When `true` the full item (including the schema) is included in the
17+
/// response
18+
pub with_content: Option<bool>,
1019
}
1120

1221
pub struct EventType<'a> {
@@ -23,19 +32,21 @@ impl<'a> EventType<'a> {
2332
options: Option<EventTypeListOptions>,
2433
) -> Result<ListResponseEventTypeOut> {
2534
let EventTypeListOptions {
26-
iterator,
2735
limit,
28-
with_content,
36+
iterator,
2937
include_archived,
38+
with_content,
3039
} = options.unwrap_or_default();
40+
3141
event_type_api::v1_period_event_type_period_list(
3242
self.cfg,
3343
event_type_api::V1PeriodEventTypePeriodListParams {
34-
iterator,
3544
limit,
36-
with_content,
37-
include_archived,
45+
iterator,
46+
// FIXME: not included for backwards compatibility, for now
3847
order: None,
48+
include_archived,
49+
with_content,
3950
},
4051
)
4152
.await
@@ -47,6 +58,7 @@ impl<'a> EventType<'a> {
4758
options: Option<PostOptions>,
4859
) -> Result<EventTypeOut> {
4960
let PostOptions { idempotency_key } = options.unwrap_or_default();
61+
5062
event_type_api::v1_period_event_type_period_create(
5163
self.cfg,
5264
event_type_api::V1PeriodEventTypePeriodCreateParams {
@@ -112,6 +124,7 @@ impl<'a> EventType<'a> {
112124
options: Option<PostOptions>,
113125
) -> Result<EventTypeImportOpenApiOut> {
114126
let PostOptions { idempotency_key } = options.unwrap_or_default();
127+
115128
event_type_api::v1_period_event_type_period_import_openapi(
116129
self.cfg,
117130
event_type_api::V1PeriodEventTypePeriodImportOpenapiParams {

rust/src/api/integration.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,13 @@ use crate::{apis::integration_api, error::Result, models::*, Configuration};
33

44
#[derive(Default)]
55
pub struct IntegrationListOptions {
6-
pub iterator: Option<String>,
6+
/// Limit the number of returned items
77
pub limit: Option<i32>,
8+
9+
/// The iterator returned from a prior invocation
10+
pub iterator: Option<String>,
11+
12+
/// The sorting order of the returned items
813
pub order: Option<Ordering>,
914
}
1015

@@ -23,16 +28,17 @@ impl<'a> Integration<'a> {
2328
options: Option<IntegrationListOptions>,
2429
) -> Result<ListResponseIntegrationOut> {
2530
let IntegrationListOptions {
26-
iterator,
2731
limit,
32+
iterator,
2833
order,
2934
} = options.unwrap_or_default();
35+
3036
integration_api::v1_period_integration_period_list(
3137
self.cfg,
3238
integration_api::V1PeriodIntegrationPeriodListParams {
3339
app_id,
34-
iterator,
3540
limit,
41+
iterator,
3642
order,
3743
},
3844
)
@@ -46,6 +52,7 @@ impl<'a> Integration<'a> {
4652
options: Option<PostOptions>,
4753
) -> Result<IntegrationOut> {
4854
let PostOptions { idempotency_key } = options.unwrap_or_default();
55+
4956
integration_api::v1_period_integration_period_create(
5057
self.cfg,
5158
integration_api::V1PeriodIntegrationPeriodCreateParams {

rust/src/api/message.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,28 @@ impl<'a> Message<'a> {
3131
options: Option<MessageListOptions>,
3232
) -> Result<ListResponseMessageOut> {
3333
let MessageListOptions {
34-
iterator,
3534
limit,
36-
event_types,
35+
iterator,
36+
channel,
3737
before,
3838
after,
39-
channel,
4039
with_content,
4140
tag,
41+
event_types,
4242
} = options.unwrap_or_default();
43+
4344
message_api::v1_period_message_period_list(
4445
self.cfg,
4546
message_api::V1PeriodMessagePeriodListParams {
4647
app_id,
47-
iterator,
4848
limit,
49-
event_types,
49+
iterator,
50+
channel,
5051
before,
5152
after,
52-
channel,
5353
with_content,
5454
tag,
55+
event_types,
5556
},
5657
)
5758
.await

0 commit comments

Comments
 (0)