use conjure_http::endpoint;
/// Internal service responsible for handling creation of new users.
#[conjure_http::conjure_endpoints(
    name = "InternalUserCreationService",
    use_legacy_error_serialization
)]
pub trait InternalUserCreationService {
    /// Ensures that the user corresponding to the auth header provided exists in the database.
    /// Will do nothing if the user already exists.
    #[endpoint(
        method = PUT,
        path = "/user-creation/v1/database",
        name = "ensureDatabaseUserExists"
    )]
    fn ensure_database_user_exists(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<(), conjure_http::private::Error>;
}
/// Internal service responsible for handling creation of new users.
#[conjure_http::conjure_endpoints(
    name = "InternalUserCreationService",
    use_legacy_error_serialization
)]
pub trait AsyncInternalUserCreationService {
    /// Ensures that the user corresponding to the auth header provided exists in the database.
    /// Will do nothing if the user already exists.
    #[endpoint(
        method = PUT,
        path = "/user-creation/v1/database",
        name = "ensureDatabaseUserExists"
    )]
    async fn ensure_database_user_exists(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<(), conjure_http::private::Error>;
}
/// Internal service responsible for handling creation of new users.
#[conjure_http::conjure_endpoints(
    name = "InternalUserCreationService",
    use_legacy_error_serialization,
    local
)]
pub trait LocalAsyncInternalUserCreationService {
    /// Ensures that the user corresponding to the auth header provided exists in the database.
    /// Will do nothing if the user already exists.
    #[endpoint(
        method = PUT,
        path = "/user-creation/v1/database",
        name = "ensureDatabaseUserExists"
    )]
    async fn ensure_database_user_exists(
        &self,
        #[auth]
        auth_: conjure_object::BearerToken,
    ) -> Result<(), conjure_http::private::Error>;
}
