Skip to main content

atrium_api/app/bsky/ageassurance/
defs.rs

1// @generated - This file is generated by atrium-codegen. DO NOT EDIT.
2//!Definitions for the `app.bsky.ageassurance.defs` namespace.
3///The access level granted based on Age Assurance data we've processed.
4pub type Access = String;
5#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
6#[serde(rename_all = "camelCase")]
7pub struct ConfigData {
8    ///The per-region Age Assurance configuration.
9    pub regions: Vec<crate::app::bsky::ageassurance::defs::ConfigRegion>,
10}
11pub type Config = crate::types::Object<ConfigData>;
12///The Age Assurance configuration for a specific region.
13#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
14#[serde(rename_all = "camelCase")]
15pub struct ConfigRegionData {
16    ///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).
17    #[serde(skip_serializing_if = "core::option::Option::is_none")]
18    pub additional_verification_methods: core::option::Option<Vec<String>>,
19    ///The ISO 3166-1 alpha-2 country code this configuration applies to.
20    pub country_code: String,
21    ///The minimum age (as a whole integer) required to use Bluesky in this region.
22    pub min_access_age: i64,
23    ///The platforms this configuration applies to. If omitted, the configuration applies to all platforms.
24    #[serde(skip_serializing_if = "core::option::Option::is_none")]
25    pub platforms: core::option::Option<Vec<String>>,
26    ///The ISO 3166-2 region code this configuration applies to. If omitted, the configuration applies to the entire country.
27    #[serde(skip_serializing_if = "core::option::Option::is_none")]
28    pub region_code: core::option::Option<String>,
29    ///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.
30    pub rules: Vec<crate::types::Union<ConfigRegionRulesItem>>,
31}
32pub type ConfigRegion = crate::types::Object<ConfigRegionData>;
33///Age Assurance rule that applies by default.
34#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
35#[serde(rename_all = "camelCase")]
36pub struct ConfigRegionRuleDefaultData {
37    pub access: crate::app::bsky::ageassurance::defs::Access,
38}
39pub type ConfigRegionRuleDefault = crate::types::Object<ConfigRegionRuleDefaultData>;
40///Age Assurance rule that applies if the account is equal-to or newer than a certain date.
41#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
42#[serde(rename_all = "camelCase")]
43pub struct ConfigRegionRuleIfAccountNewerThanData {
44    pub access: crate::app::bsky::ageassurance::defs::Access,
45    ///The date threshold as a datetime string.
46    pub date: crate::types::string::Datetime,
47}
48pub type ConfigRegionRuleIfAccountNewerThan = crate::types::Object<
49    ConfigRegionRuleIfAccountNewerThanData,
50>;
51///Age Assurance rule that applies if the account is older than a certain date.
52#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
53#[serde(rename_all = "camelCase")]
54pub struct ConfigRegionRuleIfAccountOlderThanData {
55    pub access: crate::app::bsky::ageassurance::defs::Access,
56    ///The date threshold as a datetime string.
57    pub date: crate::types::string::Datetime,
58}
59pub type ConfigRegionRuleIfAccountOlderThan = crate::types::Object<
60    ConfigRegionRuleIfAccountOlderThanData,
61>;
62///Age Assurance rule that applies if the user has been assured to be equal-to or over a certain age.
63#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
64#[serde(rename_all = "camelCase")]
65pub struct ConfigRegionRuleIfAssuredOverAgeData {
66    pub access: crate::app::bsky::ageassurance::defs::Access,
67    ///The age threshold as a whole integer.
68    pub age: i64,
69}
70pub type ConfigRegionRuleIfAssuredOverAge = crate::types::Object<
71    ConfigRegionRuleIfAssuredOverAgeData,
72>;
73///Age Assurance rule that applies if the user has been assured to be under a certain age.
74#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
75#[serde(rename_all = "camelCase")]
76pub struct ConfigRegionRuleIfAssuredUnderAgeData {
77    pub access: crate::app::bsky::ageassurance::defs::Access,
78    ///The age threshold as a whole integer.
79    pub age: i64,
80}
81pub type ConfigRegionRuleIfAssuredUnderAge = crate::types::Object<
82    ConfigRegionRuleIfAssuredUnderAgeData,
83>;
84///Age Assurance rule that applies if the user has declared themselves equal-to or over a certain age.
85#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
86#[serde(rename_all = "camelCase")]
87pub struct ConfigRegionRuleIfDeclaredOverAgeData {
88    pub access: crate::app::bsky::ageassurance::defs::Access,
89    ///The age threshold as a whole integer.
90    pub age: i64,
91}
92pub type ConfigRegionRuleIfDeclaredOverAge = crate::types::Object<
93    ConfigRegionRuleIfDeclaredOverAgeData,
94>;
95///Age Assurance rule that applies if the user has declared themselves under a certain age.
96#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
97#[serde(rename_all = "camelCase")]
98pub struct ConfigRegionRuleIfDeclaredUnderAgeData {
99    pub access: crate::app::bsky::ageassurance::defs::Access,
100    ///The age threshold as a whole integer.
101    pub age: i64,
102}
103pub type ConfigRegionRuleIfDeclaredUnderAge = crate::types::Object<
104    ConfigRegionRuleIfDeclaredUnderAgeData,
105>;
106///Object used to store Age Assurance data in stash.
107#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
108#[serde(rename_all = "camelCase")]
109pub struct EventData {
110    ///The access level granted based on Age Assurance data we've processed.
111    pub access: String,
112    ///The unique identifier for this instance of the Age Assurance flow, in UUID format.
113    pub attempt_id: String,
114    ///The IP address used when completing the Age Assurance flow.
115    #[serde(skip_serializing_if = "core::option::Option::is_none")]
116    pub complete_ip: core::option::Option<String>,
117    ///The user agent used when completing the Age Assurance flow.
118    #[serde(skip_serializing_if = "core::option::Option::is_none")]
119    pub complete_ua: core::option::Option<String>,
120    ///The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow.
121    pub country_code: String,
122    ///The date and time of this write operation.
123    pub created_at: crate::types::string::Datetime,
124    ///The email used for Age Assurance.
125    #[serde(skip_serializing_if = "core::option::Option::is_none")]
126    pub email: core::option::Option<String>,
127    ///The IP address used when initiating the Age Assurance flow.
128    #[serde(skip_serializing_if = "core::option::Option::is_none")]
129    pub init_ip: core::option::Option<String>,
130    ///The user agent used when initiating the Age Assurance flow.
131    #[serde(skip_serializing_if = "core::option::Option::is_none")]
132    pub init_ua: core::option::Option<String>,
133    ///The ISO 3166-2 region code provided when beginning the Age Assurance flow.
134    #[serde(skip_serializing_if = "core::option::Option::is_none")]
135    pub region_code: core::option::Option<String>,
136    ///The status of the Age Assurance process.
137    pub status: String,
138}
139pub type Event = crate::types::Object<EventData>;
140///The user's computed Age Assurance state.
141#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
142#[serde(rename_all = "camelCase")]
143pub struct StateData {
144    pub access: crate::app::bsky::ageassurance::defs::Access,
145    ///The timestamp when this state was last updated.
146    #[serde(skip_serializing_if = "core::option::Option::is_none")]
147    pub last_initiated_at: core::option::Option<crate::types::string::Datetime>,
148    pub status: crate::app::bsky::ageassurance::defs::Status,
149}
150pub type State = crate::types::Object<StateData>;
151///Additional metadata needed to compute Age Assurance state client-side.
152#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
153#[serde(rename_all = "camelCase")]
154pub struct StateMetadataData {
155    ///The account creation timestamp.
156    #[serde(skip_serializing_if = "core::option::Option::is_none")]
157    pub account_created_at: core::option::Option<crate::types::string::Datetime>,
158}
159pub type StateMetadata = crate::types::Object<StateMetadataData>;
160///The status of the Age Assurance process.
161pub type Status = String;
162#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)]
163#[serde(tag = "$type")]
164pub enum ConfigRegionRulesItem {
165    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleDefault")]
166    ConfigRegionRuleDefault(Box<ConfigRegionRuleDefault>),
167    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredOverAge")]
168    ConfigRegionRuleIfDeclaredOverAge(Box<ConfigRegionRuleIfDeclaredOverAge>),
169    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfDeclaredUnderAge")]
170    ConfigRegionRuleIfDeclaredUnderAge(Box<ConfigRegionRuleIfDeclaredUnderAge>),
171    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfAssuredOverAge")]
172    ConfigRegionRuleIfAssuredOverAge(Box<ConfigRegionRuleIfAssuredOverAge>),
173    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfAssuredUnderAge")]
174    ConfigRegionRuleIfAssuredUnderAge(Box<ConfigRegionRuleIfAssuredUnderAge>),
175    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfAccountNewerThan")]
176    ConfigRegionRuleIfAccountNewerThan(Box<ConfigRegionRuleIfAccountNewerThan>),
177    #[serde(rename = "app.bsky.ageassurance.defs#configRegionRuleIfAccountOlderThan")]
178    ConfigRegionRuleIfAccountOlderThan(Box<ConfigRegionRuleIfAccountOlderThan>),
179}