Skip to main content

nominal_api/conjure/clients/usercreation/api/
internal_user_creation_service.rs

1use conjure_http::endpoint;
2/// Internal service responsible for handling creation of new users.
3#[conjure_http::conjure_client(name = "InternalUserCreationService")]
4pub trait InternalUserCreationService<
5    #[response_body]
6    I: Iterator<
7            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
8        >,
9> {
10    /// Ensures that the user corresponding to the auth header provided exists in the database.
11    /// Will do nothing if the user already exists.
12    #[endpoint(
13        method = PUT,
14        path = "/user-creation/v1/database",
15        name = "ensureDatabaseUserExists",
16        accept = conjure_http::client::conjure::EmptyResponseDeserializer
17    )]
18    fn ensure_database_user_exists(
19        &self,
20        #[auth]
21        auth_: &conjure_object::BearerToken,
22    ) -> Result<(), conjure_http::private::Error>;
23}
24/// Internal service responsible for handling creation of new users.
25#[conjure_http::conjure_client(name = "InternalUserCreationService")]
26pub trait AsyncInternalUserCreationService<
27    #[response_body]
28    I: conjure_http::private::Stream<
29            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
30        >,
31> {
32    /// Ensures that the user corresponding to the auth header provided exists in the database.
33    /// Will do nothing if the user already exists.
34    #[endpoint(
35        method = PUT,
36        path = "/user-creation/v1/database",
37        name = "ensureDatabaseUserExists",
38        accept = conjure_http::client::conjure::EmptyResponseDeserializer
39    )]
40    async fn ensure_database_user_exists(
41        &self,
42        #[auth]
43        auth_: &conjure_object::BearerToken,
44    ) -> Result<(), conjure_http::private::Error>;
45}
46/// Internal service responsible for handling creation of new users.
47#[conjure_http::conjure_client(name = "InternalUserCreationService", local)]
48pub trait LocalAsyncInternalUserCreationService<
49    #[response_body]
50    I: conjure_http::private::Stream<
51            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
52        >,
53> {
54    /// Ensures that the user corresponding to the auth header provided exists in the database.
55    /// Will do nothing if the user already exists.
56    #[endpoint(
57        method = PUT,
58        path = "/user-creation/v1/database",
59        name = "ensureDatabaseUserExists",
60        accept = conjure_http::client::conjure::EmptyResponseDeserializer
61    )]
62    async fn ensure_database_user_exists(
63        &self,
64        #[auth]
65        auth_: &conjure_object::BearerToken,
66    ) -> Result<(), conjure_http::private::Error>;
67}