nominal-api 0.1239.0

API bindings for the Nominal platform
Documentation
/// We accept an OIDC ID token issued by a trusted identity provider as proof of authentication.
/// The ID token is validated and exchanged for a Nominal access token.
/// This ID token should generally be short lived since it is fungible with a Nominal access token
/// via this endpoint. An access token, if provider, is used to get user information from the OIDC
/// userinfo endpoint. An org rid should be provided if the user is a member of multiple orgs.
#[derive(
    Debug,
    Clone,
    conjure_object::serde::Serialize,
    conjure_object::serde::Deserialize,
    PartialEq,
    Eq,
    PartialOrd,
    Ord,
    Hash
)]
#[serde(crate = "conjure_object::serde")]
#[conjure_object::private::staged_builder::staged_builder]
#[builder(crate = conjure_object::private::staged_builder, update, inline)]
pub struct GetAccessTokenRequest {
    #[builder(into)]
    #[serde(rename = "idToken")]
    id_token: String,
    #[builder(default, into)]
    #[serde(rename = "accessToken", skip_serializing_if = "Option::is_none", default)]
    access_token: Option<String>,
    #[builder(default, into)]
    #[serde(rename = "orgRid", skip_serializing_if = "Option::is_none", default)]
    org_rid: Option<super::super::authentication::api::OrgRid>,
}
impl GetAccessTokenRequest {
    /// Constructs a new instance of the type.
    #[inline]
    pub fn new(id_token: impl Into<String>) -> Self {
        Self::builder().id_token(id_token).build()
    }
    #[inline]
    pub fn id_token(&self) -> &str {
        &*self.id_token
    }
    #[inline]
    pub fn access_token(&self) -> Option<&str> {
        self.access_token.as_ref().map(|o| &**o)
    }
    #[inline]
    pub fn org_rid(&self) -> Option<&super::super::authentication::api::OrgRid> {
        self.org_rid.as_ref().map(|o| &*o)
    }
}