1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// This file is auto-generated by oagen. Do not edit.
#[allow(unused_imports)]
use super::*;
#[allow(unused_imports)]
use crate::enums::*;
use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ConnectedAccount {
/// Distinguishes the connected account object.
pub object: String,
/// The unique identifier of the connected account.
pub id: String,
/// The [User](https://workos.com/docs/reference/authkit/user) identifier associated with this connection.
#[serde(skip_serializing_if = "Option::is_none", default)]
pub user_id: Option<String>,
/// The [Organization](https://workos.com/docs/reference/organization) identifier associated with this connection, or `null` if not scoped to an organization.
#[serde(skip_serializing_if = "Option::is_none", default)]
pub organization_id: Option<String>,
/// The OAuth scopes granted for this connection.
pub scopes: Vec<String>,
/// The authentication method used for this connection (`oauth` or `api_key`). Defaults to `oauth` if absent.
#[serde(skip_serializing_if = "Option::is_none", default)]
pub auth_method: Option<ConnectedAccountAuthMethod>,
/// The last four characters of the API key, or `null` for OAuth connections.
#[serde(skip_serializing_if = "Option::is_none", default)]
pub api_key_last_4: Option<String>,
/// The state of the connected account:
/// - `connected`: The connection is active and tokens are valid.
/// - `needs_reauthorization`: The user needs to reauthorize the connection, typically because required scopes have changed.
/// - `disconnected`: The connection has been disconnected.
pub state: ConnectedAccountState,
/// The timestamp when the connection was created.
pub created_at: String,
/// The timestamp when the connection was last updated.
pub updated_at: String,
}