pub struct OAuthGrant {
pub created_at: DateTime<Utc>,
pub grant_type: OAuthGrantGrantType,
pub id: String,
pub last_used_at: DateTime<Utc>,
}Expand description
An active OAuth grant representing an authorized session.
JSON schema
{
"title": "OAuthGrant",
"description": "An active OAuth grant representing an authorized
session.",
"examples": [
{
"created_at": "2026-05-30T12:00:00.000Z",
"grant_type": "device_code",
"id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4",
"last_used_at": "2026-06-01T09:30:00.000Z"
}
],
"type": "object",
"required": [
"created_at",
"grant_type",
"id",
"last_used_at"
],
"properties": {
"created_at": {
"description": "When the grant was first created.",
"type": "string",
"format": "date-time"
},
"grant_type": {
"description": "The OAuth grant type that created this grant.",
"type": "string",
"enum": [
"device_code"
]
},
"id": {
"description": "The grant identifier.",
"type": "string"
},
"last_used_at": {
"description": "When the grant was last used (e.g. token
refreshed).",
"type": "string",
"format": "date-time"
}
},
"x-stainless-model": "oauth.oauth_grant"
}Fields§
§created_at: DateTime<Utc>When the grant was first created.
grant_type: OAuthGrantGrantTypeThe OAuth grant type that created this grant.
id: StringThe grant identifier.
last_used_at: DateTime<Utc>When the grant was last used (e.g. token refreshed).
Trait Implementations§
Source§impl Clone for OAuthGrant
impl Clone for OAuthGrant
Source§fn clone(&self) -> OAuthGrant
fn clone(&self) -> OAuthGrant
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OAuthGrant
impl Debug for OAuthGrant
Source§impl<'de> Deserialize<'de> for OAuthGrant
impl<'de> Deserialize<'de> for OAuthGrant
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&OAuthGrant> for OAuthGrant
impl From<&OAuthGrant> for OAuthGrant
Source§fn from(value: &OAuthGrant) -> Self
fn from(value: &OAuthGrant) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for OAuthGrant
impl RefUnwindSafe for OAuthGrant
impl Send for OAuthGrant
impl Sync for OAuthGrant
impl Unpin for OAuthGrant
impl UnsafeUnpin for OAuthGrant
impl UnwindSafe for OAuthGrant
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more