atrium-api 0.26.0

API library for AT Protocol (Bluesky)
Documentation
// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
//!Definitions for the `app.bsky.ageassurance.defs` namespace.
///The access level granted based on Age Assurance data we've processed.
pub type Access = String;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConfigData {
    ///The per-region Age Assurance configuration.
    pub regions: Vec<crate::app::bsky::ageassurance::defs::ConfigRegion>,
}
pub type Config = crate::types::Object<ConfigData>;
///The Age Assurance configuration for a specific region.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConfigRegionData {
    ///Verification methods permitted in this region in addition to the third-party (KWS) flow, which is always supported. `device` permits using the native on-device age APIs (e.g. Apple Declared Age Range, Google Play Age Signals).
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub additional_verification_methods: core::option::Option<Vec<String>>,
    ///The ISO 3166-1 alpha-2 country code this configuration applies to.
    pub country_code: String,
    ///The minimum age (as a whole integer) required to use Bluesky in this region.
    pub min_access_age: i64,
    ///The platforms this configuration applies to. If omitted, the configuration applies to all platforms.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub platforms: core::option::Option<Vec<String>>,
    ///The ISO 3166-2 region code this configuration applies to. If omitted, the configuration applies to the entire country.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub region_code: core::option::Option<String>,
    ///The ordered list of Age Assurance rules that apply to this region. Rules should be applied in order, and the first matching rule determines the access level granted. The rules array should always include a default rule as the last item.
    pub rules: Vec<crate::types::Union<ConfigRegionRulesItem>>,
}
pub type ConfigRegion = crate::types::Object<ConfigRegionData>;
///Age Assurance rule that applies by default.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConfigRegionRuleDefaultData {
    pub access: crate::app::bsky::ageassurance::defs::Access,
}
pub type ConfigRegionRuleDefault = crate::types::Object<ConfigRegionRuleDefaultData>;
///Age Assurance rule that applies if the account is equal-to or newer than a certain date.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConfigRegionRuleIfAccountNewerThanData {
    pub access: crate::app::bsky::ageassurance::defs::Access,
    ///The date threshold as a datetime string.
    pub date: crate::types::string::Datetime,
}
pub type ConfigRegionRuleIfAccountNewerThan = crate::types::Object<
    ConfigRegionRuleIfAccountNewerThanData,
>;
///Age Assurance rule that applies if the account is older than a certain date.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConfigRegionRuleIfAccountOlderThanData {
    pub access: crate::app::bsky::ageassurance::defs::Access,
    ///The date threshold as a datetime string.
    pub date: crate::types::string::Datetime,
}
pub type ConfigRegionRuleIfAccountOlderThan = crate::types::Object<
    ConfigRegionRuleIfAccountOlderThanData,
>;
///Age Assurance rule that applies if the user has been assured to be equal-to or over a certain age.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConfigRegionRuleIfAssuredOverAgeData {
    pub access: crate::app::bsky::ageassurance::defs::Access,
    ///The age threshold as a whole integer.
    pub age: i64,
}
pub type ConfigRegionRuleIfAssuredOverAge = crate::types::Object<
    ConfigRegionRuleIfAssuredOverAgeData,
>;
///Age Assurance rule that applies if the user has been assured to be under a certain age.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConfigRegionRuleIfAssuredUnderAgeData {
    pub access: crate::app::bsky::ageassurance::defs::Access,
    ///The age threshold as a whole integer.
    pub age: i64,
}
pub type ConfigRegionRuleIfAssuredUnderAge = crate::types::Object<
    ConfigRegionRuleIfAssuredUnderAgeData,
>;
///Age Assurance rule that applies if the user has declared themselves equal-to or over a certain age.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConfigRegionRuleIfDeclaredOverAgeData {
    pub access: crate::app::bsky::ageassurance::defs::Access,
    ///The age threshold as a whole integer.
    pub age: i64,
}
pub type ConfigRegionRuleIfDeclaredOverAge = crate::types::Object<
    ConfigRegionRuleIfDeclaredOverAgeData,
>;
///Age Assurance rule that applies if the user has declared themselves under a certain age.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct ConfigRegionRuleIfDeclaredUnderAgeData {
    pub access: crate::app::bsky::ageassurance::defs::Access,
    ///The age threshold as a whole integer.
    pub age: i64,
}
pub type ConfigRegionRuleIfDeclaredUnderAge = crate::types::Object<
    ConfigRegionRuleIfDeclaredUnderAgeData,
>;
///Object used to store Age Assurance data in stash.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct EventData {
    ///The access level granted based on Age Assurance data we've processed.
    pub access: String,
    ///The unique identifier for this instance of the Age Assurance flow, in UUID format.
    pub attempt_id: String,
    ///The IP address used when completing the Age Assurance flow.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub complete_ip: core::option::Option<String>,
    ///The user agent used when completing the Age Assurance flow.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub complete_ua: core::option::Option<String>,
    ///The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow.
    pub country_code: String,
    ///The date and time of this write operation.
    pub created_at: crate::types::string::Datetime,
    ///The email used for Age Assurance.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub email: core::option::Option<String>,
    ///The IP address used when initiating the Age Assurance flow.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub init_ip: core::option::Option<String>,
    ///The user agent used when initiating the Age Assurance flow.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub init_ua: core::option::Option<String>,
    ///The ISO 3166-2 region code provided when beginning the Age Assurance flow.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub region_code: core::option::Option<String>,
    ///The status of the Age Assurance process.
    pub status: String,
}
pub type Event = crate::types::Object<EventData>;
///The user's computed Age Assurance state.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct StateData {
    pub access: crate::app::bsky::ageassurance::defs::Access,
    ///The timestamp when this state was last updated.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub last_initiated_at: core::option::Option<crate::types::string::Datetime>,
    pub status: crate::app::bsky::ageassurance::defs::Status,
}
pub type State = crate::types::Object<StateData>;
///Additional metadata needed to compute Age Assurance state client-side.
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(rename_all = "camelCase")]
pub struct StateMetadataData {
    ///The account creation timestamp.
    #[serde(skip_serializing_if = "core::option::Option::is_none")]
    pub account_created_at: core::option::Option<crate::types::string::Datetime>,
}
pub type StateMetadata = crate::types::Object<StateMetadataData>;
///The status of the Age Assurance process.
pub type Status = String;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
#[serde(tag = "$type")]
pub enum ConfigRegionRulesItem {
    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleDefault")]
    ConfigRegionRuleDefault(Box<ConfigRegionRuleDefault>),
    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredOverAge")]
    ConfigRegionRuleIfDeclaredOverAge(Box<ConfigRegionRuleIfDeclaredOverAge>),
    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredUnderAge")]
    ConfigRegionRuleIfDeclaredUnderAge(Box<ConfigRegionRuleIfDeclaredUnderAge>),
    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfAssuredOverAge")]
    ConfigRegionRuleIfAssuredOverAge(Box<ConfigRegionRuleIfAssuredOverAge>),
    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfAssuredUnderAge")]
    ConfigRegionRuleIfAssuredUnderAge(Box<ConfigRegionRuleIfAssuredUnderAge>),
    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfAccountNewerThan")]
    ConfigRegionRuleIfAccountNewerThan(Box<ConfigRegionRuleIfAccountNewerThan>),
    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfAccountOlderThan")]
    ConfigRegionRuleIfAccountOlderThan(Box<ConfigRegionRuleIfAccountOlderThan>),
}