Skip to main content

nominal_api/conjure/objects/authorization/
create_api_key_response.rs

1#[derive(
2    Debug,
3    Clone,
4    conjure_object::serde::Serialize,
5    conjure_object::serde::Deserialize,
6    PartialEq,
7    Eq,
8    PartialOrd,
9    Ord,
10    Hash
11)]
12#[serde(crate = "conjure_object::serde")]
13#[conjure_object::private::staged_builder::staged_builder]
14#[builder(crate = conjure_object::private::staged_builder, update, inline)]
15pub struct CreateApiKeyResponse {
16    #[builder(custom(type = super::ApiKey, convert = Box::new))]
17    #[serde(rename = "apiKeyMetadata")]
18    api_key_metadata: Box<super::ApiKey>,
19    #[builder(into)]
20    #[serde(rename = "apiKeyValue")]
21    api_key_value: String,
22}
23impl CreateApiKeyResponse {
24    /// Constructs a new instance of the type.
25    #[inline]
26    pub fn new(
27        api_key_metadata: super::ApiKey,
28        api_key_value: impl Into<String>,
29    ) -> Self {
30        Self::builder()
31            .api_key_metadata(api_key_metadata)
32            .api_key_value(api_key_value)
33            .build()
34    }
35    #[inline]
36    pub fn api_key_metadata(&self) -> &super::ApiKey {
37        &*self.api_key_metadata
38    }
39    #[inline]
40    pub fn api_key_value(&self) -> &str {
41        &*self.api_key_value
42    }
43}