diff --git a/.changelog-pending/2026-06-03T19-20-34-dee95fc33c4f813ac60adfa8c57d210db8183dd8.md b/.changelog-pending/2026-06-03T19-20-34-dee95fc33c4f813ac60adfa8c57d210db8183dd8.md new file mode 100644 index 00000000..3a900e4e --- /dev/null +++ b/.changelog-pending/2026-06-03T19-20-34-dee95fc33c4f813ac60adfa8c57d210db8183dd8.md @@ -0,0 +1,39 @@ +- [#105](https://github.com/workos/workos-rust/pull/105) feat(generated)!: regenerate from spec (10 changes) + + **⚠️ Breaking** + - **[api_keys](https://workos.com/docs/reference/authkit/api-keys)**: + - Made `expires_at` required in API key models + - **[directory_sync](https://workos.com/docs/reference/directory-sync)**: + - Removed model `DsyncDeactivated` + - Removed model `DsyncDeactivatedData` + - Removed model `DsyncDeactivatedDataDomain` + - Removed enum `DsyncDeactivatedDataType` + - Removed enum `DsyncDeactivatedDataState` + - **[radar](https://workos.com/docs/reference/radar)**: + - Removed `domain_sign_up_rate_limit` from `RadarStandaloneResponseControl` + - **[user_management](https://workos.com/docs/reference/authkit/user)**: + - Removed `return_to` from `RevokeSession` + + **Features** + - **[api_keys](https://workos.com/docs/reference/authkit/api-keys)**: + - Added model `ExpireApiKey` + - Added model `ApiKeyUpdated` + - Added model `ApiKeyUpdatedData` + - Added model `ApiKeyUpdatedDataOwner` + - Added model `UserApiKeyUpdatedDataOwner` + - Added model `ApiKeyUpdatedDataPreviousAttribute` + - Added endpoint `POST /api_keys/{id}/expire` + - **[audit_logs](https://workos.com/docs/reference/audit-logs)**: + - Added `Snowflake` to `AuditLogConfigurationLogStreamType` + - **[connect](https://workos.com/docs/reference/workos-connect/standalone)**: + - Added `name` to `UserObject` + - **[directory_sync](https://workos.com/docs/reference/directory-sync)**: + - Added model `DsyncTokenCreated` + - Added model `DsyncTokenCreatedData` + - Added model `DsyncTokenRevoked` + - Added model `DsyncTokenRevokedData` + - **[user_management](https://workos.com/docs/reference/authkit/user)**: + - Added `name` to user management models + - **[webhooks](https://workos.com/docs/reference/webhooks)**: + - Added `api_key.updated` to `CreateWebhookEndpointEvents` + - Added `api_key.updated` to `UpdateWebhookEndpointEvents` diff --git a/.last-synced-sha b/.last-synced-sha index ad25d3d1..99cf20f6 100644 --- a/.last-synced-sha +++ b/.last-synced-sha @@ -1 +1 @@ -cb6857d51b453e3cbdb5bf3647d3ca229dd8af65 +d8c5a7de598792b1cee18d4a9842825110e5c74a diff --git a/.oagen-manifest.json b/.oagen-manifest.json index 51bc7d82..cf6faad3 100644 --- a/.oagen-manifest.json +++ b/.oagen-manifest.json @@ -1,7 +1,7 @@ { "version": 2, "language": "rust", - "generatedAt": "2026-05-26T20:03:09.060Z", + "generatedAt": "2026-06-03T19:19:57.550Z", "files": [ "src/enums/audit_log_configuration_log_stream_state.rs", "src/enums/audit_log_configuration_log_stream_type.rs", @@ -40,8 +40,6 @@ "src/enums/directory_user_with_groups_state.rs", "src/enums/dsync_activated_data_state.rs", "src/enums/dsync_activated_data_type.rs", - "src/enums/dsync_deactivated_data_state.rs", - "src/enums/dsync_deactivated_data_type.rs", "src/enums/dsync_deleted_data_state.rs", "src/enums/dsync_deleted_data_type.rs", "src/enums/dsync_user_updated_data_state.rs", @@ -143,6 +141,10 @@ "src/models/api_key_revoked.rs", "src/models/api_key_revoked_data.rs", "src/models/api_key_revoked_data_owner.rs", + "src/models/api_key_updated.rs", + "src/models/api_key_updated_data.rs", + "src/models/api_key_updated_data_owner.rs", + "src/models/api_key_updated_data_previous_attribute.rs", "src/models/api_key_validation_response.rs", "src/models/application_credentials_list_item.rs", "src/models/assign_role.rs", @@ -322,9 +324,6 @@ "src/models/dsync_activated.rs", "src/models/dsync_activated_data.rs", "src/models/dsync_activated_data_domain.rs", - "src/models/dsync_deactivated.rs", - "src/models/dsync_deactivated_data.rs", - "src/models/dsync_deactivated_data_domain.rs", "src/models/dsync_deleted.rs", "src/models/dsync_deleted_data.rs", "src/models/dsync_group_created.rs", @@ -335,6 +334,10 @@ "src/models/dsync_group_user_added_data.rs", "src/models/dsync_group_user_removed.rs", "src/models/dsync_group_user_removed_data.rs", + "src/models/dsync_token_created.rs", + "src/models/dsync_token_created_data.rs", + "src/models/dsync_token_revoked.rs", + "src/models/dsync_token_revoked_data.rs", "src/models/dsync_user_created.rs", "src/models/dsync_user_deleted.rs", "src/models/dsync_user_updated.rs", @@ -355,6 +358,7 @@ "src/models/event_list.rs", "src/models/event_list_list_metadata.rs", "src/models/event_schema.rs", + "src/models/expire_api_key.rs", "src/models/external_auth_complete_response.rs", "src/models/feature_flag.rs", "src/models/feature_flag_owner.rs", @@ -556,6 +560,7 @@ "src/models/user_api_key_list_list_metadata.rs", "src/models/user_api_key_owner.rs", "src/models/user_api_key_revoked_data_owner.rs", + "src/models/user_api_key_updated_data_owner.rs", "src/models/user_api_key_with_value.rs", "src/models/user_api_key_with_value_owner.rs", "src/models/user_authentication_factor_enroll_response.rs", @@ -663,6 +668,10 @@ "tests/fixtures/api_key_revoked.json", "tests/fixtures/api_key_revoked_data.json", "tests/fixtures/api_key_revoked_data_owner.json", + "tests/fixtures/api_key_updated.json", + "tests/fixtures/api_key_updated_data.json", + "tests/fixtures/api_key_updated_data_owner.json", + "tests/fixtures/api_key_updated_data_previous_attribute.json", "tests/fixtures/api_key_validation_response.json", "tests/fixtures/application_credentials_list_item.json", "tests/fixtures/assign_role.json", @@ -840,9 +849,6 @@ "tests/fixtures/dsync_activated.json", "tests/fixtures/dsync_activated_data.json", "tests/fixtures/dsync_activated_data_domain.json", - "tests/fixtures/dsync_deactivated.json", - "tests/fixtures/dsync_deactivated_data.json", - "tests/fixtures/dsync_deactivated_data_domain.json", "tests/fixtures/dsync_deleted.json", "tests/fixtures/dsync_deleted_data.json", "tests/fixtures/dsync_group_created.json", @@ -853,6 +859,10 @@ "tests/fixtures/dsync_group_user_added_data.json", "tests/fixtures/dsync_group_user_removed.json", "tests/fixtures/dsync_group_user_removed_data.json", + "tests/fixtures/dsync_token_created.json", + "tests/fixtures/dsync_token_created_data.json", + "tests/fixtures/dsync_token_revoked.json", + "tests/fixtures/dsync_token_revoked_data.json", "tests/fixtures/dsync_user_created.json", "tests/fixtures/dsync_user_deleted.json", "tests/fixtures/dsync_user_updated.json", @@ -873,6 +883,7 @@ "tests/fixtures/event_list.json", "tests/fixtures/event_list_list_metadata.json", "tests/fixtures/event_schema.json", + "tests/fixtures/expire_api_key.json", "tests/fixtures/external_auth_complete_response.json", "tests/fixtures/feature_flag.json", "tests/fixtures/feature_flag_owner.json", @@ -1073,6 +1084,7 @@ "tests/fixtures/user_api_key_list_list_metadata.json", "tests/fixtures/user_api_key_owner.json", "tests/fixtures/user_api_key_revoked_data_owner.json", + "tests/fixtures/user_api_key_updated_data_owner.json", "tests/fixtures/user_api_key_with_value.json", "tests/fixtures/user_api_key_with_value_owner.json", "tests/fixtures/user_authentication_factor_enroll_response.json", @@ -1577,6 +1589,10 @@ "sdkMethod": "delete_api_key", "service": "api_keys" }, + "POST /api_keys/{id}/expire": { + "sdkMethod": "create_api_key_expire", + "service": "api_keys" + }, "GET /organizations/{organizationId}/groups": { "sdkMethod": "list_organization_groups", "service": "groups" diff --git a/src/enums/audit_log_configuration_log_stream_type.rs b/src/enums/audit_log_configuration_log_stream_type.rs index 597296e8..35f5f271 100644 --- a/src/enums/audit_log_configuration_log_stream_type.rs +++ b/src/enums/audit_log_configuration_log_stream_type.rs @@ -12,6 +12,7 @@ pub enum AuditLogConfigurationLogStreamType { GenericHttps, GoogleCloudStorage, S3, + Snowflake, Splunk, /// Wire value not recognized by this SDK version. The original /// string is preserved verbatim. WorkOS may add new enum values @@ -31,6 +32,7 @@ impl AuditLogConfigurationLogStreamType { Self::GenericHttps => "GenericHttps", Self::GoogleCloudStorage => "GoogleCloudStorage", Self::S3 => "S3", + Self::Snowflake => "Snowflake", Self::Splunk => "Splunk", Self::Unknown(s) => s.as_str(), } @@ -59,6 +61,7 @@ impl FromStr for AuditLogConfigurationLogStreamType { "GenericHttps" => Self::GenericHttps, "GoogleCloudStorage" => Self::GoogleCloudStorage, "S3" => Self::S3, + "Snowflake" => Self::Snowflake, "Splunk" => Self::Splunk, other => Self::Unknown(other.to_string()), }) diff --git a/src/enums/create_webhook_endpoint_events.rs b/src/enums/create_webhook_endpoint_events.rs index 837151a0..1314af8e 100644 --- a/src/enums/create_webhook_endpoint_events.rs +++ b/src/enums/create_webhook_endpoint_events.rs @@ -24,6 +24,7 @@ pub enum CreateWebhookEndpointEvents { AuthenticationRadarRiskDetected, ApiKeyCreated, ApiKeyRevoked, + ApiKeyUpdated, ConnectionActivated, ConnectionDeactivated, ConnectionSAMLCertificateRenewalRequired, @@ -119,6 +120,7 @@ impl CreateWebhookEndpointEvents { Self::AuthenticationRadarRiskDetected => "authentication.radar_risk_detected", Self::ApiKeyCreated => "api_key.created", Self::ApiKeyRevoked => "api_key.revoked", + Self::ApiKeyUpdated => "api_key.updated", Self::ConnectionActivated => "connection.activated", Self::ConnectionDeactivated => "connection.deactivated", Self::ConnectionSAMLCertificateRenewalRequired => { @@ -227,6 +229,7 @@ impl FromStr for CreateWebhookEndpointEvents { "authentication.radar_risk_detected" => Self::AuthenticationRadarRiskDetected, "api_key.created" => Self::ApiKeyCreated, "api_key.revoked" => Self::ApiKeyRevoked, + "api_key.updated" => Self::ApiKeyUpdated, "connection.activated" => Self::ConnectionActivated, "connection.deactivated" => Self::ConnectionDeactivated, "connection.saml_certificate_renewal_required" => { diff --git a/src/enums/dsync_deactivated_data_state.rs b/src/enums/dsync_deactivated_data_state.rs deleted file mode 100644 index c9eec3f8..00000000 --- a/src/enums/dsync_deactivated_data_state.rs +++ /dev/null @@ -1,92 +0,0 @@ -// Code generated by oagen. DO NOT EDIT. - -use serde::{Deserialize, Serialize}; -use std::fmt; -use std::str::FromStr; - -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -#[non_exhaustive] -pub enum DsyncDeactivatedDataState { - Active, - Validating, - InvalidCredentials, - Inactive, - Deleting, - /// Wire value not recognized by this SDK version. The original - /// string is preserved verbatim. WorkOS may add new enum values - /// server-side; matching on this variant lets callers handle - /// forward-compatible values without panicking. - Unknown(String), -} - -impl DsyncDeactivatedDataState { - /// Canonical wire string for this value. For [`Self::Unknown`] returns the - /// original wire value as received from the API. - #[allow(deprecated)] - pub fn as_str(&self) -> &str { - match self { - Self::Active => "active", - Self::Validating => "validating", - Self::InvalidCredentials => "invalid_credentials", - Self::Inactive => "inactive", - Self::Deleting => "deleting", - Self::Unknown(s) => s.as_str(), - } - } -} - -impl fmt::Display for DsyncDeactivatedDataState { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(self.as_str()) - } -} - -impl AsRef for DsyncDeactivatedDataState { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl FromStr for DsyncDeactivatedDataState { - type Err = std::convert::Infallible; - #[allow(deprecated)] - fn from_str(s: &str) -> Result { - Ok(match s { - "active" => Self::Active, - "validating" => Self::Validating, - "invalid_credentials" => Self::InvalidCredentials, - "inactive" => Self::Inactive, - "deleting" => Self::Deleting, - other => Self::Unknown(other.to_string()), - }) - } -} - -impl From for DsyncDeactivatedDataState { - fn from(s: String) -> Self { - // Reuse the original `String` allocation in the fallback branch. - match Self::from_str(&s) { - Ok(Self::Unknown(_)) => Self::Unknown(s), - Ok(other) => other, - } - } -} - -impl From<&str> for DsyncDeactivatedDataState { - fn from(s: &str) -> Self { - Self::from_str(s).unwrap_or_else(|_| Self::Unknown(s.to_string())) - } -} - -impl Serialize for DsyncDeactivatedDataState { - fn serialize(&self, serializer: S) -> Result { - serializer.serialize_str(self.as_str()) - } -} - -impl<'de> Deserialize<'de> for DsyncDeactivatedDataState { - fn deserialize>(deserializer: D) -> Result { - let s = String::deserialize(deserializer)?; - Ok(Self::from(s)) - } -} diff --git a/src/enums/dsync_deactivated_data_type.rs b/src/enums/dsync_deactivated_data_type.rs deleted file mode 100644 index 6cacd1e7..00000000 --- a/src/enums/dsync_deactivated_data_type.rs +++ /dev/null @@ -1,146 +0,0 @@ -// Code generated by oagen. DO NOT EDIT. - -use serde::{Deserialize, Serialize}; -use std::fmt; -use std::str::FromStr; - -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -#[non_exhaustive] -pub enum DsyncDeactivatedDataType { - AzureSCIMV20, - Bamboohr, - BreatheHr, - CezanneHr, - CyberarkSCIMV20, - FourthHr, - GenericSCIMV20, - GsuiteDirectory, - Gusto, - Hibob, - JumpCloudSCIMV20, - OktaSCIMV20, - OneloginSCIMV20, - PeopleHr, - Personio, - PingfederateSCIMV20, - RipplingSCIMV20, - Rippling, - SailpointSCIMV20, - S3, - Sftp, - SftpWorkday, - Workday, - /// Wire value not recognized by this SDK version. The original - /// string is preserved verbatim. WorkOS may add new enum values - /// server-side; matching on this variant lets callers handle - /// forward-compatible values without panicking. - Unknown(String), -} - -impl DsyncDeactivatedDataType { - /// Canonical wire string for this value. For [`Self::Unknown`] returns the - /// original wire value as received from the API. - #[allow(deprecated)] - pub fn as_str(&self) -> &str { - match self { - Self::AzureSCIMV20 => "azure scim v2.0", - Self::Bamboohr => "bamboohr", - Self::BreatheHr => "breathe hr", - Self::CezanneHr => "cezanne hr", - Self::CyberarkSCIMV20 => "cyberark scim v2.0", - Self::FourthHr => "fourth hr", - Self::GenericSCIMV20 => "generic scim v2.0", - Self::GsuiteDirectory => "gsuite directory", - Self::Gusto => "gusto", - Self::Hibob => "hibob", - Self::JumpCloudSCIMV20 => "jump cloud scim v2.0", - Self::OktaSCIMV20 => "okta scim v2.0", - Self::OneloginSCIMV20 => "onelogin scim v2.0", - Self::PeopleHr => "people hr", - Self::Personio => "personio", - Self::PingfederateSCIMV20 => "pingfederate scim v2.0", - Self::RipplingSCIMV20 => "rippling scim v2.0", - Self::Rippling => "rippling", - Self::SailpointSCIMV20 => "sailpoint scim v2.0", - Self::S3 => "s3", - Self::Sftp => "sftp", - Self::SftpWorkday => "sftp workday", - Self::Workday => "workday", - Self::Unknown(s) => s.as_str(), - } - } -} - -impl fmt::Display for DsyncDeactivatedDataType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(self.as_str()) - } -} - -impl AsRef for DsyncDeactivatedDataType { - fn as_ref(&self) -> &str { - self.as_str() - } -} - -impl FromStr for DsyncDeactivatedDataType { - type Err = std::convert::Infallible; - #[allow(deprecated)] - fn from_str(s: &str) -> Result { - Ok(match s { - "azure scim v2.0" => Self::AzureSCIMV20, - "bamboohr" => Self::Bamboohr, - "breathe hr" => Self::BreatheHr, - "cezanne hr" => Self::CezanneHr, - "cyberark scim v2.0" => Self::CyberarkSCIMV20, - "fourth hr" => Self::FourthHr, - "generic scim v2.0" => Self::GenericSCIMV20, - "gsuite directory" => Self::GsuiteDirectory, - "gusto" => Self::Gusto, - "hibob" => Self::Hibob, - "jump cloud scim v2.0" => Self::JumpCloudSCIMV20, - "okta scim v2.0" => Self::OktaSCIMV20, - "onelogin scim v2.0" => Self::OneloginSCIMV20, - "people hr" => Self::PeopleHr, - "personio" => Self::Personio, - "pingfederate scim v2.0" => Self::PingfederateSCIMV20, - "rippling scim v2.0" => Self::RipplingSCIMV20, - "rippling" => Self::Rippling, - "sailpoint scim v2.0" => Self::SailpointSCIMV20, - "s3" => Self::S3, - "sftp" => Self::Sftp, - "sftp workday" => Self::SftpWorkday, - "workday" => Self::Workday, - other => Self::Unknown(other.to_string()), - }) - } -} - -impl From for DsyncDeactivatedDataType { - fn from(s: String) -> Self { - // Reuse the original `String` allocation in the fallback branch. - match Self::from_str(&s) { - Ok(Self::Unknown(_)) => Self::Unknown(s), - Ok(other) => other, - } - } -} - -impl From<&str> for DsyncDeactivatedDataType { - fn from(s: &str) -> Self { - Self::from_str(s).unwrap_or_else(|_| Self::Unknown(s.to_string())) - } -} - -impl Serialize for DsyncDeactivatedDataType { - fn serialize(&self, serializer: S) -> Result { - serializer.serialize_str(self.as_str()) - } -} - -impl<'de> Deserialize<'de> for DsyncDeactivatedDataType { - fn deserialize>(deserializer: D) -> Result { - let s = String::deserialize(deserializer)?; - Ok(Self::from(s)) - } -} diff --git a/src/enums/mod.rs b/src/enums/mod.rs index b06c5cf0..57c1c264 100644 --- a/src/enums/mod.rs +++ b/src/enums/mod.rs @@ -37,8 +37,6 @@ pub mod directory_user_state; pub mod directory_user_with_groups_state; pub mod dsync_activated_data_state; pub mod dsync_activated_data_type; -pub mod dsync_deactivated_data_state; -pub mod dsync_deactivated_data_type; pub mod dsync_deleted_data_state; pub mod dsync_deleted_data_type; pub mod dsync_user_updated_data_state; @@ -162,8 +160,6 @@ pub use directory_user_state::*; pub use directory_user_with_groups_state::*; pub use dsync_activated_data_state::*; pub use dsync_activated_data_type::*; -pub use dsync_deactivated_data_state::*; -pub use dsync_deactivated_data_type::*; pub use dsync_deleted_data_state::*; pub use dsync_deleted_data_type::*; pub use dsync_user_updated_data_state::*; diff --git a/src/enums/radar_standalone_response_control.rs b/src/enums/radar_standalone_response_control.rs index ba236dcd..98862158 100644 --- a/src/enums/radar_standalone_response_control.rs +++ b/src/enums/radar_standalone_response_control.rs @@ -9,7 +9,6 @@ use std::str::FromStr; pub enum RadarStandaloneResponseControl { BotDetection, BruteForceAttack, - DomainSignUpRateLimit, ImpossibleTravel, RepeatSignUp, StaleAccount, @@ -30,7 +29,6 @@ impl RadarStandaloneResponseControl { match self { Self::BotDetection => "bot_detection", Self::BruteForceAttack => "brute_force_attack", - Self::DomainSignUpRateLimit => "domain_sign_up_rate_limit", Self::ImpossibleTravel => "impossible_travel", Self::RepeatSignUp => "repeat_sign_up", Self::StaleAccount => "stale_account", @@ -60,7 +58,6 @@ impl FromStr for RadarStandaloneResponseControl { Ok(match s { "bot_detection" => Self::BotDetection, "brute_force_attack" => Self::BruteForceAttack, - "domain_sign_up_rate_limit" => Self::DomainSignUpRateLimit, "impossible_travel" => Self::ImpossibleTravel, "repeat_sign_up" => Self::RepeatSignUp, "stale_account" => Self::StaleAccount, diff --git a/src/enums/update_webhook_endpoint_events.rs b/src/enums/update_webhook_endpoint_events.rs index 793ace76..6c50345a 100644 --- a/src/enums/update_webhook_endpoint_events.rs +++ b/src/enums/update_webhook_endpoint_events.rs @@ -24,6 +24,7 @@ pub enum UpdateWebhookEndpointEvents { AuthenticationRadarRiskDetected, ApiKeyCreated, ApiKeyRevoked, + ApiKeyUpdated, ConnectionActivated, ConnectionDeactivated, ConnectionSAMLCertificateRenewalRequired, @@ -119,6 +120,7 @@ impl UpdateWebhookEndpointEvents { Self::AuthenticationRadarRiskDetected => "authentication.radar_risk_detected", Self::ApiKeyCreated => "api_key.created", Self::ApiKeyRevoked => "api_key.revoked", + Self::ApiKeyUpdated => "api_key.updated", Self::ConnectionActivated => "connection.activated", Self::ConnectionDeactivated => "connection.deactivated", Self::ConnectionSAMLCertificateRenewalRequired => { @@ -227,6 +229,7 @@ impl FromStr for UpdateWebhookEndpointEvents { "authentication.radar_risk_detected" => Self::AuthenticationRadarRiskDetected, "api_key.created" => Self::ApiKeyCreated, "api_key.revoked" => Self::ApiKeyRevoked, + "api_key.updated" => Self::ApiKeyUpdated, "connection.activated" => Self::ConnectionActivated, "connection.deactivated" => Self::ConnectionDeactivated, "connection.saml_certificate_renewal_required" => { diff --git a/src/models/_unions.rs b/src/models/_unions.rs index dc17002e..c8e9abc2 100644 --- a/src/models/_unions.rs +++ b/src/models/_unions.rs @@ -40,3 +40,12 @@ pub enum ApiKeyRevokedDataOwnerOneOf { #[serde(rename = "user")] UserApiKeyRevokedDataOwner(UserApiKeyRevokedDataOwner), } + +#[derive(Debug, Clone, Serialize, Deserialize)] +#[serde(tag = "type")] +pub enum ApiKeyUpdatedDataOwnerOneOf { + #[serde(rename = "organization")] + ApiKeyUpdatedDataOwner(ApiKeyUpdatedDataOwner), + #[serde(rename = "user")] + UserApiKeyUpdatedDataOwner(UserApiKeyUpdatedDataOwner), +} diff --git a/src/models/dsync_deactivated.rs b/src/models/api_key_updated.rs similarity index 89% rename from src/models/dsync_deactivated.rs rename to src/models/api_key_updated.rs index 3a4838f3..573ac986 100644 --- a/src/models/dsync_deactivated.rs +++ b/src/models/api_key_updated.rs @@ -6,14 +6,14 @@ use super::*; use crate::enums::*; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct DsyncDeactivated { +pub struct ApiKeyUpdated { /// Distinguishes the Event object. pub object: String, /// Unique identifier for the event. pub id: String, pub event: String, /// The event payload. - pub data: DsyncDeactivatedData, + pub data: ApiKeyUpdatedData, /// An ISO 8601 timestamp. pub created_at: String, #[serde(skip_serializing_if = "Option::is_none", default)] diff --git a/src/models/api_key_updated_data.rs b/src/models/api_key_updated_data.rs new file mode 100644 index 00000000..8bcd3547 --- /dev/null +++ b/src/models/api_key_updated_data.rs @@ -0,0 +1,35 @@ +// Code generated by oagen. DO NOT EDIT. + +#[allow(unused_imports)] +use super::*; +#[allow(unused_imports)] +use crate::enums::*; +use serde::{Deserialize, Serialize}; +/// The event payload. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ApiKeyUpdatedData { + /// Distinguishes the API key object. + pub object: String, + /// Unique identifier of the API key. + pub id: String, + /// The owner of the API key. + pub owner: ApiKeyUpdatedDataOwnerOneOf, + /// The name of the API key. + pub name: String, + /// The obfuscated value of the API key. + pub obfuscated_value: String, + /// The timestamp when the API key was last used. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub last_used_at: Option, + /// Timestamp when the API Key expires. Null means the key does not expire. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub expires_at: Option, + /// The permissions granted to the API key. + pub permissions: Vec, + /// The timestamp when the API key was created. + pub created_at: String, + /// The timestamp when the API key was last updated. + pub updated_at: String, + /// Previous API key attributes before the update. + pub previous_attributes: ApiKeyUpdatedDataPreviousAttribute, +} diff --git a/src/models/dsync_deactivated_data_domain.rs b/src/models/api_key_updated_data_owner.rs similarity index 51% rename from src/models/dsync_deactivated_data_domain.rs rename to src/models/api_key_updated_data_owner.rs index f7148851..c69eacb8 100644 --- a/src/models/dsync_deactivated_data_domain.rs +++ b/src/models/api_key_updated_data_owner.rs @@ -6,11 +6,10 @@ use super::*; use crate::enums::*; use serde::{Deserialize, Serialize}; #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct DsyncDeactivatedDataDomain { - /// Distinguishes the organization domain object. - pub object: String, - /// Unique identifier of the organization domain. +pub struct ApiKeyUpdatedDataOwner { + /// The type of the API key owner. + #[serde(rename = "type")] + pub type_: String, + /// The unique identifier of the API key owner. pub id: String, - /// The domain value. - pub domain: String, } diff --git a/src/models/api_key_updated_data_previous_attribute.rs b/src/models/api_key_updated_data_previous_attribute.rs new file mode 100644 index 00000000..2bb42923 --- /dev/null +++ b/src/models/api_key_updated_data_previous_attribute.rs @@ -0,0 +1,14 @@ +// Code generated by oagen. DO NOT EDIT. + +#[allow(unused_imports)] +use super::*; +#[allow(unused_imports)] +use crate::enums::*; +use serde::{Deserialize, Serialize}; +/// Previous API key attributes before the update. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct ApiKeyUpdatedDataPreviousAttribute { + /// The previous timestamp when the API Key expired. Null means the key did not expire. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub expires_at: Option, +} diff --git a/src/models/create_user.rs b/src/models/create_user.rs index 91a6b22e..94e6b0b1 100644 --- a/src/models/create_user.rs +++ b/src/models/create_user.rs @@ -15,6 +15,9 @@ pub struct CreateUser { /// The last name of the user. #[serde(skip_serializing_if = "Option::is_none", default)] pub last_name: Option, + /// The user's full name. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub name: Option, /// Whether the user's email has been verified. #[serde(skip_serializing_if = "Option::is_none", default)] pub email_verified: Option, diff --git a/src/models/dsync_deactivated_data.rs b/src/models/dsync_deactivated_data.rs deleted file mode 100644 index eee94b2e..00000000 --- a/src/models/dsync_deactivated_data.rs +++ /dev/null @@ -1,33 +0,0 @@ -// Code generated by oagen. DO NOT EDIT. - -#[allow(unused_imports)] -use super::*; -#[allow(unused_imports)] -use crate::enums::*; -use serde::{Deserialize, Serialize}; -/// The event payload. -#[derive(Debug, Clone, Serialize, Deserialize)] -pub struct DsyncDeactivatedData { - /// Distinguishes the directory object. - pub object: String, - /// Unique identifier of the directory. - pub id: String, - /// The ID of the organization the directory belongs to. - #[serde(skip_serializing_if = "Option::is_none", default)] - pub organization_id: Option, - /// The type of the directory. - #[serde(rename = "type")] - pub type_: DsyncDeactivatedDataType, - /// The current state of the directory. - pub state: DsyncDeactivatedDataState, - /// The name of the directory. - pub name: String, - /// An ISO 8601 timestamp. - pub created_at: String, - /// An ISO 8601 timestamp. - pub updated_at: String, - /// The external key of the directory. - pub external_key: String, - /// The domains associated with the directory. - pub domains: Vec, -} diff --git a/src/models/dsync_token_created.rs b/src/models/dsync_token_created.rs new file mode 100644 index 00000000..c9828ac7 --- /dev/null +++ b/src/models/dsync_token_created.rs @@ -0,0 +1,21 @@ +// Code 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 DsyncTokenCreated { + /// Distinguishes the Event object. + pub object: String, + /// Unique identifier for the event. + pub id: String, + pub event: String, + /// The event payload. + pub data: DsyncTokenCreatedData, + /// An ISO 8601 timestamp. + pub created_at: String, + #[serde(skip_serializing_if = "Option::is_none", default)] + pub context: Option, +} diff --git a/src/models/dsync_token_created_data.rs b/src/models/dsync_token_created_data.rs new file mode 100644 index 00000000..1377c0ba --- /dev/null +++ b/src/models/dsync_token_created_data.rs @@ -0,0 +1,24 @@ +// Code generated by oagen. DO NOT EDIT. + +#[allow(unused_imports)] +use super::*; +#[allow(unused_imports)] +use crate::enums::*; +use serde::{Deserialize, Serialize}; +/// The event payload. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DsyncTokenCreatedData { + /// Distinguishes the directory token object. + pub object: String, + /// Unique identifier of the directory token. + pub id: String, + /// The ID of the directory the token authenticates to. + pub directory_id: String, + /// The ID of the organization the directory belongs to. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub organization_id: Option, + /// The trailing characters of the bearer token, for identification only. The full token value is never included in events. + pub token_suffix: String, + /// An ISO 8601 timestamp. + pub created_at: String, +} diff --git a/src/models/dsync_token_revoked.rs b/src/models/dsync_token_revoked.rs new file mode 100644 index 00000000..95960c25 --- /dev/null +++ b/src/models/dsync_token_revoked.rs @@ -0,0 +1,21 @@ +// Code 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 DsyncTokenRevoked { + /// Distinguishes the Event object. + pub object: String, + /// Unique identifier for the event. + pub id: String, + pub event: String, + /// The event payload. + pub data: DsyncTokenRevokedData, + /// An ISO 8601 timestamp. + pub created_at: String, + #[serde(skip_serializing_if = "Option::is_none", default)] + pub context: Option, +} diff --git a/src/models/dsync_token_revoked_data.rs b/src/models/dsync_token_revoked_data.rs new file mode 100644 index 00000000..90d4aaa7 --- /dev/null +++ b/src/models/dsync_token_revoked_data.rs @@ -0,0 +1,24 @@ +// Code generated by oagen. DO NOT EDIT. + +#[allow(unused_imports)] +use super::*; +#[allow(unused_imports)] +use crate::enums::*; +use serde::{Deserialize, Serialize}; +/// The event payload. +#[derive(Debug, Clone, Serialize, Deserialize)] +pub struct DsyncTokenRevokedData { + /// Distinguishes the directory token object. + pub object: String, + /// Unique identifier of the directory token. + pub id: String, + /// The ID of the directory the token authenticates to. + pub directory_id: String, + /// The ID of the organization the directory belongs to. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub organization_id: Option, + /// The trailing characters of the bearer token, for identification only. The full token value is never included in events. + pub token_suffix: String, + /// An ISO 8601 timestamp. + pub created_at: String, +} diff --git a/src/models/email_change_confirmation_user.rs b/src/models/email_change_confirmation_user.rs index 2aeb8845..8c266312 100644 --- a/src/models/email_change_confirmation_user.rs +++ b/src/models/email_change_confirmation_user.rs @@ -18,6 +18,9 @@ pub struct EmailChangeConfirmationUser { /// The last name of the user. #[serde(skip_serializing_if = "Option::is_none", default)] pub last_name: Option, + /// The user's full name. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub name: Option, /// A URL reference to an image representing the user. #[serde(skip_serializing_if = "Option::is_none", default)] pub profile_picture_url: Option, diff --git a/src/models/expire_api_key.rs b/src/models/expire_api_key.rs new file mode 100644 index 00000000..49a51638 --- /dev/null +++ b/src/models/expire_api_key.rs @@ -0,0 +1,13 @@ +// Code 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 ExpireApiKey { + /// When the API key should expire. If omitted or in the past, the key expires immediately. Use null to clear a scheduled future expiration. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub expires_at: Option, +} diff --git a/src/models/mod.rs b/src/models/mod.rs index 66e9242a..d93739bd 100644 --- a/src/models/mod.rs +++ b/src/models/mod.rs @@ -15,6 +15,10 @@ mod api_key_owner; mod api_key_revoked; mod api_key_revoked_data; mod api_key_revoked_data_owner; +mod api_key_updated; +mod api_key_updated_data; +mod api_key_updated_data_owner; +mod api_key_updated_data_previous_attribute; mod api_key_validation_response; mod application_credentials_list_item; mod assign_role; @@ -194,9 +198,6 @@ mod domain_verification_intent_options; mod dsync_activated; mod dsync_activated_data; mod dsync_activated_data_domain; -mod dsync_deactivated; -mod dsync_deactivated_data; -mod dsync_deactivated_data_domain; mod dsync_deleted; mod dsync_deleted_data; mod dsync_group_created; @@ -207,6 +208,10 @@ mod dsync_group_user_added; mod dsync_group_user_added_data; mod dsync_group_user_removed; mod dsync_group_user_removed_data; +mod dsync_token_created; +mod dsync_token_created_data; +mod dsync_token_revoked; +mod dsync_token_revoked_data; mod dsync_user_created; mod dsync_user_deleted; mod dsync_user_updated; @@ -227,6 +232,7 @@ mod event_context_google_analytics_session; mod event_list; mod event_list_list_metadata; mod event_schema; +mod expire_api_key; mod external_auth_complete_response; mod feature_flag; mod feature_flag_owner; @@ -427,6 +433,7 @@ mod user_api_key_list; mod user_api_key_list_list_metadata; mod user_api_key_owner; mod user_api_key_revoked_data_owner; +mod user_api_key_updated_data_owner; mod user_api_key_with_value; mod user_api_key_with_value_owner; mod user_authentication_factor_enroll_response; @@ -505,6 +512,10 @@ pub use api_key_owner::*; pub use api_key_revoked::*; pub use api_key_revoked_data::*; pub use api_key_revoked_data_owner::*; +pub use api_key_updated::*; +pub use api_key_updated_data::*; +pub use api_key_updated_data_owner::*; +pub use api_key_updated_data_previous_attribute::*; pub use api_key_validation_response::*; pub use application_credentials_list_item::*; pub use assign_role::*; @@ -684,9 +695,6 @@ pub use domain_verification_intent_options::*; pub use dsync_activated::*; pub use dsync_activated_data::*; pub use dsync_activated_data_domain::*; -pub use dsync_deactivated::*; -pub use dsync_deactivated_data::*; -pub use dsync_deactivated_data_domain::*; pub use dsync_deleted::*; pub use dsync_deleted_data::*; pub use dsync_group_created::*; @@ -697,6 +705,10 @@ pub use dsync_group_user_added::*; pub use dsync_group_user_added_data::*; pub use dsync_group_user_removed::*; pub use dsync_group_user_removed_data::*; +pub use dsync_token_created::*; +pub use dsync_token_created_data::*; +pub use dsync_token_revoked::*; +pub use dsync_token_revoked_data::*; pub use dsync_user_created::*; pub use dsync_user_deleted::*; pub use dsync_user_updated::*; @@ -717,6 +729,7 @@ pub use event_context_google_analytics_session::*; pub use event_list::*; pub use event_list_list_metadata::*; pub use event_schema::*; +pub use expire_api_key::*; pub use external_auth_complete_response::*; pub use feature_flag::*; pub use feature_flag_owner::*; @@ -917,6 +930,7 @@ pub use user_api_key_list::*; pub use user_api_key_list_list_metadata::*; pub use user_api_key_owner::*; pub use user_api_key_revoked_data_owner::*; +pub use user_api_key_updated_data_owner::*; pub use user_api_key_with_value::*; pub use user_api_key_with_value_owner::*; pub use user_authentication_factor_enroll_response::*; diff --git a/src/models/revoke_session.rs b/src/models/revoke_session.rs index 026209db..9c7a3a29 100644 --- a/src/models/revoke_session.rs +++ b/src/models/revoke_session.rs @@ -9,7 +9,4 @@ use serde::{Deserialize, Serialize}; pub struct RevokeSession { /// The ID of the session to revoke. This can be extracted from the `sid` claim of the access token. pub session_id: String, - /// The URL to redirect the user to after session revocation. - #[serde(skip_serializing_if = "Option::is_none", default)] - pub return_to: Option, } diff --git a/src/models/update_user.rs b/src/models/update_user.rs index f087f566..0fd9e4c7 100644 --- a/src/models/update_user.rs +++ b/src/models/update_user.rs @@ -16,6 +16,9 @@ pub struct UpdateUser { /// The last name of the user. #[serde(skip_serializing_if = "Option::is_none", default)] pub last_name: Option, + /// The user's full name. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub name: Option, /// Whether the user's email has been verified. #[serde(skip_serializing_if = "Option::is_none", default)] pub email_verified: Option, diff --git a/src/models/user.rs b/src/models/user.rs index fcd7303d..86a8a692 100644 --- a/src/models/user.rs +++ b/src/models/user.rs @@ -18,6 +18,9 @@ pub struct User { /// The last name of the user. #[serde(skip_serializing_if = "Option::is_none", default)] pub last_name: Option, + /// The user's full name. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub name: Option, /// A URL reference to an image representing the user. #[serde(skip_serializing_if = "Option::is_none", default)] pub profile_picture_url: Option, diff --git a/src/models/user_api_key_updated_data_owner.rs b/src/models/user_api_key_updated_data_owner.rs new file mode 100644 index 00000000..83ae0766 --- /dev/null +++ b/src/models/user_api_key_updated_data_owner.rs @@ -0,0 +1,17 @@ +// Code 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 UserApiKeyUpdatedDataOwner { + /// The type of the API key owner. + #[serde(rename = "type")] + pub type_: String, + /// The unique identifier of the user who owns the API key. + pub id: String, + /// The unique identifier of the organization the API key belongs to. + pub organization_id: String, +} diff --git a/src/models/user_object.rs b/src/models/user_object.rs index 121521bf..504ce2fa 100644 --- a/src/models/user_object.rs +++ b/src/models/user_object.rs @@ -17,6 +17,9 @@ pub struct UserObject { /// The user's last name. #[serde(skip_serializing_if = "Option::is_none", default)] pub last_name: Option, + /// The user's full name. + #[serde(skip_serializing_if = "Option::is_none", default)] + pub name: Option, /// A set of key-value pairs to attach to the user. #[serde(skip_serializing_if = "Option::is_none", default)] pub metadata: Option>, diff --git a/src/resources/api_keys.rs b/src/resources/api_keys.rs index 81f30260..7e3d4495 100644 --- a/src/resources/api_keys.rs +++ b/src/resources/api_keys.rs @@ -78,6 +78,23 @@ impl CreateValidationParams { } } +#[derive(Debug, Clone, Serialize)] +pub struct CreateApiKeyExpireParams { + /// Request body sent with this call. + /// + /// Required. + #[serde(skip)] + pub body: ExpireApiKey, +} + +impl CreateApiKeyExpireParams { + /// Construct a new `CreateApiKeyExpireParams` with the required fields set. + #[allow(deprecated)] + pub fn new(body: ExpireApiKey) -> Self { + Self { body } + } +} + impl<'a> ApiKeysApi<'a> { /// List API keys for an organization /// @@ -205,4 +222,31 @@ impl<'a> ApiKeysApi<'a> { .request_with_query_opts_empty(method, &path, &(), options) .await } + + /// Expire an API key + /// + /// Expire an API key immediately, schedule a future expiration, or clear a scheduled future expiration. + pub async fn create_api_key_expire( + &self, + id: &str, + params: CreateApiKeyExpireParams, + ) -> Result { + self.create_api_key_expire_with_options(id, params, None) + .await + } + + /// Variant of [`Self::create_api_key_expire`] that accepts per-request [`crate::RequestOptions`]. + pub async fn create_api_key_expire_with_options( + &self, + id: &str, + params: CreateApiKeyExpireParams, + options: Option<&crate::RequestOptions>, + ) -> Result { + let id = crate::client::path_segment(id); + let path = format!("/api_keys/{id}/expire"); + let method = http::Method::POST; + self.client + .request_with_body_opts(method, &path, ¶ms, Some(¶ms.body), options) + .await + } } diff --git a/src/resources/authorization.rs b/src/resources/authorization.rs index df934039..189684a1 100644 --- a/src/resources/authorization.rs +++ b/src/resources/authorization.rs @@ -231,7 +231,7 @@ pub struct ListResourcesForMembershipParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -272,7 +272,7 @@ pub struct ListEffectivePermissionsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -304,7 +304,7 @@ pub struct ListEffectivePermissionsByExternalIdParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -336,7 +336,7 @@ pub struct ListRoleAssignmentsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -517,7 +517,7 @@ pub struct ListMembershipsForResourceByExternalIdParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -559,7 +559,7 @@ pub struct ListRoleAssignmentsForResourceByExternalIdParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -595,7 +595,7 @@ pub struct ListResourcesParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -695,7 +695,7 @@ pub struct ListMembershipsForResourceParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -737,7 +737,7 @@ pub struct ListRoleAssignmentsForResourceParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -841,7 +841,7 @@ pub struct ListPermissionsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/resources/connect.rs b/src/resources/connect.rs index e32b3a3a..9714fbba 100644 --- a/src/resources/connect.rs +++ b/src/resources/connect.rs @@ -42,7 +42,7 @@ pub struct ListApplicationsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/resources/directory_sync.rs b/src/resources/directory_sync.rs index bc869901..72b7c65d 100644 --- a/src/resources/directory_sync.rs +++ b/src/resources/directory_sync.rs @@ -70,7 +70,7 @@ pub struct ListGroupsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -110,7 +110,7 @@ pub struct ListUsersParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/resources/events.rs b/src/resources/events.rs index a5502c91..d88cc3a4 100644 --- a/src/resources/events.rs +++ b/src/resources/events.rs @@ -25,7 +25,7 @@ pub struct ListEventsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/resources/groups.rs b/src/resources/groups.rs index bbb839e8..eeacb4d9 100644 --- a/src/resources/groups.rs +++ b/src/resources/groups.rs @@ -25,7 +25,7 @@ pub struct ListOrganizationGroupsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -91,7 +91,7 @@ pub struct ListGroupOrganizationMembershipsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/resources/organization_membership.rs b/src/resources/organization_membership.rs index 5df06cd3..e64e14fc 100644 --- a/src/resources/organization_membership.rs +++ b/src/resources/organization_membership.rs @@ -74,7 +74,7 @@ pub struct ListOrganizationMembershipsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -153,7 +153,7 @@ pub struct ListOrganizationMembershipGroupsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/resources/organizations.rs b/src/resources/organizations.rs index f07bfc02..b978d389 100644 --- a/src/resources/organizations.rs +++ b/src/resources/organizations.rs @@ -25,7 +25,7 @@ pub struct ListOrganizationsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/resources/user_management.rs b/src/resources/user_management.rs index b6961424..581e13b1 100644 --- a/src/resources/user_management.rs +++ b/src/resources/user_management.rs @@ -36,6 +36,9 @@ pub struct CreateUserParamsBody { /// The last name of the user. #[serde(skip_serializing_if = "Option::is_none")] pub last_name: Option, + /// The user's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, /// Whether the user's email has been verified. #[serde(skip_serializing_if = "Option::is_none")] pub email_verified: Option, @@ -57,6 +60,7 @@ impl CreateUserParamsBody { email: email.into(), first_name: Default::default(), last_name: Default::default(), + name: Default::default(), email_verified: Default::default(), metadata: Default::default(), external_id: Default::default(), @@ -76,6 +80,9 @@ pub struct UpdateUserParamsBody { /// The last name of the user. #[serde(skip_serializing_if = "Option::is_none")] pub last_name: Option, + /// The user's full name. + #[serde(skip_serializing_if = "Option::is_none")] + pub name: Option, /// Whether the user's email has been verified. #[serde(skip_serializing_if = "Option::is_none")] pub email_verified: Option, @@ -100,6 +107,7 @@ impl UpdateUserParamsBody { email: Default::default(), first_name: Default::default(), last_name: Default::default(), + name: Default::default(), email_verified: Default::default(), metadata: Default::default(), external_id: Default::default(), @@ -457,11 +465,11 @@ impl CreateDeviceParams { #[derive(Debug, Clone, Serialize)] pub struct GetLogoutUrlParams { - /// The ID of the session to revoke. This can be extracted from the `sid` claim of the access token. + /// The ID of the session. This can be extracted from the `sid` claim of the access token. /// /// Required. pub session_id: String, - /// The URL to redirect the user to after session revocation. + /// The URL to redirect the user to after logout. #[serde(skip_serializing_if = "Option::is_none")] pub return_to: Option, } @@ -558,7 +566,7 @@ pub struct ListUsersParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -688,7 +696,7 @@ pub struct ListSessionsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -720,7 +728,7 @@ pub struct ListInvitationsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] @@ -845,7 +853,7 @@ pub struct ListUserAuthorizedApplicationsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/src/resources/webhooks.rs b/src/resources/webhooks.rs index f489c2d5..b74be964 100644 --- a/src/resources/webhooks.rs +++ b/src/resources/webhooks.rs @@ -25,7 +25,7 @@ pub struct ListWebhookEndpointsParams { /// Defaults to `10`. #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, - /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). Defaults to descending. + /// Order the results by the creation time. Supported values are `"asc"` (ascending), `"desc"` (descending), and `"normal"` (descending with reversed cursor semantics where `before` fetches older records and `after` fetches newer records). /// /// Defaults to `desc`. #[serde(skip_serializing_if = "Option::is_none")] diff --git a/tests/api_keys_test.rs b/tests/api_keys_test.rs index 1d1f144d..e6992106 100644 --- a/tests/api_keys_test.rs +++ b/tests/api_keys_test.rs @@ -699,3 +699,199 @@ async fn api_keys_delete_api_key_unprocessable() { }; assert_eq!(api.status, 422); } + +#[tokio::test] +async fn api_keys_create_api_key_expire_round_trip() { + let server = MockServer::start().await; + Mock::given(method("POST")) + .and(path_matcher("/api_keys/test_id/expire")) + .respond_with( + ResponseTemplate::new(200).set_body_string(include_str!("fixtures/api_key.json")), + ) + .expect(1) + .mount(&server) + .await; + let client = common::test_client(&server).await; + let _ = client + .api_keys() + .create_api_key_expire( + "test_id", + workos::api_keys::CreateApiKeyExpireParams::new( + serde_json::from_str("{}").expect("parse stub for ExpireApiKey"), + ), + ) + .await; +} + +#[tokio::test] +async fn api_keys_create_api_key_expire_unauthorized() { + let server = MockServer::start().await; + let template = ResponseTemplate::new(401).set_body_string("{\"message\":\"Unauthorized\"}"); + Mock::given(method("POST")) + .and(path_matcher("/api_keys/test_id/expire")) + .respond_with(template) + .expect(1) + .mount(&server) + .await; + let client = common::test_client(&server).await; + let err = client + .api_keys() + .create_api_key_expire( + "test_id", + workos::api_keys::CreateApiKeyExpireParams::new( + serde_json::from_str("{}").expect("parse stub for ExpireApiKey"), + ), + ) + .await + .expect_err("expected error"); + let api = match &err { + Error::Api(api) => api.as_ref(), + other => panic!("expected Error::Api, got {other:?}"), + }; + assert_eq!(api.status, 401); +} + +#[tokio::test] +async fn api_keys_create_api_key_expire_not_found() { + let server = MockServer::start().await; + let template = ResponseTemplate::new(404).set_body_string("{\"message\":\"Not found\"}"); + Mock::given(method("POST")) + .and(path_matcher("/api_keys/test_id/expire")) + .respond_with(template) + .expect(1) + .mount(&server) + .await; + let client = common::test_client(&server).await; + let err = client + .api_keys() + .create_api_key_expire( + "test_id", + workos::api_keys::CreateApiKeyExpireParams::new( + serde_json::from_str("{}").expect("parse stub for ExpireApiKey"), + ), + ) + .await + .expect_err("expected error"); + let api = match &err { + Error::Api(api) => api.as_ref(), + other => panic!("expected Error::Api, got {other:?}"), + }; + assert_eq!(api.status, 404); +} + +#[tokio::test] +async fn api_keys_create_api_key_expire_rate_limited() { + let server = MockServer::start().await; + let template = ResponseTemplate::new(429) + .insert_header("retry-after", "1") + .set_body_string("{\"message\":\"Slow down\"}"); + Mock::given(method("POST")) + .and(path_matcher("/api_keys/test_id/expire")) + .respond_with(template) + .expect(1) + .mount(&server) + .await; + let client = common::test_client(&server).await; + let err = client + .api_keys() + .create_api_key_expire( + "test_id", + workos::api_keys::CreateApiKeyExpireParams::new( + serde_json::from_str("{}").expect("parse stub for ExpireApiKey"), + ), + ) + .await + .expect_err("expected error"); + let api = match &err { + Error::Api(api) => api.as_ref(), + other => panic!("expected Error::Api, got {other:?}"), + }; + assert_eq!(api.status, 429); + assert_eq!(api.retry_after, Some(std::time::Duration::from_secs(1))); +} + +#[tokio::test] +async fn api_keys_create_api_key_expire_server_error() { + let server = MockServer::start().await; + let template = ResponseTemplate::new(500).set_body_string("{\"message\":\"Internal error\"}"); + Mock::given(method("POST")) + .and(path_matcher("/api_keys/test_id/expire")) + .respond_with(template) + .expect(1) + .mount(&server) + .await; + let client = common::test_client(&server).await; + let err = client + .api_keys() + .create_api_key_expire( + "test_id", + workos::api_keys::CreateApiKeyExpireParams::new( + serde_json::from_str("{}").expect("parse stub for ExpireApiKey"), + ), + ) + .await + .expect_err("expected error"); + let api = match &err { + Error::Api(api) => api.as_ref(), + other => panic!("expected Error::Api, got {other:?}"), + }; + assert_eq!(api.status, 500); +} + +#[tokio::test] +async fn api_keys_create_api_key_expire_bad_request() { + let server = MockServer::start().await; + let template = ResponseTemplate::new(400) + .set_body_string("{\"code\":\"validation_error\",\"message\":\"Bad request\"}"); + Mock::given(method("POST")) + .and(path_matcher("/api_keys/test_id/expire")) + .respond_with(template) + .expect(1) + .mount(&server) + .await; + let client = common::test_client(&server).await; + let err = client + .api_keys() + .create_api_key_expire( + "test_id", + workos::api_keys::CreateApiKeyExpireParams::new( + serde_json::from_str("{}").expect("parse stub for ExpireApiKey"), + ), + ) + .await + .expect_err("expected error"); + let api = match &err { + Error::Api(api) => api.as_ref(), + other => panic!("expected Error::Api, got {other:?}"), + }; + assert_eq!(api.status, 400); + assert_eq!(api.code.as_deref(), Some("validation_error")); +} + +#[tokio::test] +async fn api_keys_create_api_key_expire_unprocessable() { + let server = MockServer::start().await; + let template = ResponseTemplate::new(422).set_body_string("{\"message\":\"Unprocessable\"}"); + Mock::given(method("POST")) + .and(path_matcher("/api_keys/test_id/expire")) + .respond_with(template) + .expect(1) + .mount(&server) + .await; + let client = common::test_client(&server).await; + let err = client + .api_keys() + .create_api_key_expire( + "test_id", + workos::api_keys::CreateApiKeyExpireParams::new( + serde_json::from_str("{}").expect("parse stub for ExpireApiKey"), + ), + ) + .await + .expect_err("expected error"); + let api = match &err { + Error::Api(api) => api.as_ref(), + other => panic!("expected Error::Api, got {other:?}"), + }; + assert_eq!(api.status, 422); +} diff --git a/tests/fixtures/api_key_created.json b/tests/fixtures/api_key_created.json index f946291d..d739e422 100644 --- a/tests/fixtures/api_key_created.json +++ b/tests/fixtures/api_key_created.json @@ -16,7 +16,8 @@ "users:write" ], "created_at": "2026-01-15T12:00:00.000Z", - "updated_at": "2026-01-15T12:00:00.000Z" + "updated_at": "2026-01-15T12:00:00.000Z", + "expires_at": "2023-01-01T00:00:00.000Z" }, "created_at": "2026-01-15T12:00:00.000Z", "object": "event" diff --git a/tests/fixtures/api_key_created_data.json b/tests/fixtures/api_key_created_data.json index 1f0a1945..d5770978 100644 --- a/tests/fixtures/api_key_created_data.json +++ b/tests/fixtures/api_key_created_data.json @@ -13,5 +13,6 @@ "users:write" ], "created_at": "2026-01-15T12:00:00.000Z", - "updated_at": "2026-01-15T12:00:00.000Z" + "updated_at": "2026-01-15T12:00:00.000Z", + "expires_at": "2023-01-01T00:00:00.000Z" } diff --git a/tests/fixtures/api_key_revoked.json b/tests/fixtures/api_key_revoked.json index 2d2102e6..fc256bd5 100644 --- a/tests/fixtures/api_key_revoked.json +++ b/tests/fixtures/api_key_revoked.json @@ -16,7 +16,8 @@ "users:write" ], "created_at": "2026-01-15T12:00:00.000Z", - "updated_at": "2026-01-15T12:00:00.000Z" + "updated_at": "2026-01-15T12:00:00.000Z", + "expires_at": "2023-01-01T00:00:00.000Z" }, "created_at": "2026-01-15T12:00:00.000Z", "object": "event" diff --git a/tests/fixtures/api_key_revoked_data.json b/tests/fixtures/api_key_revoked_data.json index 1f0a1945..d5770978 100644 --- a/tests/fixtures/api_key_revoked_data.json +++ b/tests/fixtures/api_key_revoked_data.json @@ -13,5 +13,6 @@ "users:write" ], "created_at": "2026-01-15T12:00:00.000Z", - "updated_at": "2026-01-15T12:00:00.000Z" + "updated_at": "2026-01-15T12:00:00.000Z", + "expires_at": "2023-01-01T00:00:00.000Z" } diff --git a/tests/fixtures/api_key_updated.json b/tests/fixtures/api_key_updated.json new file mode 100644 index 00000000..f0cb26df --- /dev/null +++ b/tests/fixtures/api_key_updated.json @@ -0,0 +1,27 @@ +{ + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "api_key.updated", + "data": { + "object": "api_key", + "id": "api_key_01EHWNCE74X7JSDV0X3SZ3KJNY", + "owner": { + "type": "organization", + "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY" + }, + "name": "My API Key", + "obfuscated_value": "sk_test_...1234", + "last_used_at": "2026-01-15T12:00:00.000Z", + "expires_at": "2023-01-01T00:00:00.000Z", + "permissions": [ + "users:read", + "users:write" + ], + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + "previous_attributes": { + "expires_at": "2023-01-01T00:00:00.000Z" + } + }, + "created_at": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/api_key_updated_data.json b/tests/fixtures/api_key_updated_data.json new file mode 100644 index 00000000..7852c039 --- /dev/null +++ b/tests/fixtures/api_key_updated_data.json @@ -0,0 +1,21 @@ +{ + "object": "api_key", + "id": "api_key_01EHWNCE74X7JSDV0X3SZ3KJNY", + "owner": { + "type": "organization", + "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY" + }, + "name": "My API Key", + "obfuscated_value": "sk_test_...1234", + "last_used_at": "2026-01-15T12:00:00.000Z", + "expires_at": "2023-01-01T00:00:00.000Z", + "permissions": [ + "users:read", + "users:write" + ], + "created_at": "2026-01-15T12:00:00.000Z", + "updated_at": "2026-01-15T12:00:00.000Z", + "previous_attributes": { + "expires_at": "2023-01-01T00:00:00.000Z" + } +} diff --git a/tests/fixtures/api_key_updated_data_owner.json b/tests/fixtures/api_key_updated_data_owner.json new file mode 100644 index 00000000..482d9913 --- /dev/null +++ b/tests/fixtures/api_key_updated_data_owner.json @@ -0,0 +1,4 @@ +{ + "type": "organization", + "id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY" +} diff --git a/tests/fixtures/api_key_updated_data_previous_attribute.json b/tests/fixtures/api_key_updated_data_previous_attribute.json new file mode 100644 index 00000000..495dcd7d --- /dev/null +++ b/tests/fixtures/api_key_updated_data_previous_attribute.json @@ -0,0 +1,3 @@ +{ + "expires_at": "2023-01-01T00:00:00.000Z" +} diff --git a/tests/fixtures/dsync_token_created.json b/tests/fixtures/dsync_token_created.json new file mode 100644 index 00000000..547abb24 --- /dev/null +++ b/tests/fixtures/dsync_token_created.json @@ -0,0 +1,13 @@ +{ + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "dsync.token.created", + "data": { + "object": "directory_token", + "id": "directory_token_01EHWNCE74X7JSDV0X3SZ3KJNY", + "directory_id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", + "token_suffix": "a1b2", + "created_at": "2026-01-15T12:00:00.000Z" + }, + "created_at": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/dsync_token_created_data.json b/tests/fixtures/dsync_token_created_data.json new file mode 100644 index 00000000..ee124b7d --- /dev/null +++ b/tests/fixtures/dsync_token_created_data.json @@ -0,0 +1,7 @@ +{ + "object": "directory_token", + "id": "directory_token_01EHWNCE74X7JSDV0X3SZ3KJNY", + "directory_id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", + "token_suffix": "a1b2", + "created_at": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/dsync_token_revoked.json b/tests/fixtures/dsync_token_revoked.json new file mode 100644 index 00000000..bbf04140 --- /dev/null +++ b/tests/fixtures/dsync_token_revoked.json @@ -0,0 +1,13 @@ +{ + "object": "event", + "id": "event_01EHZNVPK3SFK441A1RGBFSHRT", + "event": "dsync.token.revoked", + "data": { + "object": "directory_token", + "id": "directory_token_01EHWNCE74X7JSDV0X3SZ3KJNY", + "directory_id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", + "token_suffix": "a1b2", + "created_at": "2026-01-15T12:00:00.000Z" + }, + "created_at": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/dsync_token_revoked_data.json b/tests/fixtures/dsync_token_revoked_data.json new file mode 100644 index 00000000..ee124b7d --- /dev/null +++ b/tests/fixtures/dsync_token_revoked_data.json @@ -0,0 +1,7 @@ +{ + "object": "directory_token", + "id": "directory_token_01EHWNCE74X7JSDV0X3SZ3KJNY", + "directory_id": "directory_01EHWNCE74X7JSDV0X3SZ3KJNY", + "token_suffix": "a1b2", + "created_at": "2026-01-15T12:00:00.000Z" +} diff --git a/tests/fixtures/expire_api_key.json b/tests/fixtures/expire_api_key.json new file mode 100644 index 00000000..0967ef42 --- /dev/null +++ b/tests/fixtures/expire_api_key.json @@ -0,0 +1 @@ +{} diff --git a/tests/fixtures/user_api_key_updated_data_owner.json b/tests/fixtures/user_api_key_updated_data_owner.json new file mode 100644 index 00000000..125ba4bc --- /dev/null +++ b/tests/fixtures/user_api_key_updated_data_owner.json @@ -0,0 +1,5 @@ +{ + "type": "user", + "id": "user_01EHWNCE74X7JSDV0X3SZ3KJNY", + "organization_id": "org_01EHWNCE74X7JSDV0X3SZ3KJNY" +}