Skip to content

Commit a2bec1a

Browse files
committed
api_resource_id
1 parent 22a33be commit a2bec1a

File tree

28 files changed

+117
-84
lines changed

28 files changed

+117
-84
lines changed

lib/api_organizations/src/allowed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bencher_endpoint::{CorsResponse, Endpoint, Get, ResponseOk};
2-
use bencher_json::{JsonAllowed, ResourceId, organization::OrganizationPermission};
2+
use bencher_json::{JsonAllowed, OrganizationResourceId, organization::OrganizationPermission};
33
use bencher_schema::{
44
conn_lock,
55
context::ApiContext,
@@ -15,7 +15,7 @@ use serde::Deserialize;
1515
#[derive(Deserialize, JsonSchema)]
1616
pub struct OrgAllowedParams {
1717
/// The slug or UUID for an organization.
18-
pub organization: ResourceId,
18+
pub organization: OrganizationResourceId,
1919
/// The permission to check.
2020
pub permission: OrganizationPermission,
2121
}

lib/api_organizations/src/claim.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bencher_endpoint::{CorsResponse, Endpoint, Post, ResponseCreated};
2-
use bencher_json::{JsonNewClaim, JsonOrganization, ResourceId};
2+
use bencher_json::{JsonNewClaim, JsonOrganization, OrganizationResourceId};
33
use bencher_schema::{
44
conn_lock,
55
context::ApiContext,
@@ -15,7 +15,7 @@ use serde::Deserialize;
1515
#[derive(Deserialize, JsonSchema)]
1616
pub struct OrgClaimParams {
1717
/// The slug or UUID for an organization.
18-
pub organization: ResourceId,
18+
pub organization: OrganizationResourceId,
1919
}
2020

2121
#[endpoint {

lib/api_organizations/src/members.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use bencher_endpoint::{
33
ResponseOk, TotalCount,
44
};
55
use bencher_json::{
6-
JsonAuthAck, JsonDirection, JsonMember, JsonMembers, JsonPagination, ResourceId, Search,
7-
UserName,
6+
JsonAuthAck, JsonDirection, JsonMember, JsonMembers, JsonPagination, OrganizationResourceId,
7+
Search, UserName, UserResourceId,
88
organization::member::{JsonNewMember, JsonUpdateMember},
99
};
1010
use bencher_rbac::organization::Permission;
@@ -33,7 +33,7 @@ use slog::Logger;
3333
#[derive(Deserialize, JsonSchema)]
3434
pub struct OrgMembersParams {
3535
/// The slug or UUID for an organization.
36-
pub organization: ResourceId,
36+
pub organization: OrganizationResourceId,
3737
}
3838

3939
pub type OrgMembersPagination = JsonPagination<OrgMembersSort>;
@@ -325,9 +325,9 @@ async fn post_inner(
325325
#[derive(Deserialize, JsonSchema)]
326326
pub struct OrgMemberParams {
327327
/// The slug or UUID for an organization.
328-
pub organization: ResourceId,
328+
pub organization: OrganizationResourceId,
329329
/// The slug or UUID for an organization member.
330-
pub user: ResourceId,
330+
pub user: UserResourceId,
331331
}
332332

333333
#[endpoint {

lib/api_organizations/src/organizations.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use bencher_endpoint::{
44
};
55
use bencher_json::{
66
JsonDirection, JsonNewOrganization, JsonOrganization, JsonOrganizations, JsonPagination,
7-
ResourceId, ResourceName, Search, organization::JsonUpdateOrganization,
7+
OrganizationResourceId, ResourceName, Search, organization::JsonUpdateOrganization,
88
};
99
use bencher_rbac::organization::Permission;
1010
use bencher_schema::{
@@ -189,7 +189,7 @@ async fn post_inner(
189189
#[derive(Deserialize, JsonSchema)]
190190
pub struct OrganizationParams {
191191
/// The slug or UUID for an organization.
192-
pub organization: ResourceId,
192+
pub organization: OrganizationResourceId,
193193
}
194194

195195
#[endpoint {

lib/api_organizations/src/plan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use bencher_endpoint::{
55
CorsResponse, Delete, Endpoint, Get, Post, ResponseCreated, ResponseDeleted, ResponseOk,
66
};
77
use bencher_json::{
8-
DateTime, ResourceId,
8+
DateTime, OrganizationResourceId,
99
organization::plan::{JsonNewPlan, JsonPlan},
1010
};
1111
use bencher_rbac::organization::Permission;
@@ -34,7 +34,7 @@ use serde::Deserialize;
3434
#[derive(Deserialize, JsonSchema)]
3535
pub struct OrgPlanParams {
3636
/// The slug or UUID for an organization.
37-
pub organization: ResourceId,
37+
pub organization: OrganizationResourceId,
3838
}
3939

4040
#[endpoint {

lib/api_organizations/src/projects.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ use bencher_endpoint::{
22
CorsResponse, Endpoint, Get, Post, ResponseCreated, ResponseOk, TotalCount,
33
};
44
use bencher_json::{
5-
JsonDirection, JsonNewProject, JsonPagination, JsonProject, JsonProjects, ResourceId,
6-
ResourceName, Search,
5+
JsonDirection, JsonNewProject, JsonPagination, JsonProject, JsonProjects,
6+
OrganizationResourceId, ResourceName, Search,
77
project::measure::built_in::default::{Latency, Throughput},
88
};
99
use bencher_rbac::organization::Permission;
@@ -38,7 +38,7 @@ use slog::Logger;
3838
#[derive(Deserialize, JsonSchema)]
3939
pub struct OrgProjectsParams {
4040
/// The slug or UUID for an organization.
41-
pub organization: ResourceId,
41+
pub organization: OrganizationResourceId,
4242
}
4343

4444
pub type OrgProjectsPagination = JsonPagination<OrgProjectsSort>;

lib/api_organizations/src/usage.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::time::Duration;
44

55
use bencher_endpoint::{CorsResponse, Endpoint, Get, ResponseOk};
66
use bencher_json::{
7-
DateTime, ResourceId,
7+
DateTime, OrganizationResourceId,
88
organization::usage::{JsonUsage, UsageKind},
99
};
1010
use bencher_rbac::organization::Permission;
@@ -29,7 +29,7 @@ const DEFAULT_USAGE_HISTORY: Duration = Duration::from_secs(30 * 24 * 60 * 60);
2929
#[derive(Deserialize, JsonSchema)]
3030
pub struct OrgUsageParams {
3131
/// The slug or UUID for an organization.
32-
pub organization: ResourceId,
32+
pub organization: OrganizationResourceId,
3333
}
3434

3535
#[endpoint {

lib/api_projects/src/alerts.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use bencher_endpoint::{CorsResponse, Endpoint, Get, Patch, ResponseOk, TotalCount};
22
use bencher_json::{
3-
AlertUuid, JsonAlert, JsonAlerts, JsonDirection, JsonPagination, ResourceId,
3+
AlertUuid, JsonAlert, JsonAlerts, JsonDirection, JsonPagination, ProjectResourceId,
44
project::alert::{AlertStatus, JsonUpdateAlert},
55
};
66
use bencher_rbac::project::Permission;
@@ -28,7 +28,7 @@ use serde::Deserialize;
2828
#[derive(Deserialize, JsonSchema)]
2929
pub struct ProjAlertsParams {
3030
/// The slug or UUID for a project.
31-
pub project: ResourceId,
31+
pub project: ProjectResourceId,
3232
}
3333

3434
pub type ProjAlertsPagination = JsonPagination<ProjAlertsSort>;
@@ -283,7 +283,7 @@ type BoxedQuery<'q> = diesel::internal::table_macro::BoxedSelectStatement<
283283
#[derive(Deserialize, JsonSchema)]
284284
pub struct ProjAlertParams {
285285
/// The slug or UUID for a project.
286-
pub project: ResourceId,
286+
pub project: ProjectResourceId,
287287
/// The UUID for an alert.
288288
pub alert: AlertUuid,
289289
}

lib/api_projects/src/allowed.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use bencher_endpoint::{CorsResponse, Endpoint, Get, ResponseOk};
2-
use bencher_json::{JsonAllowed, ResourceId, project::ProjectPermission};
2+
use bencher_json::{JsonAllowed, ProjectResourceId, project::ProjectPermission};
33
use bencher_schema::{
44
conn_lock,
55
context::ApiContext,
@@ -15,7 +15,7 @@ use serde::Deserialize;
1515
#[derive(Deserialize, JsonSchema)]
1616
pub struct ProjAllowedParams {
1717
/// The slug or UUID for a project.
18-
pub project: ResourceId,
18+
pub project: ProjectResourceId,
1919
/// The permission to check.
2020
pub permission: ProjectPermission,
2121
}

lib/api_projects/src/benchmarks.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use bencher_endpoint::{
33
TotalCount,
44
};
55
use bencher_json::{
6-
BenchmarkName, JsonBenchmark, JsonBenchmarks, JsonDirection, JsonPagination, ResourceId,
7-
Search,
6+
BenchmarkName, BenchmarkResourceId, JsonBenchmark, JsonBenchmarks, JsonDirection,
7+
JsonPagination, ProjectResourceId, Search,
88
project::benchmark::{JsonNewBenchmark, JsonUpdateBenchmark},
99
};
1010
use bencher_rbac::project::Permission;
@@ -32,7 +32,7 @@ use serde::Deserialize;
3232
#[derive(Deserialize, JsonSchema)]
3333
pub struct ProjBenchmarksParams {
3434
/// The slug or UUID for a project.
35-
pub project: ResourceId,
35+
pub project: ProjectResourceId,
3636
}
3737

3838
pub type ProjBenchmarksPagination = JsonPagination<ProjBenchmarksSort>;
@@ -227,9 +227,9 @@ async fn post_inner(
227227
#[derive(Deserialize, JsonSchema)]
228228
pub struct ProjBenchmarkParams {
229229
/// The slug or UUID for a project.
230-
pub project: ResourceId,
230+
pub project: ProjectResourceId,
231231
/// The slug or UUID for a benchmark.
232-
pub benchmark: ResourceId,
232+
pub benchmark: BenchmarkResourceId,
233233
}
234234

235235
#[endpoint {

0 commit comments

Comments
 (0)