Skip to main content

nominal_api/conjure/clients/authorization/
internal_api_key_service.rs

1use conjure_http::endpoint;
2/// This internal-only service manages long lived api keys.e
3#[conjure_http::conjure_client(name = "InternalApiKeyService")]
4pub trait InternalApiKeyService<
5    #[response_body]
6    I: Iterator<
7            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
8        >,
9> {
10    /// Get a Nominal-issued access token from a long-lived API key. Callers should verify that
11    /// their api key is formatted properly (i.e. prefixed with "nominal_api_key") before calling this endpoint.
12    #[endpoint(
13        method = POST,
14        path = "/api-key-internal/v1/access-token",
15        name = "getAccessTokenFromApiKeyValue",
16        accept = conjure_http::client::StdResponseDeserializer
17    )]
18    fn get_access_token_from_api_key_value(
19        &self,
20        #[body(serializer = conjure_http::client::StdRequestSerializer)]
21        request: &super::super::super::objects::authorization::GetAccessTokenFromApiKeyRequest,
22    ) -> Result<
23        super::super::super::objects::authorization::GetAccessTokenResponse,
24        conjure_http::private::Error,
25    >;
26}
27/// This internal-only service manages long lived api keys.e
28#[conjure_http::conjure_client(name = "InternalApiKeyService")]
29pub trait AsyncInternalApiKeyService<
30    #[response_body]
31    I: conjure_http::private::Stream<
32            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
33        >,
34> {
35    /// Get a Nominal-issued access token from a long-lived API key. Callers should verify that
36    /// their api key is formatted properly (i.e. prefixed with "nominal_api_key") before calling this endpoint.
37    #[endpoint(
38        method = POST,
39        path = "/api-key-internal/v1/access-token",
40        name = "getAccessTokenFromApiKeyValue",
41        accept = conjure_http::client::StdResponseDeserializer
42    )]
43    async fn get_access_token_from_api_key_value(
44        &self,
45        #[body(serializer = conjure_http::client::StdRequestSerializer)]
46        request: &super::super::super::objects::authorization::GetAccessTokenFromApiKeyRequest,
47    ) -> Result<
48        super::super::super::objects::authorization::GetAccessTokenResponse,
49        conjure_http::private::Error,
50    >;
51}
52/// This internal-only service manages long lived api keys.e
53#[conjure_http::conjure_client(name = "InternalApiKeyService", local)]
54pub trait LocalAsyncInternalApiKeyService<
55    #[response_body]
56    I: conjure_http::private::Stream<
57            Item = Result<conjure_http::private::Bytes, conjure_http::private::Error>,
58        >,
59> {
60    /// Get a Nominal-issued access token from a long-lived API key. Callers should verify that
61    /// their api key is formatted properly (i.e. prefixed with "nominal_api_key") before calling this endpoint.
62    #[endpoint(
63        method = POST,
64        path = "/api-key-internal/v1/access-token",
65        name = "getAccessTokenFromApiKeyValue",
66        accept = conjure_http::client::StdResponseDeserializer
67    )]
68    async fn get_access_token_from_api_key_value(
69        &self,
70        #[body(serializer = conjure_http::client::StdRequestSerializer)]
71        request: &super::super::super::objects::authorization::GetAccessTokenFromApiKeyRequest,
72    ) -> Result<
73        super::super::super::objects::authorization::GetAccessTokenResponse,
74        conjure_http::private::Error,
75    >;
76}