diff --git a/AGENTS.md b/AGENTS.md index 460020c..fbcda2e 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -20,7 +20,7 @@ teal/ │ ├── satellite/ # Processing service │ ├── types/ # Shared types │ └── migrations/ # SQLx migrations -├── lexicons/fm.teal.alpha/ # AT Protocol schemas +├── lexicons/fm.teal/ # AT Protocol schemas │ ├── feed/ # Music play types │ ├── actor/ # Profile types │ └── stats/ # Analytics @@ -53,7 +53,7 @@ profiles (did TEXT, display_name TEXT, description TEXT, avatar BLOB, banner BLO ``` ## AT Protocol Integration -### Music Play Schema (`fm.teal.alpha.feed.play`) +### Music Play Schema (`fm.teal.feed.play`) ```json { "trackName": "string (required)", @@ -66,7 +66,7 @@ profiles (did TEXT, display_name TEXT, description TEXT, avatar BLOB, banner BLO } ``` -### Profile Schema (`fm.teal.alpha.actor.profile`) +### Profile Schema (`fm.teal.actor.profile`) ```json { "displayName": "string", "description": "string", diff --git a/apps/amethyst/app/(tabs)/(stamp)/stamp/submit.tsx b/apps/amethyst/app/(tabs)/(stamp)/stamp/submit.tsx index 948cdd1..0d66312 100644 --- a/apps/amethyst/app/(tabs)/(stamp)/stamp/submit.tsx +++ b/apps/amethyst/app/(tabs)/(stamp)/stamp/submit.tsx @@ -16,11 +16,11 @@ import { RichText, } from "@atproto/api"; -import { Artist } from "@teal/lexicons/src/types/fm/teal/alpha/feed/defs"; +import { Artist } from "@teal/lexicons/src/types/fm/teal/feed/defs"; import { Record as PlayRecord, validateRecord, -} from "@teal/lexicons/src/types/fm/teal/alpha/feed/play"; +} from "@teal/lexicons/src/types/fm/teal/feed/play"; import { StampContext, StampContextValue, StampStep } from "./_layout"; @@ -246,7 +246,7 @@ powered by @teal.fm`; {}, { repo: agent.did, - collection: "fm.teal.alpha.feed.play", + collection: "fm.teal.feed.play", rkey: undefined, record, }, diff --git a/apps/amethyst/app/(tabs)/index.tsx b/apps/amethyst/app/(tabs)/index.tsx index 3b029d8..822bd96 100644 --- a/apps/amethyst/app/(tabs)/index.tsx +++ b/apps/amethyst/app/(tabs)/index.tsx @@ -5,7 +5,7 @@ import { Redirect, Stack, useRouter } from "expo-router"; import ActorView from "@/components/actor/actorView"; import { useStore } from "@/stores/mainStore"; -import { Record as ProfileStatusRecord } from "@teal/lexicons/src/types/fm/teal/alpha/actor/profileStatus"; +import { Record as ProfileStatusRecord } from "@teal/lexicons/src/types/fm/teal/actor/profileStatus"; import AuthOptions from "../auth/options"; @@ -28,7 +28,7 @@ export default function Screen() { const res = await agent.call("com.atproto.repo.getRecord", { repo: agent.did, - collection: "fm.teal.alpha.actor.profileStatus", + collection: "fm.teal.actor.profileStatus", rkey: "self", }); diff --git a/apps/amethyst/app/(tabs)/search/index.tsx b/apps/amethyst/app/(tabs)/search/index.tsx index 3388a16..0e96c5f 100644 --- a/apps/amethyst/app/(tabs)/search/index.tsx +++ b/apps/amethyst/app/(tabs)/search/index.tsx @@ -7,8 +7,8 @@ import { Text } from "@/components/ui/text"; import getImageCdnLink from "@/lib/atp/getImageCdnLink"; import { useStore } from "@/stores/mainStore"; -import { MiniProfileView } from "@teal/lexicons/src/types/fm/teal/alpha/actor/defs"; -import { OutputSchema as SearchActorsOutputSchema } from "@teal/lexicons/src/types/fm/teal/alpha/actor/searchActors"; +import { MiniProfileView } from "@teal/lexicons/src/types/fm/teal/actor/defs"; +import { OutputSchema as SearchActorsOutputSchema } from "@teal/lexicons/src/types/fm/teal/actor/searchActors"; export default function Search() { const [searchQuery, setSearchQuery] = React.useState(""); @@ -28,7 +28,7 @@ export default function Search() { } try { let res = await agent.call( - "fm.teal.alpha.actor.searchActors", + "fm.teal.actor.searchActors", { q: searchQuery }, {}, { headers: { "atproto-proxy": tealDid + "#teal_fm_appview" } }, diff --git a/apps/amethyst/app/onboarding/index.tsx b/apps/amethyst/app/onboarding/index.tsx index 11bbc5f..824a219 100644 --- a/apps/amethyst/app/onboarding/index.tsx +++ b/apps/amethyst/app/onboarding/index.tsx @@ -7,8 +7,8 @@ import { Text } from "@/components/ui/text"; // Your UI components import { useStore } from "@/stores/mainStore"; -import { Record as ProfileRecord } from "@teal/lexicons/src/types/fm/teal/alpha/actor/profile"; -import { Record as ProfileStatusRecord } from "@teal/lexicons/src/types/fm/teal/alpha/actor/profileStatus"; +import { Record as ProfileRecord } from "@teal/lexicons/src/types/fm/teal/actor/profile"; +import { Record as ProfileStatusRecord } from "@teal/lexicons/src/types/fm/teal/actor/profileStatus"; import DescriptionPage from "./descriptionPage"; import DisplayNamePage from "./displayNamePage"; @@ -50,7 +50,7 @@ export default function OnboardingPage() { try { const res = await agent.call("com.atproto.repo.getRecord", { repo: agent.did, - collection: "fm.teal.alpha.actor.profileStatus", + collection: "fm.teal.actor.profileStatus", rkey: "self", }); setProfileStatus(res.data.value as ProfileStatusRecord); @@ -96,7 +96,7 @@ export default function OnboardingPage() { try { const res = await agent.call("com.atproto.repo.getRecord", { repo: agent.did, - collection: "fm.teal.alpha.actor.profile", + collection: "fm.teal.actor.profile", rkey: "self", }); currentUser = res.data.value; @@ -144,7 +144,7 @@ export default function OnboardingPage() { {}, { repo: agent.did, - collection: "fm.teal.alpha.actor.profile", + collection: "fm.teal.actor.profile", rkey: "self", record, swapRecord: cid, @@ -156,7 +156,7 @@ export default function OnboardingPage() { {}, { repo: agent.did, - collection: "fm.teal.alpha.actor.profile", + collection: "fm.teal.actor.profile", rkey: "self", record, }, @@ -176,7 +176,7 @@ export default function OnboardingPage() { {}, { repo: agent.did, - collection: "fm.teal.alpha.actor.profileStatus", + collection: "fm.teal.actor.profileStatus", rkey: "self", record: profileStatusRecord, }, @@ -189,7 +189,7 @@ export default function OnboardingPage() { {}, { repo: agent.did, - collection: "fm.teal.alpha.actor.profileStatus", + collection: "fm.teal.actor.profileStatus", rkey: "self", record: { ...profileStatusRecord, diff --git a/apps/amethyst/components/actor/actorView.tsx b/apps/amethyst/components/actor/actorView.tsx index 99fa74a..0cb9645 100644 --- a/apps/amethyst/components/actor/actorView.tsx +++ b/apps/amethyst/components/actor/actorView.tsx @@ -10,8 +10,8 @@ import { useStore } from "@/stores/mainStore"; import { Agent } from "@atproto/api"; import { MoreHorizontal, Pen, Plus } from "lucide-react-native"; -import { OutputSchema as GetProfileOutputSchema } from "@teal/lexicons/src/types/fm/teal/alpha/actor/getProfile"; -import { Record as ProfileRecord } from "@teal/lexicons/src/types/fm/teal/alpha/actor/profile"; +import { OutputSchema as GetProfileOutputSchema } from "@teal/lexicons/src/types/fm/teal/actor/getProfile"; +import { Record as ProfileRecord } from "@teal/lexicons/src/types/fm/teal/actor/profile"; import { CardTitle } from "../../components/ui/card"; import EditProfileModal from "./editProfileView"; @@ -41,7 +41,7 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) { } try { let res = await pdsAgent.call( - "fm.teal.alpha.actor.getProfile", + "fm.teal.actor.getProfile", { actor: actorDid }, {}, { headers: { "atproto-proxy": tealDid + "#teal_fm_appview" } }, @@ -86,7 +86,7 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) { try { const res = await pdsAgent.call("com.atproto.repo.getRecord", { repo: pdsAgent.did, - collection: "fm.teal.alpha.actor.profile", + collection: "fm.teal.actor.profile", rkey: "self", }); currentUser = res.data.value; @@ -131,7 +131,7 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) { {}, { repo: pdsAgent.did, - collection: "fm.teal.alpha.actor.profile", + collection: "fm.teal.actor.profile", rkey: "self", record, swapRecord: cid, @@ -143,7 +143,7 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) { {}, { repo: pdsAgent.did, - collection: "fm.teal.alpha.actor.profile", + collection: "fm.teal.actor.profile", rkey: "self", record, }, diff --git a/apps/amethyst/components/play/actorPlaysView.tsx b/apps/amethyst/components/play/actorPlaysView.tsx index b695875..9d84627 100644 --- a/apps/amethyst/components/play/actorPlaysView.tsx +++ b/apps/amethyst/components/play/actorPlaysView.tsx @@ -4,7 +4,7 @@ import { Text } from "@/components/ui/text"; import { useStore } from "@/stores/mainStore"; import { Agent } from "@atproto/api"; -import { OutputSchema as ActorFeedResponse } from "@teal/lexicons/src/types/fm/teal/alpha/feed/getActorFeed"; +import { OutputSchema as ActorFeedResponse } from "@teal/lexicons/src/types/fm/teal/feed/getActorFeed"; import PlayView from "./playView"; @@ -20,7 +20,7 @@ const ActorPlaysView = ({ repo, pdsAgent }: ActorPlaysViewProps) => { if (pdsAgent) { pdsAgent .call( - "fm.teal.alpha.feed.getActorFeed", + "fm.teal.feed.getActorFeed", { authorDID: repo }, {}, { headers: { "atproto-proxy": tealDid + "#teal_fm_appview" } }, diff --git a/apps/amethyst/lib/oldStamp.tsx b/apps/amethyst/lib/oldStamp.tsx index 8fa9030..c10a773 100644 --- a/apps/amethyst/lib/oldStamp.tsx +++ b/apps/amethyst/lib/oldStamp.tsx @@ -1,4 +1,4 @@ -import { Record as PlayRecord } from "@teal/lexicons/src/types/fm/teal/alpha/feed/play"; +import { Record as PlayRecord } from "@teal/lexicons/src/types/fm/teal/feed/play"; // Re-export searchMusicbrainz from the orchestrator module. // This keeps backward compatibility for existing imports. diff --git a/apps/amethyst/stores/authenticationSlice.tsx b/apps/amethyst/stores/authenticationSlice.tsx index e962f7c..d117cef 100644 --- a/apps/amethyst/stores/authenticationSlice.tsx +++ b/apps/amethyst/stores/authenticationSlice.tsx @@ -3,7 +3,7 @@ import { Agent, type AppBskyActorDefs } from "@atproto/api"; import { OAuthSession } from "@atproto/oauth-client"; import * as Lexicons from "@teal/lexicons/src/lexicons"; -import { OutputSchema as GetProfileOutputSchema } from "@teal/lexicons/src/types/fm/teal/alpha/actor/getProfile"; +import { OutputSchema as GetProfileOutputSchema } from "@teal/lexicons/src/types/fm/teal/actor/getProfile"; import createOAuthClient, { AquareumOAuthClient } from "../lib/atp/oauth"; import { StateCreator } from "./mainStore"; @@ -185,7 +185,7 @@ export const createAuthenticationSlice: StateCreator = ( let tealDid = get().tealDid; let tealProfile = await agent .call( - "fm.teal.alpha.actor.getProfile", + "fm.teal.actor.getProfile", { actor: agent?.did }, {}, { headers: { "atproto-proxy": tealDid + "#teal_fm_appview" } }, diff --git a/apps/aqua/src/repos/actor_profile.rs b/apps/aqua/src/repos/actor_profile.rs index c701df6..642d8d5 100644 --- a/apps/aqua/src/repos/actor_profile.rs +++ b/apps/aqua/src/repos/actor_profile.rs @@ -3,7 +3,7 @@ use jacquard_common::from_json_value; use serde_json::Value; use types::{ app_bsky::richtext::facet::Facet, - fm_teal::alpha::actor::{ProfileView, StatusView}, + fm_teal::actor::{ProfileView, StatusView}, }; use super::{pg::PgDataSource, utc_to_atrium_datetime}; diff --git a/apps/aqua/src/repos/feed_play.rs b/apps/aqua/src/repos/feed_play.rs index 2f95a57..7c8f32d 100644 --- a/apps/aqua/src/repos/feed_play.rs +++ b/apps/aqua/src/repos/feed_play.rs @@ -1,6 +1,6 @@ use async_trait::async_trait; use jacquard_common::from_json_value; -use types::fm_teal::alpha::feed::{Artist, PlayView}; +use types::fm_teal::feed::{Artist, PlayView}; use super::{mbid_uri, pg::PgDataSource, utc_to_atrium_datetime}; diff --git a/apps/aqua/src/repos/stats.rs b/apps/aqua/src/repos/stats.rs index 0049671..0293e41 100644 --- a/apps/aqua/src/repos/stats.rs +++ b/apps/aqua/src/repos/stats.rs @@ -1,7 +1,7 @@ use async_trait::async_trait; use jacquard_common::from_json_value; -use types::fm_teal::alpha::feed::PlayView; -use types::fm_teal::alpha::stats::{ArtistView, ReleaseView}; +use types::fm_teal::feed::PlayView; +use types::fm_teal::stats::{ArtistView, ReleaseView}; use super::{mbid_uri, pg::PgDataSource, utc_to_atrium_datetime}; @@ -216,7 +216,7 @@ impl StatsRepo for PgDataSource { let mut result = Vec::with_capacity(rows.len()); for row in rows { let artists = match row.artists { - Some(value) => from_json_value::>(value) + Some(value) => from_json_value::>(value) .unwrap_or_default(), None => vec![], }; diff --git a/apps/aqua/src/xrpc/actor.rs b/apps/aqua/src/xrpc/actor.rs index b23cf43..67282af 100644 --- a/apps/aqua/src/xrpc/actor.rs +++ b/apps/aqua/src/xrpc/actor.rs @@ -2,13 +2,13 @@ use crate::ctx::Context; use axum::{Extension, http::StatusCode, response::IntoResponse, routing::get}; use jacquard_common::IntoStatic; use serde::{Deserialize, Serialize}; -use types::fm_teal::alpha::actor::ProfileView; +use types::fm_teal::actor::ProfileView; // mount actor routes pub fn actor_routes() -> axum::Router { axum::Router::new() - .route("/fm.teal.alpha.actor.getProfile", get(get_actor)) - .route("/fm.teal.alpha.actor.getProfiles", get(get_actors)) + .route("/fm.teal.actor.getProfile", get(get_actor)) + .route("/fm.teal.actor.getProfiles", get(get_actors)) } #[derive(Deserialize)] diff --git a/apps/aqua/src/xrpc/feed.rs b/apps/aqua/src/xrpc/feed.rs index b9fa97f..b81c598 100644 --- a/apps/aqua/src/xrpc/feed.rs +++ b/apps/aqua/src/xrpc/feed.rs @@ -2,13 +2,13 @@ use crate::ctx::Context; use axum::{Extension, http::StatusCode, response::IntoResponse, routing::get}; use jacquard_common::IntoStatic; use serde::{Deserialize, Serialize}; -use types::fm_teal::alpha::feed::PlayView; +use types::fm_teal::feed::PlayView; // mount feed routes pub fn feed_routes() -> axum::Router { axum::Router::new() - .route("/fm.teal.alpha.feed.getPlay", get(get_feed_play)) - .route("/fm.teal.alpha.feed.getPlays", get(get_feed_plays)) + .route("/fm.teal.feed.getPlay", get(get_feed_play)) + .route("/fm.teal.feed.getPlays", get(get_feed_plays)) } #[derive(Deserialize)] diff --git a/apps/aqua/src/xrpc/stats.rs b/apps/aqua/src/xrpc/stats.rs index 2b46dc7..423330e 100644 --- a/apps/aqua/src/xrpc/stats.rs +++ b/apps/aqua/src/xrpc/stats.rs @@ -2,23 +2,23 @@ use crate::ctx::Context; use axum::{Extension, http::StatusCode, response::IntoResponse, routing::get}; use jacquard_common::IntoStatic; use serde::{Deserialize, Serialize}; -use types::fm_teal::alpha::feed::PlayView; -use types::fm_teal::alpha::stats::{ArtistView, ReleaseView}; +use types::fm_teal::feed::PlayView; +use types::fm_teal::stats::{ArtistView, ReleaseView}; // mount stats routes pub fn stats_routes() -> axum::Router { axum::Router::new() - .route("/fm.teal.alpha.stats.getTopArtists", get(get_top_artists)) - .route("/fm.teal.alpha.stats.getTopReleases", get(get_top_releases)) + .route("/fm.teal.stats.getTopArtists", get(get_top_artists)) + .route("/fm.teal.stats.getTopReleases", get(get_top_releases)) .route( - "/fm.teal.alpha.stats.getUserTopArtists", + "/fm.teal.stats.getUserTopArtists", get(get_user_top_artists), ) .route( - "/fm.teal.alpha.stats.getUserTopReleases", + "/fm.teal.stats.getUserTopReleases", get(get_user_top_releases), ) - .route("/fm.teal.alpha.stats.getLatest", get(get_latest)) + .route("/fm.teal.stats.getLatest", get(get_latest)) } #[derive(Deserialize)] diff --git a/claude.md b/claude.md index 1fcd3d2..d3c2e34 100644 --- a/claude.md +++ b/claude.md @@ -20,7 +20,7 @@ teal/ │ ├── satellite/ # Processing service │ ├── types/ # Shared types │ └── migrations/ # SQLx migrations -├── lexicons/fm.teal.alpha/ # AT Protocol schemas +├── lexicons/fm.teal/ # AT Protocol schemas │ ├── feed/ # Music play types │ ├── actor/ # Profile types │ └── stats/ # Analytics @@ -53,7 +53,7 @@ profiles (did TEXT, display_name TEXT, description TEXT, avatar BLOB, banner BLO ``` ## AT Protocol Integration -### Music Play Schema (`fm.teal.alpha.feed.play`) +### Music Play Schema (`fm.teal.feed.play`) ```json { "trackName": "string (required)", @@ -66,7 +66,7 @@ profiles (did TEXT, display_name TEXT, description TEXT, avatar BLOB, banner BLO } ``` -### Profile Schema (`fm.teal.alpha.actor.profile`) +### Profile Schema (`fm.teal.actor.profile`) ```json { "displayName": "string", "description": "string", diff --git a/lexicons/README.md b/lexicons/README.md index 1e94fcc..cfdfc17 100644 --- a/lexicons/README.md +++ b/lexicons/README.md @@ -5,7 +5,7 @@ This directory contains ATProto lexicon definitions used by the Teal project. ## Structure - `app/`, `chat/`, `com/`, `tools/` - Symbolic links to the official ATProto lexicons from the [bluesky-social/atproto](https://github.com/bluesky-social/atproto) repository -- `fm.teal.alpha/` - Custom Teal-specific lexicon definitions +- `fm.teal/` - Custom Teal-specific lexicon definitions ## Submodule Setup @@ -116,6 +116,6 @@ echo "Lexicons setup complete!" ### Adding Custom Lexicons -Custom lexicons should be added to the `fm.teal.alpha/` directory following the ATProto lexicon schema format. These files are tracked directly in our repository and not affected by submodule updates. +Custom lexicons should be added to the `fm.teal/` directory following the ATProto lexicon schema format. These files are tracked directly in our repository and not affected by submodule updates. **Note**: The symbolic links (`app`, `chat`, `com`, `tools`) are not tracked in git and will be created during setup. They are ignored in `.gitignore` to avoid conflicts. diff --git a/lexicons/fm.teal.alpha/actor/defs.json b/lexicons/fm.teal/actor/defs.json similarity index 93% rename from lexicons/fm.teal.alpha/actor/defs.json rename to lexicons/fm.teal/actor/defs.json index 1a2d912..4838bd2 100644 --- a/lexicons/fm.teal.alpha/actor/defs.json +++ b/lexicons/fm.teal/actor/defs.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.actor.defs", + "id": "fm.teal.actor.defs", "defs": { "profileView": { "type": "object", @@ -24,7 +24,7 @@ "featuredItem": { "type": "ref", "description": "The user's most recent item featured on their profile.", - "ref": "fm.teal.alpha.actor.profile#featuredItem" + "ref": "fm.teal.actor.profile#featuredItem" }, "avatar": { "type": "string", @@ -76,7 +76,7 @@ }, "item": { "type": "ref", - "ref": "fm.teal.alpha.feed.defs#playView" + "ref": "fm.teal.feed.defs#playView" } } } diff --git a/lexicons/fm.teal.alpha/actor/getProfile.json b/lexicons/fm.teal/actor/getProfile.json similarity index 88% rename from lexicons/fm.teal.alpha/actor/getProfile.json rename to lexicons/fm.teal/actor/getProfile.json index 6f2987d..bfefa07 100644 --- a/lexicons/fm.teal.alpha/actor/getProfile.json +++ b/lexicons/fm.teal/actor/getProfile.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.actor.getProfile", + "id": "fm.teal.actor.getProfile", "description": "This lexicon is in a not officially released state. It is subject to change. | Retrieves a play given an author DID and record key.", "defs": { "main": { @@ -24,7 +24,7 @@ "properties": { "actor": { "type": "ref", - "ref": "fm.teal.alpha.actor.defs#profileView" + "ref": "fm.teal.actor.defs#profileView" } } } diff --git a/lexicons/fm.teal.alpha/actor/getProfiles.json b/lexicons/fm.teal/actor/getProfiles.json similarity index 89% rename from lexicons/fm.teal.alpha/actor/getProfiles.json rename to lexicons/fm.teal/actor/getProfiles.json index 0d33064..45aee65 100644 --- a/lexicons/fm.teal.alpha/actor/getProfiles.json +++ b/lexicons/fm.teal/actor/getProfiles.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.actor.getProfiles", + "id": "fm.teal.actor.getProfiles", "description": "This lexicon is in a not officially released state. It is subject to change. | Retrieves the associated profile.", "defs": { "main": { @@ -29,7 +29,7 @@ "type": "array", "items": { "type": "ref", - "ref": "fm.teal.alpha.actor.defs#miniProfileView" + "ref": "fm.teal.actor.defs#miniProfileView" } } } diff --git a/lexicons/fm.teal.alpha/actor/profile.json b/lexicons/fm.teal/actor/profile.json similarity index 98% rename from lexicons/fm.teal.alpha/actor/profile.json rename to lexicons/fm.teal/actor/profile.json index 42e8350..87434b0 100644 --- a/lexicons/fm.teal.alpha/actor/profile.json +++ b/lexicons/fm.teal/actor/profile.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.actor.profile", + "id": "fm.teal.actor.profile", "defs": { "main": { "type": "record", diff --git a/lexicons/fm.teal.alpha/actor/profileStatus.json b/lexicons/fm.teal/actor/profileStatus.json similarity index 95% rename from lexicons/fm.teal.alpha/actor/profileStatus.json rename to lexicons/fm.teal/actor/profileStatus.json index da15287..28b57c3 100644 --- a/lexicons/fm.teal.alpha/actor/profileStatus.json +++ b/lexicons/fm.teal/actor/profileStatus.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.actor.profileStatus", + "id": "fm.teal.actor.profileStatus", "defs": { "main": { "type": "record", diff --git a/lexicons/fm.teal.alpha/actor/searchActors.json b/lexicons/fm.teal/actor/searchActors.json similarity index 92% rename from lexicons/fm.teal.alpha/actor/searchActors.json rename to lexicons/fm.teal/actor/searchActors.json index 8f4b2fa..16d6b84 100644 --- a/lexicons/fm.teal.alpha/actor/searchActors.json +++ b/lexicons/fm.teal/actor/searchActors.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.actor.searchActors", + "id": "fm.teal.actor.searchActors", "description": "This lexicon is in a not officially released state. It is subject to change. | Searches for actors based on profile contents.", "defs": { "main": { @@ -37,7 +37,7 @@ "type": "array", "items": { "type": "ref", - "ref": "fm.teal.alpha.actor.defs#miniProfileView" + "ref": "fm.teal.actor.defs#miniProfileView" } }, "cursor": { diff --git a/lexicons/fm.teal.alpha/actor/status.json b/lexicons/fm.teal/actor/status.json similarity index 91% rename from lexicons/fm.teal.alpha/actor/status.json rename to lexicons/fm.teal/actor/status.json index ff3761a..a034f74 100644 --- a/lexicons/fm.teal.alpha/actor/status.json +++ b/lexicons/fm.teal/actor/status.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.actor.status", + "id": "fm.teal.actor.status", "defs": { "main": { "type": "record", @@ -22,7 +22,7 @@ }, "item": { "type": "ref", - "ref": "fm.teal.alpha.feed.defs#playView" + "ref": "fm.teal.feed.defs#playView" } } } diff --git a/lexicons/fm.teal.alpha/feed/defs.json b/lexicons/fm.teal/feed/defs.json similarity index 98% rename from lexicons/fm.teal.alpha/feed/defs.json rename to lexicons/fm.teal/feed/defs.json index ee26698..2e932d6 100644 --- a/lexicons/fm.teal.alpha/feed/defs.json +++ b/lexicons/fm.teal/feed/defs.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.feed.defs", + "id": "fm.teal.feed.defs", "description": "This lexicon is in a not officially released state. It is subject to change. | Misc. items related to feeds.", "defs": { "playView": { diff --git a/lexicons/fm.teal.alpha/feed/getActorFeed.json b/lexicons/fm.teal/feed/getActorFeed.json similarity index 92% rename from lexicons/fm.teal.alpha/feed/getActorFeed.json rename to lexicons/fm.teal/feed/getActorFeed.json index 51b6c9d..dfe0200 100644 --- a/lexicons/fm.teal.alpha/feed/getActorFeed.json +++ b/lexicons/fm.teal/feed/getActorFeed.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.feed.getActorFeed", + "id": "fm.teal.feed.getActorFeed", "description": "This lexicon is in a not officially released state. It is subject to change. | Retrieves multiple plays from the index or via an author's DID.", "defs": { "main": { @@ -34,7 +34,7 @@ "type": "array", "items": { "type": "ref", - "ref": "fm.teal.alpha.feed.defs#playView" + "ref": "fm.teal.feed.defs#playView" } } } diff --git a/lexicons/fm.teal.alpha/feed/getPlay.json b/lexicons/fm.teal/feed/getPlay.json similarity index 90% rename from lexicons/fm.teal.alpha/feed/getPlay.json rename to lexicons/fm.teal/feed/getPlay.json index 5ceba07..8d26ffa 100644 --- a/lexicons/fm.teal.alpha/feed/getPlay.json +++ b/lexicons/fm.teal/feed/getPlay.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.feed.getPlay", + "id": "fm.teal.feed.getPlay", "description": "This lexicon is in a not officially released state. It is subject to change. | Retrieves a play given an author DID and record key.", "defs": { "main": { @@ -28,7 +28,7 @@ "properties": { "play": { "type": "ref", - "ref": "fm.teal.alpha.feed.defs#playView" + "ref": "fm.teal.feed.defs#playView" } } } diff --git a/lexicons/fm.teal.alpha/feed/play.json b/lexicons/fm.teal/feed/play.json similarity index 98% rename from lexicons/fm.teal.alpha/feed/play.json rename to lexicons/fm.teal/feed/play.json index 72df22c..9c945ae 100644 --- a/lexicons/fm.teal.alpha/feed/play.json +++ b/lexicons/fm.teal/feed/play.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.feed.play", + "id": "fm.teal.feed.play", "description": "This lexicon is in a not officially released state. It is subject to change. | A declaration of a teal.fm play. Plays are submitted as a result of a user listening to a track. Plays should be marked as tracked when a user has listened to the entire track if it's under 2 minutes long, or half of the track's duration up to 4 minutes, whichever is longest.", "defs": { "main": { @@ -52,7 +52,7 @@ "type": "array", "items": { "type": "ref", - "ref": "fm.teal.alpha.feed.defs#artist" + "ref": "fm.teal.feed.defs#artist" }, "description": "Array of artists in order of original appearance." }, diff --git a/lexicons/fm.teal.alpha/stats/defs.json b/lexicons/fm.teal/stats/defs.json similarity index 97% rename from lexicons/fm.teal.alpha/stats/defs.json rename to lexicons/fm.teal/stats/defs.json index 8682a82..40b0cb4 100644 --- a/lexicons/fm.teal.alpha/stats/defs.json +++ b/lexicons/fm.teal/stats/defs.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.stats.defs", + "id": "fm.teal.stats.defs", "defs": { "artistView": { "type": "object", diff --git a/lexicons/fm.teal.alpha/stats/getLatest.json b/lexicons/fm.teal/stats/getLatest.json similarity index 88% rename from lexicons/fm.teal.alpha/stats/getLatest.json rename to lexicons/fm.teal/stats/getLatest.json index aa9513c..c25d753 100644 --- a/lexicons/fm.teal.alpha/stats/getLatest.json +++ b/lexicons/fm.teal/stats/getLatest.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.stats.getLatest", + "id": "fm.teal.stats.getLatest", "defs": { "main": { "type": "query", @@ -27,7 +27,7 @@ "type": "array", "items": { "type": "ref", - "ref": "fm.teal.alpha.feed.defs#playView" + "ref": "fm.teal.feed.defs#playView" } } } diff --git a/lexicons/fm.teal.alpha/stats/getTopArtists.json b/lexicons/fm.teal/stats/getTopArtists.json similarity index 91% rename from lexicons/fm.teal.alpha/stats/getTopArtists.json rename to lexicons/fm.teal/stats/getTopArtists.json index 9d7dd85..2a85656 100644 --- a/lexicons/fm.teal.alpha/stats/getTopArtists.json +++ b/lexicons/fm.teal/stats/getTopArtists.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.stats.getTopArtists", + "id": "fm.teal.stats.getTopArtists", "description": "Get top artists by play count", "defs": { "main": { @@ -37,7 +37,7 @@ "type": "array", "items": { "type": "ref", - "ref": "fm.teal.alpha.stats.defs#artistView" + "ref": "fm.teal.stats.defs#artistView" } }, "cursor": { diff --git a/lexicons/fm.teal.alpha/stats/getTopReleases.json b/lexicons/fm.teal/stats/getTopReleases.json similarity index 91% rename from lexicons/fm.teal.alpha/stats/getTopReleases.json rename to lexicons/fm.teal/stats/getTopReleases.json index 349078b..9840b56 100644 --- a/lexicons/fm.teal.alpha/stats/getTopReleases.json +++ b/lexicons/fm.teal/stats/getTopReleases.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.stats.getTopReleases", + "id": "fm.teal.stats.getTopReleases", "description": "Get top releases/albums by play count", "defs": { "main": { @@ -37,7 +37,7 @@ "type": "array", "items": { "type": "ref", - "ref": "fm.teal.alpha.stats.defs#releaseView" + "ref": "fm.teal.stats.defs#releaseView" } }, "cursor": { diff --git a/lexicons/fm.teal.alpha/stats/getUserTopArtists.json b/lexicons/fm.teal/stats/getUserTopArtists.json similarity index 92% rename from lexicons/fm.teal.alpha/stats/getUserTopArtists.json rename to lexicons/fm.teal/stats/getUserTopArtists.json index ab2092e..0df0a83 100644 --- a/lexicons/fm.teal.alpha/stats/getUserTopArtists.json +++ b/lexicons/fm.teal/stats/getUserTopArtists.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.stats.getUserTopArtists", + "id": "fm.teal.stats.getUserTopArtists", "description": "Get a user's top artists by play count", "defs": { "main": { @@ -43,7 +43,7 @@ "type": "array", "items": { "type": "ref", - "ref": "fm.teal.alpha.stats.defs#artistView" + "ref": "fm.teal.stats.defs#artistView" } }, "cursor": { diff --git a/lexicons/fm.teal.alpha/stats/getUserTopReleases.json b/lexicons/fm.teal/stats/getUserTopReleases.json similarity index 92% rename from lexicons/fm.teal.alpha/stats/getUserTopReleases.json rename to lexicons/fm.teal/stats/getUserTopReleases.json index 1534ed2..d2c80a0 100644 --- a/lexicons/fm.teal.alpha/stats/getUserTopReleases.json +++ b/lexicons/fm.teal/stats/getUserTopReleases.json @@ -1,6 +1,6 @@ { "lexicon": 1, - "id": "fm.teal.alpha.stats.getUserTopReleases", + "id": "fm.teal.stats.getUserTopReleases", "description": "Get a user's top releases/albums by play count", "defs": { "main": { @@ -43,7 +43,7 @@ "type": "array", "items": { "type": "ref", - "ref": "fm.teal.alpha.stats.defs#releaseView" + "ref": "fm.teal.stats.defs#releaseView" } }, "cursor": { diff --git a/migrations/20241220000002_car_import_tables.sql b/migrations/20241220000002_car_import_tables.sql index 2db63c3..0fee331 100644 --- a/migrations/20241220000002_car_import_tables.sql +++ b/migrations/20241220000002_car_import_tables.sql @@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS car_blocks ( import_id TEXT NOT NULL REFERENCES car_import_requests(import_id), block_data BYTEA NOT NULL, decoded_successfully BOOLEAN DEFAULT FALSE, - collection_type TEXT, -- e.g., 'fm.teal.alpha.feed.play', 'commit', etc. + collection_type TEXT, -- e.g., 'fm.teal.feed.play', 'commit', etc. created_at TIMESTAMP WITH TIME ZONE DEFAULT NOW() ); diff --git a/scripts/setup-lexicons.sh b/scripts/setup-lexicons.sh index 5c4adf6..b46b523 100755 --- a/scripts/setup-lexicons.sh +++ b/scripts/setup-lexicons.sh @@ -63,4 +63,4 @@ echo " - lexicons/app -> ATProto app lexicons" echo " - lexicons/chat -> ATProto chat lexicons" echo " - lexicons/com -> ATProto protocol lexicons" echo " - lexicons/tools -> ATProto tools lexicons" -echo " - lexicons/fm.teal.alpha -> Custom Teal lexicons" +echo " - lexicons/fm.teal -> Custom Teal lexicons" diff --git a/services/cadet/sql/insert_plays.sql b/services/cadet/sql/insert_plays.sql index 028acb9..8ff17b8 100644 --- a/services/cadet/sql/insert_plays.sql +++ b/services/cadet/sql/insert_plays.sql @@ -20,7 +20,7 @@ INSERT INTO plays ( processed_time, release_mbid, release_name, recording_mbid, submission_client_agent, music_service_base_domain ) VALUES ( - 'at://did:plc:k644h4rq5bjfzcetgsa6tuby/fm.teal.alpha.feed.play/3liubcmz4sy2a', + 'at://did:plc:k644h4rq5bjfzcetgsa6tuby/fm.teal.feed.play/3liubcmz4sy2a', 'bafyreialbenvvxzje463gg3l7zgv52motum2nx32in5fvosmay527wc2vy', 'did:plc:k644h4rq5bjfzcetgsa6tuby', '3liubcmz4sy2a', @@ -39,7 +39,7 @@ s -- insert plays into join table INSERT INTO play_to_artists (play_uri, artist_mbid, artist_name) VALUES ( - 'at://did:plc:k644h4rq5bjfzcetgsa6tuby/fm.teal.alpha.feed.play/3liubcmz4sy2a', + 'at://did:plc:k644h4rq5bjfzcetgsa6tuby/fm.teal.feed.play/3liubcmz4sy2a', '95015b4c-1aef-4e28-9d36-c9546c194f0c', 'Bad Suns' ) diff --git a/services/cadet/src/ingestors/car/README.md b/services/cadet/src/ingestors/car/README.md index 3c83580..a9789e9 100644 --- a/services/cadet/src/ingestors/car/README.md +++ b/services/cadet/src/ingestors/car/README.md @@ -69,9 +69,9 @@ let import_id = ingestor.fetch_and_process_identity_car("user.bsky.social").awai The CAR importer automatically detects and processes these Teal record types: -- **`fm.teal.alpha.feed.play`** - Music play records -- **`fm.teal.alpha.profile`** - User profile data -- **`fm.teal.alpha.status`** - User status updates +- **`fm.teal.feed.play`** - Music play records +- **`fm.teal.actor.profile`** - User profile data +- **`fm.teal.actor.status`** - User status updates Records are processed using the same logic as real-time Jetstream ingestion, ensuring data consistency. @@ -237,4 +237,4 @@ When working on the CAR import system: 3. **Monitor performance**: Large CAR files can impact system performance 4. **Handle errors gracefully**: Network and parsing errors are expected -For questions about `atmst` integration or MST processing, refer to the library documentation or consider reaching out to the `atmst` maintainers. \ No newline at end of file +For questions about `atmst` integration or MST processing, refer to the library documentation or consider reaching out to the `atmst` maintainers. diff --git a/services/cadet/src/ingestors/car/car_import.rs b/services/cadet/src/ingestors/car/car_import.rs index fb1b5c1..a254b6c 100644 --- a/services/cadet/src/ingestors/car/car_import.rs +++ b/services/cadet/src/ingestors/car/car_import.rs @@ -248,7 +248,7 @@ impl CarImportIngestor { record.collection, record.rkey ); match record.collection.as_str() { - "fm.teal.alpha.feed.play" => { + "fm.teal.feed.play" => { info!(" 📀 Processing play record..."); let result = self .process_play_record(&record.data, did, &record.rkey) @@ -260,7 +260,7 @@ impl CarImportIngestor { } result } - "fm.teal.alpha.actor.profile" => { + "fm.teal.actor.profile" => { info!(" 👤 Processing profile record..."); let result = self .process_profile_record(&record.data, did, &record.rkey) @@ -272,7 +272,7 @@ impl CarImportIngestor { } result } - "fm.teal.alpha.actor.status" => { + "fm.teal.actor.status" => { info!(" 📢 Processing status record..."); let result = self .process_status_record(&record.data, did, &record.rkey) @@ -293,7 +293,7 @@ impl CarImportIngestor { /// Check if a key represents a Teal record fn is_teal_record_key(&self, key: &str) -> bool { - key.starts_with("fm.teal.alpha.") && key.contains("/") + key.starts_with("fm.teal.") && key.contains("/") } /// Parse a Teal MST key to extract collection and rkey @@ -309,11 +309,11 @@ impl CarImportIngestor { /// Process a play record using the existing PlayIngestor async fn process_play_record(&self, data: &Value, did: &str, rkey: &str) -> Result<()> { - let play_record: types::fm_teal::alpha::feed::play::Play = - value::from_json_value::(data.clone())?; + let play_record: types::fm_teal::feed::play::Play = + value::from_json_value::(data.clone())?; let play_ingestor = super::super::teal::feed_play::PlayIngestor::new(self.sql.clone()); - let uri = super::super::teal::assemble_at_uri(did, "fm.teal.alpha.feed.play", rkey); + let uri = super::super::teal::assemble_at_uri(did, "fm.teal.feed.play", rkey); play_ingestor .insert_play( @@ -334,8 +334,8 @@ impl CarImportIngestor { /// Process a profile record using the existing ActorProfileIngestor async fn process_profile_record(&self, data: &Value, did: &str, _rkey: &str) -> Result<()> { - let profile_record: types::fm_teal::alpha::actor::profile::Profile = - value::from_json_value::(data.clone())?; + let profile_record: types::fm_teal::actor::profile::Profile = + value::from_json_value::(data.clone())?; let profile_ingestor = super::super::teal::actor_profile::ActorProfileIngestor::new(self.sql.clone()); @@ -353,8 +353,8 @@ impl CarImportIngestor { /// Process a status record using the existing ActorStatusIngestor async fn process_status_record(&self, data: &Value, did: &str, rkey: &str) -> Result<()> { - let status_record: types::fm_teal::alpha::actor::status::Status = - value::from_json_value::(data.clone())?; + let status_record: types::fm_teal::actor::status::Status = + value::from_json_value::(data.clone())?; let status_ingestor = super::super::teal::actor_status::ActorStatusIngestor::new(self.sql.clone()); @@ -593,7 +593,7 @@ mod tests { let mut record = BTreeMap::new(); record.insert( "$type".to_string(), - Ipld::String("fm.teal.alpha.feed.play".to_string()), + Ipld::String("fm.teal.feed.play".to_string()), ); record.insert( "track_name".to_string(), @@ -615,7 +615,7 @@ mod tests { let mut record = BTreeMap::new(); record.insert( "$type".to_string(), - Ipld::String("fm.teal.alpha.actor.profile".to_string()), + Ipld::String("fm.teal.actor.profile".to_string()), ); record.insert( "display_name".to_string(), @@ -653,14 +653,14 @@ mod tests { #[test] fn test_parse_teal_key() { // This test doesn't need a database connection or async - let key = "fm.teal.alpha.feed.play/3k2akjdlkjsf"; + let key = "fm.teal.feed.play/3k2akjdlkjsf"; // Test the parsing logic directly if let Some(slash_pos) = key.rfind('/') { let collection = key[..slash_pos].to_string(); let rkey = key[slash_pos + 1..].to_string(); - assert_eq!(collection, "fm.teal.alpha.feed.play"); + assert_eq!(collection, "fm.teal.feed.play"); assert_eq!(rkey, "3k2akjdlkjsf"); } else { panic!("Should have found slash in key"); @@ -671,13 +671,13 @@ mod tests { fn test_is_teal_record_key() { // Test the logic directly without needing an ingestor instance fn is_teal_record_key(key: &str) -> bool { - key.starts_with("fm.teal.alpha.") && key.contains("/") + key.starts_with("fm.teal.") && key.contains("/") } - assert!(is_teal_record_key("fm.teal.alpha.feed.play/abc123")); - assert!(is_teal_record_key("fm.teal.alpha.profile/def456")); + assert!(is_teal_record_key("fm.teal.feed.play/abc123")); + assert!(is_teal_record_key("fm.teal.actor.profile/def456")); assert!(!is_teal_record_key("app.bsky.feed.post/xyz789")); - assert!(!is_teal_record_key("fm.teal.alpha.feed.play")); // No rkey + assert!(!is_teal_record_key("fm.teal.feed.play")); // No rkey } #[test] @@ -689,7 +689,7 @@ mod tests { let mut record = BTreeMap::new(); record.insert( "$type".to_string(), - Ipld::String("fm.teal.alpha.feed.play".to_string()), + Ipld::String("fm.teal.feed.play".to_string()), ); record.insert( "track_name".to_string(), @@ -725,7 +725,7 @@ mod tests { let json_result = ipld_to_json(&play_record); assert!(json_result.is_ok()); let json = json_result.unwrap(); - assert_eq!(json["$type"], "fm.teal.alpha.feed.play"); + assert_eq!(json["$type"], "fm.teal.feed.play"); assert_eq!(json["track_name"], "Test Song"); assert_eq!(json["duration"], 180000); } @@ -746,7 +746,7 @@ mod tests { for cid in importer.cids() { if let Ok(Ipld::Map(map)) = importer.decode_cbor(&cid) { if let Some(Ipld::String(record_type)) = map.get("$type") { - assert!(record_type.starts_with("fm.teal.alpha.")); + assert!(record_type.starts_with("fm.teal.")); println!("Found Teal record: {}", record_type); } } diff --git a/services/cadet/src/ingestors/teal/actor_profile.rs b/services/cadet/src/ingestors/teal/actor_profile.rs index 3478897..ff4fbee 100644 --- a/services/cadet/src/ingestors/teal/actor_profile.rs +++ b/services/cadet/src/ingestors/teal/actor_profile.rs @@ -22,7 +22,7 @@ impl ActorProfileIngestor { pub async fn insert_profile( &self, provided_did: &str, - profile: &types::fm_teal::alpha::actor::profile::Profile, + profile: &types::fm_teal::actor::profile::Profile, ) -> anyhow::Result<()> { dbg!(&profile); // TODO: cache the doc for like 8 hours or something @@ -86,8 +86,8 @@ impl LexiconIngestor for ActorProfileIngestor { async fn ingest(&self, message: Event) -> anyhow::Result<()> { if let Some(commit) = &message.commit { if let Some(ref record) = &commit.record { - let record: types::fm_teal::alpha::actor::profile::Profile = - value::from_json_value::( + let record: types::fm_teal::actor::profile::Profile = + value::from_json_value::( record.clone(), )?; if let Some(ref commit) = message.commit { diff --git a/services/cadet/src/ingestors/teal/actor_status.rs b/services/cadet/src/ingestors/teal/actor_status.rs index 1fe563e..6f085e7 100644 --- a/services/cadet/src/ingestors/teal/actor_status.rs +++ b/services/cadet/src/ingestors/teal/actor_status.rs @@ -20,9 +20,9 @@ impl ActorStatusIngestor { did: &str, rkey: &str, cid: &str, - status: &types::fm_teal::alpha::actor::status::Status, + status: &types::fm_teal::actor::status::Status, ) -> anyhow::Result<()> { - let uri = assemble_at_uri(did, "fm.teal.alpha.actor.status", rkey); + let uri = assemble_at_uri(did, "fm.teal.actor.status", rkey); let record_json = serde_json::to_value(status)?; @@ -48,7 +48,7 @@ impl ActorStatusIngestor { } pub async fn remove_status(&self, did: &str, rkey: &str) -> anyhow::Result<()> { - let uri = assemble_at_uri(did, "fm.teal.alpha.actor.status", rkey); + let uri = assemble_at_uri(did, "fm.teal.actor.status", rkey); sqlx::query!( r#" @@ -68,8 +68,8 @@ impl LexiconIngestor for ActorStatusIngestor { async fn ingest(&self, message: Event) -> anyhow::Result<()> { if let Some(commit) = &message.commit { if let Some(ref record) = &commit.record { - let record: types::fm_teal::alpha::actor::status::Status = - value::from_json_value::( + let record: types::fm_teal::actor::status::Status = + value::from_json_value::( record.clone(), )?; diff --git a/services/cadet/src/ingestors/teal/feed_play.rs b/services/cadet/src/ingestors/teal/feed_play.rs index 745b599..ab20e8b 100644 --- a/services/cadet/src/ingestors/teal/feed_play.rs +++ b/services/cadet/src/ingestors/teal/feed_play.rs @@ -409,8 +409,8 @@ fn uri_mbid_value(mbid: &UriValue) -> &str { } fn clean( - record: &types::fm_teal::alpha::feed::play::Play, -) -> types::fm_teal::alpha::feed::play::Play { + record: &types::fm_teal::feed::play::Play, +) -> types::fm_teal::feed::play::Play { let mut cleaned = record.clone(); // Clean artist MBIDs inside artists vector, if present @@ -1325,7 +1325,7 @@ impl PlayIngestor { pub async fn insert_play( &self, - play_record: &types::fm_teal::alpha::feed::play::Play, + play_record: &types::fm_teal::feed::play::Play, uri: &str, cid: &str, did: &str, @@ -1591,8 +1591,8 @@ impl LexiconIngestor for PlayIngestor { async fn ingest(&self, message: Event) -> anyhow::Result<()> { if let Some(commit) = &message.commit { if let Some(ref record) = &commit.record { - let record: types::fm_teal::alpha::feed::play::Play = - value::from_json_value::( + let record: types::fm_teal::feed::play::Play = + value::from_json_value::( record.clone(), )?; if let Some(ref commit) = message.commit { diff --git a/services/cadet/src/ingestors/teal/mod.rs b/services/cadet/src/ingestors/teal/mod.rs index 0939dd9..5f402ac 100644 --- a/services/cadet/src/ingestors/teal/mod.rs +++ b/services/cadet/src/ingestors/teal/mod.rs @@ -5,7 +5,7 @@ pub mod feed_play; /// Parses an AT uri into parts: /// did/handle, collection, rkey // fn parse_at_parts(aturi: &str) -> (&str, Option<&str>, Option<&str>) { -// // example: at://did:plc:k644h4rq5bjfzcetgsa6tuby/fm.teal.alpha.feed.play/3liubcmz4sy2a +// // example: at://did:plc:k644h4rq5bjfzcetgsa6tuby/fm.teal.feed.play/3liubcmz4sy2a // let split: Vec<&str> = aturi.split('/').collect(); // let did = split.get(2).unwrap_or(&"").clone(); // let collection = split.get(4).map(|s| *s).clone(); diff --git a/services/cadet/src/main.rs b/services/cadet/src/main.rs index 7b7fe49..7594abf 100644 --- a/services/cadet/src/main.rs +++ b/services/cadet/src/main.rs @@ -50,9 +50,9 @@ async fn main() { let opts = JetstreamOptions::builder() .wanted_collections( [ - "fm.teal.alpha.feed.play", - "fm.teal.alpha.actor.profile", - "fm.teal.alpha.actor.status", + "fm.teal.feed.play", + "fm.teal.actor.profile", + "fm.teal.actor.status", "com.atproto.repo.importRepo", ] .iter() @@ -66,19 +66,19 @@ async fn main() { let mut ingestors: HashMap> = HashMap::new(); ingestors.insert( - "fm.teal.alpha.feed.play".to_string(), + "fm.teal.feed.play".to_string(), Box::new(ingestors::teal::feed_play::PlayIngestor::new(pool.clone())), ); ingestors.insert( - "fm.teal.alpha.actor.profile".to_string(), + "fm.teal.actor.profile".to_string(), Box::new(ingestors::teal::actor_profile::ActorProfileIngestor::new( pool.clone(), )), ); ingestors.insert( - "fm.teal.alpha.actor.status".to_string(), + "fm.teal.actor.status".to_string(), Box::new(ingestors::teal::actor_status::ActorStatusIngestor::new( pool.clone(), )), diff --git a/tools/lexicon-cli/README.md b/tools/lexicon-cli/README.md index 65f3379..bc9795d 100644 --- a/tools/lexicon-cli/README.md +++ b/tools/lexicon-cli/README.md @@ -102,7 +102,7 @@ The tool integrates with the existing Turbo build pipeline: ## Lexicon Sources -### Teal Lexicons (`fm.teal.alpha.*`) +### Teal Lexicons (`fm.teal.*`) - **Actor**: Profile management, status tracking, search - **Feed**: Music play tracking, artist/track data - **Stats**: Top artists, releases, user statistics diff --git a/tools/lexicon-cli/src/commands/validate.ts b/tools/lexicon-cli/src/commands/validate.ts index 1ed7077..5d25c9a 100644 --- a/tools/lexicon-cli/src/commands/validate.ts +++ b/tools/lexicon-cli/src/commands/validate.ts @@ -46,7 +46,11 @@ async function validateTypeScriptGeneration(workspaceRoot: string) { const sourceFiles = await glob('**/*.json', { cwd: lexiconsPath }); for (const sourceFile of sourceFiles) { - const namespace = sourceFile.replace('.json', '').replace(/\//g, '/'); + const namespace = sourceFile + .replace(/\.json$/, '') + .split('/') + .flatMap((segment) => segment.split('.')) + .join('/'); const expectedTypeFile = join(typesPath, namespace + '.ts'); if (!existsSync(expectedTypeFile)) { @@ -111,4 +115,4 @@ async function validateConsistency(workspaceRoot: string) { } console.log(pc.green(' ✓ Consistency validation complete')); -} \ No newline at end of file +} diff --git a/tools/teal-cli/README.md b/tools/teal-cli/README.md index 161fcab..cb848ad 100644 --- a/tools/teal-cli/README.md +++ b/tools/teal-cli/README.md @@ -123,7 +123,7 @@ teal rotate --name repo --backup-dir ./backups The CAR explorer can analyze AT Protocol archives and identify: -- **Teal Records**: Music plays (`fm.teal.alpha.feed.play`), profiles (`fm.teal.alpha.actor.profile`), and status updates +- **Teal Records**: Music plays (`fm.teal.feed.play`), profiles (`fm.teal.actor.profile`), and status updates - **AT Protocol Records**: BlueSky posts, likes, follows, and other social data - **Commit Operations**: Repository changes and metadata - **IPLD Structure**: Content addressing and linking @@ -142,15 +142,15 @@ The CAR explorer can analyze AT Protocol archives and identify: 📋 Record Types: app.bsky.feed.like: 11034 app.bsky.feed.post: 7510 - fm.teal.alpha.feed.play: 2605 - fm.teal.alpha.actor.profile: 1 + fm.teal.feed.play: 2605 + fm.teal.actor.profile: 1 🎵 Teal Records Found: - fm.teal.alpha.feed.play: 2605 - fm.teal.alpha.actor.profile: 1 + fm.teal.feed.play: 2605 + fm.teal.actor.profile: 1 🔍 Sample Teal Records: - 1. fm.teal.alpha.feed.play (bafyreigmu...) + 1. fm.teal.feed.play (bafyreigmu...) 🎵 Track: Bohemian Rhapsody 🎤 Artists: Queen ⏱️ Duration: 355000ms @@ -163,7 +163,7 @@ The CAR explorer can analyze AT Protocol archives and identify: { "cid": "bafyreigmuwliezhxczoxgxq5hjtsdzaj3jl54kg...", "data": { - "$type": "fm.teal.alpha.feed.play", + "$type": "fm.teal.feed.play", "track_name": "Bohemian Rhapsody", "artist_names": ["Queen"], "duration": 355000, @@ -225,7 +225,7 @@ teal car search --file nat.car --query "bohemian rhapsody" teal car export --file nat.car --output ./music_data # View exported play records -cat ./music_data/fm_teal_alpha_feed_play.json | jq '.[0]' +cat ./music_data/fm_teal_feed_play.json | jq '.[0]' ``` ### Quick setup diff --git a/tools/teal-cli/rkey_example.md b/tools/teal-cli/rkey_example.md index aaa74d9..78519a4 100644 --- a/tools/teal-cli/rkey_example.md +++ b/tools/teal-cli/rkey_example.md @@ -19,7 +19,7 @@ Repository Structure: ```json { - "$type": "fm.teal.alpha.feed.play", + "$type": "fm.teal.feed.play", "track_name": "Bohemian Rhapsody", "artist_names": ["Queen"], "duration": 355000, @@ -36,12 +36,12 @@ Repository Structure: "ops": [ { "action": "create", - "path": "fm.teal.alpha.feed.play/3k2akjdlkjsf", // ← collection/rkey + "path": "fm.teal.feed.play/3k2akjdlkjsf", // ← collection/rkey "cid": "bafyrei123..." // ← points to the record above }, { "action": "create", - "path": "fm.teal.alpha.actor.profile/self", + "path": "fm.teal.actor.profile/self", "cid": "bafyrei456..." } ], @@ -78,14 +78,14 @@ fn extract_rkeys_from_commits(commits: &[CommitInfo]) -> HashMap 1. **Find commit blocks** in CAR file 2. **Extract operations** from commit IPLD -3. **Parse paths** like `"fm.teal.alpha.feed.play/3k2akjdlkjsf"` +3. **Parse paths** like `"fm.teal.feed.play/3k2akjdlkjsf"` 4. **Map CID → rkey**: `bafyrei123... → 3k2akjdlkjsf` 5. **Use rkey** when processing records ## Why This Matters The rkey is essential for: -- **AT URI construction**: `at://did:plc:user123/fm.teal.alpha.feed.play/3k2akjdlkjsf` +- **AT URI construction**: `at://did:plc:user123/fm.teal.feed.play/3k2akjdlkjsf` - **Record identity**: Uniquely identifies the record within the collection - **Data integrity**: Maintains proper AT Protocol addressing -- 2.51.2 From bc03698998f6c50b69e63b3dcc63313414045e98 Mon Sep 17 00:00:00 2001 From: rektide Date: Tue, 11 Aug 2026 05:12:01 -0400 Subject: [PATCH 02/16] Model play origins and services as URIs URI1 replaces alpha-era URL and bare-domain fields with URI-named, URI-validated fields so generic Atmosphere tooling can recognize their values as links. --- lexicons/fm.teal/feed/defs.json | 10 ++++++---- lexicons/fm.teal/feed/play.json | 10 ++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/lexicons/fm.teal/feed/defs.json b/lexicons/fm.teal/feed/defs.json index 2e932d6..50e554c 100644 --- a/lexicons/fm.teal/feed/defs.json +++ b/lexicons/fm.teal/feed/defs.json @@ -51,13 +51,15 @@ "type": "string", "description": "The ISRC code associated with the recording" }, - "originUrl": { + "originUri": { "type": "string", - "description": "The URL associated with this track" + "format": "uri", + "description": "The exact URI where the listening event originated." }, - "musicServiceBaseDomain": { + "musicServiceUri": { "type": "string", - "description": "The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if not provided." + "format": "uri", + "description": "The canonical URI identifying the listening surface or music service." }, "submissionClientAgent": { "type": "string", diff --git a/lexicons/fm.teal/feed/play.json b/lexicons/fm.teal/feed/play.json index 9c945ae..174aeec 100644 --- a/lexicons/fm.teal/feed/play.json +++ b/lexicons/fm.teal/feed/play.json @@ -71,13 +71,15 @@ "type": "string", "description": "The ISRC code associated with the recording" }, - "originUrl": { + "originUri": { "type": "string", - "description": "The URL associated with this track" + "format": "uri", + "description": "The exact URI where the listening event originated." }, - "musicServiceBaseDomain": { + "musicServiceUri": { "type": "string", - "description": "The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if unavailable or not provided." + "format": "uri", + "description": "The canonical URI identifying the listening surface or music service." }, "submissionClientAgent": { "type": "string", -- 2.51.2 From 6bcdb0466ba761fb307381ef9b65b010f2cc7933 Mon Sep 17 00:00:00 2001 From: rektide Date: Tue, 11 Aug 2026 05:12:19 -0400 Subject: [PATCH 03/16] Constrain actor view identities to DIDs DID1 applies the dedicated DID format to profile view identity fields, replacing unconstrained text with the strongest matching Lexicon type. --- lexicons/fm.teal/actor/defs.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lexicons/fm.teal/actor/defs.json b/lexicons/fm.teal/actor/defs.json index 4838bd2..5eb3383 100644 --- a/lexicons/fm.teal/actor/defs.json +++ b/lexicons/fm.teal/actor/defs.json @@ -7,6 +7,7 @@ "properties": { "did": { "type": "string", + "format": "did", "description": "The decentralized identifier of the actor" }, "displayName": { @@ -46,6 +47,7 @@ "properties": { "did": { "type": "string", + "format": "did", "description": "The decentralized identifier of the actor" }, "displayName": { -- 2.51.2 From 921a1a6e0e9cfb53ec0efc73eb07518f0fdd3944 Mon Sep 17 00:00:00 2001 From: rektide Date: Tue, 11 Aug 2026 05:12:30 -0400 Subject: [PATCH 04/16] Constrain actor view handles HANDLE1 applies the dedicated handle format to mini profile views so clients can validate and interpret actor handles instead of receiving opaque text. --- lexicons/fm.teal/actor/defs.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lexicons/fm.teal/actor/defs.json b/lexicons/fm.teal/actor/defs.json index 5eb3383..ea91c83 100644 --- a/lexicons/fm.teal/actor/defs.json +++ b/lexicons/fm.teal/actor/defs.json @@ -54,7 +54,8 @@ "type": "string" }, "handle": { - "type": "string" + "type": "string", + "format": "handle" }, "avatar": { "type": "string", -- 2.51.2 From 9303eea775e848733809759ef17899f096a2d6bc Mon Sep 17 00:00:00 2001 From: rektide Date: Tue, 11 Aug 2026 05:12:45 -0400 Subject: [PATCH 05/16] Require DIDs for author-specific feed queries DID2 narrows authorDID parameters from DID-or-handle identifiers to DIDs, matching the field names and documented endpoint contracts. --- lexicons/fm.teal/feed/getActorFeed.json | 2 +- lexicons/fm.teal/feed/getPlay.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lexicons/fm.teal/feed/getActorFeed.json b/lexicons/fm.teal/feed/getActorFeed.json index dfe0200..8da978d 100644 --- a/lexicons/fm.teal/feed/getActorFeed.json +++ b/lexicons/fm.teal/feed/getActorFeed.json @@ -11,7 +11,7 @@ "properties": { "authorDID": { "type": "string", - "format": "at-identifier", + "format": "did", "description": "The author's DID for the play" }, "cursor": { diff --git a/lexicons/fm.teal/feed/getPlay.json b/lexicons/fm.teal/feed/getPlay.json index 8d26ffa..f78baa8 100644 --- a/lexicons/fm.teal/feed/getPlay.json +++ b/lexicons/fm.teal/feed/getPlay.json @@ -11,7 +11,7 @@ "properties": { "authorDID": { "type": "string", - "format": "at-identifier", + "format": "did", "description": "The author's DID for the play" }, "rkey": { -- 2.51.2 From afc5cdd4cc1f8c4c0cafb1b7038c5d74d34c1854 Mon Sep 17 00:00:00 2001 From: rektide Date: Tue, 11 Aug 2026 05:13:13 -0400 Subject: [PATCH 06/16] Validate play record keys RKEY1 applies the record-key format to getPlay rkeys so invalid AT Protocol record keys are rejected at the XRPC boundary. --- lexicons/fm.teal/feed/getPlay.json | 1 + 1 file changed, 1 insertion(+) diff --git a/lexicons/fm.teal/feed/getPlay.json b/lexicons/fm.teal/feed/getPlay.json index f78baa8..66aa388 100644 --- a/lexicons/fm.teal/feed/getPlay.json +++ b/lexicons/fm.teal/feed/getPlay.json @@ -16,6 +16,7 @@ }, "rkey": { "type": "string", + "format": "record-key", "description": "The record key of the play" } } -- 2.51.2 From 4c5ff6c341b04701890aafd819272abfcdce01ce Mon Sep 17 00:00:00 2001 From: rektide Date: Tue, 11 Aug 2026 05:13:40 -0400 Subject: [PATCH 07/16] Constrain profile image references to CIDs CID1 applies the CID format to avatar and banner view fields, matching Cadet storage of their underlying IPLD blob-reference CIDs. --- lexicons/fm.teal/actor/defs.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lexicons/fm.teal/actor/defs.json b/lexicons/fm.teal/actor/defs.json index ea91c83..6cc66c1 100644 --- a/lexicons/fm.teal/actor/defs.json +++ b/lexicons/fm.teal/actor/defs.json @@ -29,10 +29,12 @@ }, "avatar": { "type": "string", + "format": "cid", "description": "IPLD of the avatar" }, "banner": { "type": "string", + "format": "cid", "description": "IPLD of the banner image" }, "status": { @@ -59,6 +61,7 @@ }, "avatar": { "type": "string", + "format": "cid", "description": "IPLD of the avatar" } } -- 2.51.2 From e9e9e27ef12862484b7336c90c1b289e3ed6338e Mon Sep 17 00:00:00 2001 From: rektide Date: Tue, 11 Aug 2026 05:14:03 -0400 Subject: [PATCH 08/16] Document featured MusicBrainz entity types KNOWN1 adds open knownValues for common featured-item types, improving generated guidance without rejecting future MusicBrainz entity categories. --- lexicons/fm.teal/actor/profile.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lexicons/fm.teal/actor/profile.json b/lexicons/fm.teal/actor/profile.json index 87434b0..6b0acc0 100644 --- a/lexicons/fm.teal/actor/profile.json +++ b/lexicons/fm.teal/actor/profile.json @@ -57,7 +57,8 @@ }, "type": { "type": "string", - "description": "The type of the item. Must be a valid Musicbrainz type, e.g. album, track, recording, etc." + "knownValues": ["artist", "release", "recording"], + "description": "The MusicBrainz entity type of the item." } } } -- 2.51.2 From 818840c88bf28a3477eeb479ae62e36c5ac26b93 Mon Sep 17 00:00:00 2001 From: rektide Date: Tue, 11 Aug 2026 05:14:20 -0400 Subject: [PATCH 09/16] Use consistent datetime terminology TIME1 describes datetime-formatted fields without naming one standard exclusively. ATProto datetime strings meet the intersecting requirements of RFC 3339, ISO 8601, and WHATWG HTML datetime. --- lexicons/fm.teal/actor/defs.json | 4 ++-- lexicons/fm.teal/actor/status.json | 4 ++-- lexicons/fm.teal/feed/defs.json | 2 +- lexicons/fm.teal/feed/play.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lexicons/fm.teal/actor/defs.json b/lexicons/fm.teal/actor/defs.json index 6cc66c1..e1b7b4c 100644 --- a/lexicons/fm.teal/actor/defs.json +++ b/lexicons/fm.teal/actor/defs.json @@ -73,12 +73,12 @@ "time": { "type": "string", "format": "datetime", - "description": "The unix timestamp of when the item was recorded" + "description": "The datetime at which the status was recorded." }, "expiry": { "type": "string", "format": "datetime", - "description": "The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time." + "description": "The datetime after which the status is no longer current." }, "item": { "type": "ref", diff --git a/lexicons/fm.teal/actor/status.json b/lexicons/fm.teal/actor/status.json index a034f74..89c9d57 100644 --- a/lexicons/fm.teal/actor/status.json +++ b/lexicons/fm.teal/actor/status.json @@ -13,12 +13,12 @@ "time": { "type": "string", "format": "datetime", - "description": "The RFC 3339 formatted time of when the item was recorded" + "description": "The datetime at which the status was recorded." }, "expiry": { "type": "string", "format": "datetime", - "description": "The RFC 3339 formatted time of the expiry time of the item. If unavailable, default to 10 minutes past the start time." + "description": "The datetime after which the status is no longer current. If unavailable, default to 10 minutes after the start time." }, "item": { "type": "ref", diff --git a/lexicons/fm.teal/feed/defs.json b/lexicons/fm.teal/feed/defs.json index 50e554c..80439f2 100644 --- a/lexicons/fm.teal/feed/defs.json +++ b/lexicons/fm.teal/feed/defs.json @@ -70,7 +70,7 @@ "playedTime": { "type": "string", "format": "datetime", - "description": "The unix timestamp of when the track was played" + "description": "The datetime at which playback began." } } }, diff --git a/lexicons/fm.teal/feed/play.json b/lexicons/fm.teal/feed/play.json index 174aeec..df5a526 100644 --- a/lexicons/fm.teal/feed/play.json +++ b/lexicons/fm.teal/feed/play.json @@ -90,7 +90,7 @@ "playedTime": { "type": "string", "format": "datetime", - "description": "The unix timestamp of when the track was played" + "description": "The datetime at which playback began." }, "trackDiscriminant": { "type": "string", -- 2.51.2 From b6747363ce6c840bd9599025399f7ccd71e462ad Mon Sep 17 00:00:00 2001 From: rektide Date: Tue, 11 Aug 2026 05:14:36 -0400 Subject: [PATCH 10/16] Align actor query descriptions with accepted identifiers IDENTDOC1 documents that at-identifier parameters accept either DIDs or handles and corrects getProfile copy that described an unrelated play lookup. --- lexicons/fm.teal/actor/getProfile.json | 4 ++-- lexicons/fm.teal/actor/getProfiles.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lexicons/fm.teal/actor/getProfile.json b/lexicons/fm.teal/actor/getProfile.json index bfefa07..465dcba 100644 --- a/lexicons/fm.teal/actor/getProfile.json +++ b/lexicons/fm.teal/actor/getProfile.json @@ -1,7 +1,7 @@ { "lexicon": 1, "id": "fm.teal.actor.getProfile", - "description": "This lexicon is in a not officially released state. It is subject to change. | Retrieves a play given an author DID and record key.", + "description": "This lexicon is in a not officially released state. It is subject to change. | Retrieves a profile for an actor DID or handle.", "defs": { "main": { "type": "query", @@ -12,7 +12,7 @@ "actor": { "type": "string", "format": "at-identifier", - "description": "The author's DID" + "description": "The actor's DID or handle" } } }, diff --git a/lexicons/fm.teal/actor/getProfiles.json b/lexicons/fm.teal/actor/getProfiles.json index 45aee65..2196f2b 100644 --- a/lexicons/fm.teal/actor/getProfiles.json +++ b/lexicons/fm.teal/actor/getProfiles.json @@ -15,7 +15,7 @@ "type": "string", "format": "at-identifier" }, - "description": "Array of actor DIDs" + "description": "Array of actor DIDs or handles" } } }, -- 2.51.2 From 448c62a848b3aebde0c6d452ffc8ab3a2842fa2a Mon Sep 17 00:00:00 2001 From: mmattbtw Date: Wed, 12 Aug 2026 19:17:31 -0500 Subject: [PATCH 11/16] fix(namespace): preserve alpha records during migration Keep legacy onboarding records readable while stable profile records are introduced, retain alpha Jetstream aliases for staggered client upgrades, and route historical alpha CAR records through stable ingestors. --- apps/amethyst/app/(tabs)/index.tsx | 26 ++- apps/amethyst/app/onboarding/index.tsx | 123 ++++++++++---- apps/amethyst/components/actor/actorView.tsx | 40 +++-- .../lib/__tests__/onboardingRecords.test.ts | 87 ++++++++++ apps/amethyst/lib/atp/onboardingRecords.ts | 92 ++++++++++ services/cadet/src/ingestors/car/README.md | 4 + .../cadet/src/ingestors/car/car_import.rs | 160 +++++++++++++----- .../cadet/src/ingestors/teal/feed_play.rs | 13 +- services/cadet/src/ingestors/teal/mod.rs | 68 ++++++++ services/cadet/src/main.rs | 59 ++++--- 10 files changed, 550 insertions(+), 122 deletions(-) create mode 100644 apps/amethyst/lib/__tests__/onboardingRecords.test.ts create mode 100644 apps/amethyst/lib/atp/onboardingRecords.ts diff --git a/apps/amethyst/app/(tabs)/index.tsx b/apps/amethyst/app/(tabs)/index.tsx index 822bd96..3b31c6c 100644 --- a/apps/amethyst/app/(tabs)/index.tsx +++ b/apps/amethyst/app/(tabs)/index.tsx @@ -3,6 +3,11 @@ import { useEffect, useState } from "react"; import { ActivityIndicator, ScrollView, View } from "react-native"; import { Redirect, Stack, useRouter } from "expo-router"; import ActorView from "@/components/actor/actorView"; +import { + LEGACY_PROFILE_STATUS_COLLECTION, + readRepoRecordWithLegacyFallback, + STABLE_PROFILE_STATUS_COLLECTION, +} from "@/lib/atp/onboardingRecords"; import { useStore } from "@/stores/mainStore"; import { Record as ProfileStatusRecord } from "@teal/lexicons/src/types/fm/teal/actor/profileStatus"; @@ -16,7 +21,8 @@ export default function Screen() { const agent = useStore((state) => state.pdsAgent); const profile = useStore((state) => state.profiles[agent?.did ?? ""]); const tealDid = useStore((state) => state.tealDid); - const [profileStatus, setProfileStatus] = useState(null); + const [profileStatus, setProfileStatus] = + useState(null); const [statusLoading, setStatusLoading] = useState(true); useEffect(() => { @@ -26,14 +32,15 @@ export default function Screen() { try { if (!agent) return; - const res = await agent.call("com.atproto.repo.getRecord", { - repo: agent.did, - collection: "fm.teal.actor.profileStatus", - rkey: "self", - }); + const result = + await readRepoRecordWithLegacyFallback( + agent, + STABLE_PROFILE_STATUS_COLLECTION, + LEGACY_PROFILE_STATUS_COLLECTION, + ); if (isMounted) { - setProfileStatus(res.data.value as ProfileStatusRecord); + setProfileStatus(result?.record ?? null); } } catch (error) { if (isMounted) { @@ -65,7 +72,10 @@ export default function Screen() { return ; } - if (!statusLoading && (!profileStatus || profileStatus.completedOnboarding === "none")) { + if ( + !statusLoading && + (!profileStatus || profileStatus.completedOnboarding === "none") + ) { return ( diff --git a/apps/amethyst/app/onboarding/index.tsx b/apps/amethyst/app/onboarding/index.tsx index 824a219..2da1cfe 100644 --- a/apps/amethyst/app/onboarding/index.tsx +++ b/apps/amethyst/app/onboarding/index.tsx @@ -4,7 +4,15 @@ import { SafeAreaView } from "react-native-safe-area-context"; import { useRouter } from "expo-router"; import ProgressDots from "@/components/onboarding/progressDots"; import { Text } from "@/components/ui/text"; // Your UI components - +import getImageCdnLink from "@/lib/atp/getImageCdnLink"; +import { + getBlobHash, + LEGACY_PROFILE_COLLECTION, + LEGACY_PROFILE_STATUS_COLLECTION, + readRepoRecordWithLegacyFallback, + STABLE_PROFILE_COLLECTION, + STABLE_PROFILE_STATUS_COLLECTION, +} from "@/lib/atp/onboardingRecords"; import { useStore } from "@/stores/mainStore"; import { Record as ProfileRecord } from "@teal/lexicons/src/types/fm/teal/actor/profile"; @@ -32,30 +40,33 @@ export default function OnboardingPage() { const [submissionStep, setSubmissionStep] = useState(0); - // Profile status hooks - must be at top level - const [profileStatus, setProfileStatus] = useState(null); + const [profileStatus, setProfileStatus] = + useState(null); const [statusLoading, setStatusLoading] = useState(true); + const [profileLoading, setProfileLoading] = useState(true); const router = useRouter(); const agent = useStore((store) => store.pdsAgent); const profile = useStore((store) => store.profiles); - // Check profile status + // Read both records with a legacy fallback so an existing user is never + // treated as a new user just because the namespace changed. React.useEffect(() => { const checkProfileStatus = async () => { if (!agent) return; try { - const res = await agent.call("com.atproto.repo.getRecord", { - repo: agent.did, - collection: "fm.teal.actor.profileStatus", - rkey: "self", - }); - setProfileStatus(res.data.value as ProfileStatusRecord); - } catch { - // If no record exists, user hasn't completed onboarding + const result = + await readRepoRecordWithLegacyFallback( + agent, + STABLE_PROFILE_STATUS_COLLECTION, + LEGACY_PROFILE_STATUS_COLLECTION, + ); + setProfileStatus(result?.record ?? null); + } catch (error) { + console.error("Error fetching profile status:", error); setProfileStatus(null); } finally { setStatusLoading(false); @@ -65,7 +76,47 @@ export default function OnboardingPage() { checkProfileStatus(); }, [agent]); - const handleImageSelectionComplete = (avatar: string | undefined, banner: string | undefined) => { + React.useEffect(() => { + const loadProfile = async () => { + if (!agent) return; + + try { + const result = await readRepoRecordWithLegacyFallback( + agent, + STABLE_PROFILE_COLLECTION, + LEGACY_PROFILE_COLLECTION, + ); + if (result) { + setDisplayName(result.record.displayName ?? ""); + setDescription(result.record.description ?? ""); + + const avatarHash = getBlobHash(result.record.avatar); + const bannerHash = getBlobHash(result.record.banner); + setAvatarUri( + avatarHash + ? (getImageCdnLink({ did: agent.did!, hash: avatarHash }) ?? "") + : "", + ); + setBannerUri( + bannerHash + ? (getImageCdnLink({ did: agent.did!, hash: bannerHash }) ?? "") + : "", + ); + } + } catch (error) { + console.error("Error fetching user profile:", error); + } finally { + setProfileLoading(false); + } + }; + + loadProfile(); + }, [agent]); + + const handleImageSelectionComplete = ( + avatar: string | undefined, + banner: string | undefined, + ) => { setAvatarUri(avatar ?? ""); setBannerUri(banner ?? ""); onComplete({ displayName, description }, avatar, banner); @@ -94,13 +145,18 @@ export default function OnboardingPage() { let currentUser: ProfileRecord | undefined; let cid: string | undefined; try { - const res = await agent.call("com.atproto.repo.getRecord", { - repo: agent.did, - collection: "fm.teal.actor.profile", - rkey: "self", - }); - currentUser = res.data.value; - cid = res.data.cid; + const result = await readRepoRecordWithLegacyFallback( + agent, + STABLE_PROFILE_COLLECTION, + LEGACY_PROFILE_COLLECTION, + ); + currentUser = result?.record; + // A legacy record must be copied into the stable collection, not + // updated in place. Its blob refs are retained below. + cid = + result?.collection === STABLE_PROFILE_COLLECTION + ? result.cid + : undefined; } catch (error) { console.error("Error fetching user profile:", error); } @@ -114,7 +170,8 @@ export default function OnboardingPage() { const data = await fetch(newAvatarUri).then((r) => r.blob()); const fileType = newAvatarUri.split(";")[0].split(":")[1]; const blob = new Blob([data], { type: fileType }); - newAvatarBlob = (await agent.uploadBlob(blob, { encoding: fileType })).data.blob as unknown as ProfileRecord["avatar"]; + newAvatarBlob = (await agent.uploadBlob(blob, { encoding: fileType })) + .data.blob as unknown as ProfileRecord["avatar"]; } } if (newBannerUri) { @@ -123,40 +180,41 @@ export default function OnboardingPage() { const data = await fetch(newBannerUri).then((r) => r.blob()); const fileType = newBannerUri.split(";")[0].split(":")[1]; const blob = new Blob([data], { type: fileType }); - newBannerBlob = (await agent.uploadBlob(blob, { encoding: fileType })).data.blob as unknown as ProfileRecord["banner"]; + newBannerBlob = (await agent.uploadBlob(blob, { encoding: fileType })) + .data.blob as unknown as ProfileRecord["banner"]; } } setSubmissionStep(4); - let record: ProfileRecord = { + const record: ProfileRecord = { + ...currentUser, + $type: STABLE_PROFILE_COLLECTION, displayName: updatedProfile.displayName, description: updatedProfile.description, avatar: newAvatarBlob, banner: newBannerBlob, }; - let post; - if (cid) { - post = await agent.call( + await agent.call( "com.atproto.repo.putRecord", {}, { repo: agent.did, - collection: "fm.teal.actor.profile", + collection: STABLE_PROFILE_COLLECTION, rkey: "self", record, swapRecord: cid, }, ); } else { - post = await agent.call( + await agent.call( "com.atproto.repo.createRecord", {}, { repo: agent.did, - collection: "fm.teal.actor.profile", + collection: STABLE_PROFILE_COLLECTION, rkey: "self", record, }, @@ -165,6 +223,7 @@ export default function OnboardingPage() { // Update profile status to mark onboarding as completed const profileStatusRecord: ProfileStatusRecord = { + $type: STABLE_PROFILE_STATUS_COLLECTION, completedOnboarding: "profileOnboarding", createdAt: new Date().toISOString(), updatedAt: new Date().toISOString(), @@ -176,7 +235,7 @@ export default function OnboardingPage() { {}, { repo: agent.did, - collection: "fm.teal.actor.profileStatus", + collection: STABLE_PROFILE_STATUS_COLLECTION, rkey: "self", record: profileStatusRecord, }, @@ -189,7 +248,7 @@ export default function OnboardingPage() { {}, { repo: agent.did, - collection: "fm.teal.actor.profileStatus", + collection: STABLE_PROFILE_STATUS_COLLECTION, rkey: "self", record: { ...profileStatusRecord, @@ -214,7 +273,7 @@ export default function OnboardingPage() { return
Loading...
; } - if (statusLoading) { + if (statusLoading || profileLoading) { return ( diff --git a/apps/amethyst/components/actor/actorView.tsx b/apps/amethyst/components/actor/actorView.tsx index 0cb9645..a434463 100644 --- a/apps/amethyst/components/actor/actorView.tsx +++ b/apps/amethyst/components/actor/actorView.tsx @@ -5,6 +5,11 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import { Button } from "@/components/ui/button"; import { Text } from "@/components/ui/text"; import getImageCdnLink from "@/lib/atp/getImageCdnLink"; +import { + LEGACY_PROFILE_COLLECTION, + readRepoRecordWithLegacyFallback, + STABLE_PROFILE_COLLECTION, +} from "@/lib/atp/onboardingRecords"; import { Icon } from "@/lib/icons/iconWithClassName"; import { useStore } from "@/stores/mainStore"; import { Agent } from "@atproto/api"; @@ -84,13 +89,18 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) { let currentUser: ProfileRecord | undefined; let cid: string | undefined; try { - const res = await pdsAgent.call("com.atproto.repo.getRecord", { - repo: pdsAgent.did, - collection: "fm.teal.actor.profile", - rkey: "self", - }); - currentUser = res.data.value; - cid = res.data.cid; + const result = await readRepoRecordWithLegacyFallback( + pdsAgent, + STABLE_PROFILE_COLLECTION, + LEGACY_PROFILE_COLLECTION, + ); + currentUser = result?.record; + // Legacy records are copied to the stable collection on the next edit; + // keep their blob refs and never try to update the old collection. + cid = + result?.collection === STABLE_PROFILE_COLLECTION + ? result.cid + : undefined; } catch (error) { console.error("Error fetching user profile:", error); } @@ -104,7 +114,9 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) { const data = await fetch(newAvatarUri).then((r) => r.blob()); const fileType = newAvatarUri.split(";")[0].split(":")[1]; const blob = new Blob([data], { type: fileType }); - newAvatarBlob = (await pdsAgent.uploadBlob(blob, { encoding: fileType })).data.blob as unknown as ProfileRecord["avatar"]; + newAvatarBlob = ( + await pdsAgent.uploadBlob(blob, { encoding: fileType }) + ).data.blob as unknown as ProfileRecord["avatar"]; } } if (newBannerUri) { @@ -112,11 +124,15 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) { const data = await fetch(newBannerUri).then((r) => r.blob()); const fileType = newBannerUri.split(";")[0].split(":")[1]; const blob = new Blob([data], { type: fileType }); - newBannerBlob = (await pdsAgent.uploadBlob(blob, { encoding: fileType })).data.blob as unknown as ProfileRecord["banner"]; + newBannerBlob = ( + await pdsAgent.uploadBlob(blob, { encoding: fileType }) + ).data.blob as unknown as ProfileRecord["banner"]; } } - let record: ProfileRecord = { + const record: ProfileRecord = { + ...currentUser, + $type: STABLE_PROFILE_COLLECTION, displayName: updatedProfile.displayName, description: updatedProfile.description, avatar: newAvatarBlob, @@ -131,7 +147,7 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) { {}, { repo: pdsAgent.did, - collection: "fm.teal.actor.profile", + collection: STABLE_PROFILE_COLLECTION, rkey: "self", record, swapRecord: cid, @@ -143,7 +159,7 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) { {}, { repo: pdsAgent.did, - collection: "fm.teal.actor.profile", + collection: STABLE_PROFILE_COLLECTION, rkey: "self", record, }, diff --git a/apps/amethyst/lib/__tests__/onboardingRecords.test.ts b/apps/amethyst/lib/__tests__/onboardingRecords.test.ts new file mode 100644 index 0000000..00b7232 --- /dev/null +++ b/apps/amethyst/lib/__tests__/onboardingRecords.test.ts @@ -0,0 +1,87 @@ +import { + getBlobHash, + LEGACY_PROFILE_COLLECTION, + readRepoRecordWithLegacyFallback, + STABLE_PROFILE_COLLECTION, +} from "../atp/onboardingRecords"; + +describe("readRepoRecordWithLegacyFallback", () => { + it("uses the stable record when it exists", async () => { + const call = jest.fn().mockResolvedValue({ + data: { cid: "stable-cid", value: { displayName: "Stable" } }, + }); + const agent = { call, did: "did:plc:test" }; + + const result = await readRepoRecordWithLegacyFallback( + agent as never, + STABLE_PROFILE_COLLECTION, + LEGACY_PROFILE_COLLECTION, + ); + + expect(result).toEqual({ + collection: STABLE_PROFILE_COLLECTION, + cid: "stable-cid", + record: { displayName: "Stable" }, + }); + expect(call).toHaveBeenCalledTimes(1); + expect(call).toHaveBeenCalledWith("com.atproto.repo.getRecord", { + repo: "did:plc:test", + collection: STABLE_PROFILE_COLLECTION, + rkey: "self", + }); + }); + + it("falls back to the legacy record when stable is missing", async () => { + const call = jest + .fn() + .mockRejectedValueOnce({ error: "RecordNotFound", message: "missing" }) + .mockResolvedValueOnce({ + data: { cid: "legacy-cid", value: { displayName: "Legacy" } }, + }); + const agent = { call, did: "did:plc:test" }; + + const result = await readRepoRecordWithLegacyFallback( + agent as never, + STABLE_PROFILE_COLLECTION, + LEGACY_PROFILE_COLLECTION, + ); + + expect(result).toEqual({ + collection: LEGACY_PROFILE_COLLECTION, + cid: "legacy-cid", + record: { displayName: "Legacy" }, + }); + expect(call).toHaveBeenNthCalledWith(2, "com.atproto.repo.getRecord", { + repo: "did:plc:test", + collection: LEGACY_PROFILE_COLLECTION, + rkey: "self", + }); + }); + + it("returns null when neither namespace has a record", async () => { + const call = jest + .fn() + .mockRejectedValue({ error: "RecordNotFound", message: "missing" }); + const agent = { call, did: "did:plc:test" }; + + await expect( + readRepoRecordWithLegacyFallback( + agent as never, + STABLE_PROFILE_COLLECTION, + LEGACY_PROFILE_COLLECTION, + ), + ).resolves.toBeNull(); + }); +}); + +describe("getBlobHash", () => { + it("extracts hashes from legacy repo blob refs", () => { + expect( + getBlobHash({ ref: { $link: "bafkreilegacy" }, mimeType: "image/jpeg" }), + ).toBe("bafkreilegacy"); + }); + + it("keeps string hashes compatible with appview profile responses", () => { + expect(getBlobHash("bafkreiappview")).toBe("bafkreiappview"); + }); +}); diff --git a/apps/amethyst/lib/atp/onboardingRecords.ts b/apps/amethyst/lib/atp/onboardingRecords.ts new file mode 100644 index 0000000..b372b91 --- /dev/null +++ b/apps/amethyst/lib/atp/onboardingRecords.ts @@ -0,0 +1,92 @@ +export const STABLE_PROFILE_COLLECTION = "fm.teal.actor.profile"; +export const LEGACY_PROFILE_COLLECTION = "fm.teal.alpha.actor.profile"; +export const STABLE_PROFILE_STATUS_COLLECTION = "fm.teal.actor.profileStatus"; +export const LEGACY_PROFILE_STATUS_COLLECTION = + "fm.teal.alpha.actor.profileStatus"; + +export interface RepoRecordAgent { + call: ( + methodNsid: string, + params?: Record, + ) => Promise<{ data: { cid?: string; value: unknown } }>; + did?: string; +} + +export interface RepoRecord { + collection: string; + cid?: string; + record: T; +} + +/** + * Read a self record from the stable namespace, falling back to the old + * namespace for users whose repositories have not been migrated yet. + */ +export async function readRepoRecordWithLegacyFallback( + agent: RepoRecordAgent, + stableCollection: string, + legacyCollection: string, +): Promise | null> { + try { + return await readRepoRecord(agent, stableCollection); + } catch (stableError) { + try { + return await readRepoRecord(agent, legacyCollection); + } catch (legacyError) { + if (isRecordNotFound(stableError) || isRecordNotFound(legacyError)) { + return null; + } + + throw stableError; + } + } +} + +function readRepoRecord( + agent: RepoRecordAgent, + collection: string, +): Promise> { + return agent + .call("com.atproto.repo.getRecord", { + repo: agent.did, + collection, + rkey: "self", + }) + .then((response) => ({ + collection, + cid: response.data.cid, + record: response.data.value as T, + })); +} + +function isRecordNotFound(error: unknown): boolean { + if (!error || typeof error !== "object") return false; + + const details = error as { error?: unknown; message?: unknown }; + const errorCode = typeof details.error === "string" ? details.error : ""; + const message = typeof details.message === "string" ? details.message : ""; + + return ( + errorCode === "RecordNotFound" || + /(?:record(?:.*)?(?:not found|does not exist)|(?:not found|does not exist).*record|could not find record)/i.test( + message, + ) + ); +} + +export function getBlobHash(blob: unknown): string | undefined { + if (typeof blob === "string") return blob; + if (!blob || typeof blob !== "object") return undefined; + + const ref = (blob as { ref?: unknown }).ref; + if (typeof ref === "string") return ref; + if (ref && typeof ref === "object") { + const link = (ref as { $link?: unknown }).$link; + if (typeof link === "string") return link; + + const stringified = String(ref); + if (stringified !== "[object Object]") return stringified; + } + + return undefined; +} diff --git a/services/cadet/src/ingestors/car/README.md b/services/cadet/src/ingestors/car/README.md index a9789e9..fc24cfa 100644 --- a/services/cadet/src/ingestors/car/README.md +++ b/services/cadet/src/ingestors/car/README.md @@ -73,6 +73,10 @@ The CAR importer automatically detects and processes these Teal record types: - **`fm.teal.actor.profile`** - User profile data - **`fm.teal.actor.status`** - User status updates +Historical CAR files using the legacy `fm.teal.alpha.*` collections are also +accepted. They are dispatched through the stable ingestors and stored with +stable `fm.teal.*` AT URIs. + Records are processed using the same logic as real-time Jetstream ingestion, ensuring data consistency. ## Architecture diff --git a/services/cadet/src/ingestors/car/car_import.rs b/services/cadet/src/ingestors/car/car_import.rs index a254b6c..7c5ee52 100644 --- a/services/cadet/src/ingestors/car/car_import.rs +++ b/services/cadet/src/ingestors/car/car_import.rs @@ -52,6 +52,59 @@ pub struct ExtractedRecord { pub data: serde_json::Value, } +const STABLE_PLAY_COLLECTION: &str = "fm.teal.feed.play"; +const STABLE_PROFILE_COLLECTION: &str = "fm.teal.actor.profile"; +const STABLE_STATUS_COLLECTION: &str = "fm.teal.actor.status"; +const LEGACY_PLAY_COLLECTION: &str = "fm.teal.alpha.feed.play"; +const LEGACY_PROFILE_COLLECTION: &str = "fm.teal.alpha.actor.profile"; +const LEGACY_STATUS_COLLECTION: &str = "fm.teal.alpha.actor.status"; + +/// Return the stable collection handled by the existing Teal ingestor. +/// +/// Historical CAR files contain records under the alpha namespace. Their +/// records have the same shape as the stable records, so they can be passed +/// through the stable ingestors after the collection is normalized. +fn stable_collection_for(collection: &str) -> Option<&'static str> { + match collection { + STABLE_PLAY_COLLECTION | LEGACY_PLAY_COLLECTION => Some(STABLE_PLAY_COLLECTION), + STABLE_PROFILE_COLLECTION | LEGACY_PROFILE_COLLECTION => Some(STABLE_PROFILE_COLLECTION), + STABLE_STATUS_COLLECTION | LEGACY_STATUS_COLLECTION => Some(STABLE_STATUS_COLLECTION), + _ => None, + } +} + +fn is_teal_record_key(key: &str) -> bool { + let Some((collection, rkey)) = key.rsplit_once('/') else { + return false; + }; + + !rkey.is_empty() && stable_collection_for(collection).is_some() +} + +fn parse_teal_key(key: &str) -> Option<(String, String)> { + if !is_teal_record_key(key) { + return None; + } + + let (collection, rkey) = key.rsplit_once('/')?; + Some((collection.to_string(), rkey.to_string())) +} + +fn normalize_legacy_record_type(data: &Value) -> Value { + let Value::Object(object) = data else { + return data.clone(); + }; + + let mut normalized = object.clone(); + if let Some(Value::String(record_type)) = normalized.get_mut("$type") { + if let Some(stable_type) = record_type.strip_prefix("fm.teal.alpha.") { + *record_type = format!("fm.teal.{stable_type}"); + } + } + + Value::Object(normalized) +} + /// CAR Import Ingestor handles importing Teal records from CAR files using atmst pub struct CarImportIngestor { sql: PgPool, @@ -159,9 +212,9 @@ impl CarImportIngestor { match result { Ok((key, record_cid)) => { // Check if this is a Teal record based on the key pattern - if self.is_teal_record_key(&key) { + if is_teal_record_key(&key) { info!("🎵 Found Teal record: {} -> {}", key, record_cid); - if let Some((collection, rkey)) = self.parse_teal_key(&key) { + if let Some((collection, rkey)) = parse_teal_key(&key) { info!(" Collection: {}, rkey: {}", collection, rkey); // Get the actual record data using the CID match self.get_record_data(&record_cid, car_importer).await { @@ -247,8 +300,8 @@ impl CarImportIngestor { "🔄 Processing {} record: {}", record.collection, record.rkey ); - match record.collection.as_str() { - "fm.teal.feed.play" => { + match stable_collection_for(&record.collection) { + Some(STABLE_PLAY_COLLECTION) => { info!(" 📀 Processing play record..."); let result = self .process_play_record(&record.data, did, &record.rkey) @@ -260,7 +313,7 @@ impl CarImportIngestor { } result } - "fm.teal.actor.profile" => { + Some(STABLE_PROFILE_COLLECTION) => { info!(" 👤 Processing profile record..."); let result = self .process_profile_record(&record.data, did, &record.rkey) @@ -272,7 +325,7 @@ impl CarImportIngestor { } result } - "fm.teal.actor.status" => { + Some(STABLE_STATUS_COLLECTION) => { info!(" 📢 Processing status record..."); let result = self .process_status_record(&record.data, did, &record.rkey) @@ -291,29 +344,14 @@ impl CarImportIngestor { } } - /// Check if a key represents a Teal record - fn is_teal_record_key(&self, key: &str) -> bool { - key.starts_with("fm.teal.") && key.contains("/") - } - - /// Parse a Teal MST key to extract collection and rkey - fn parse_teal_key(&self, key: &str) -> Option<(String, String)> { - if let Some(slash_pos) = key.rfind('/') { - let collection = key[..slash_pos].to_string(); - let rkey = key[slash_pos + 1..].to_string(); - Some((collection, rkey)) - } else { - None - } - } - /// Process a play record using the existing PlayIngestor async fn process_play_record(&self, data: &Value, did: &str, rkey: &str) -> Result<()> { + let data = normalize_legacy_record_type(data); let play_record: types::fm_teal::feed::play::Play = - value::from_json_value::(data.clone())?; + value::from_json_value::(data)?; let play_ingestor = super::super::teal::feed_play::PlayIngestor::new(self.sql.clone()); - let uri = super::super::teal::assemble_at_uri(did, "fm.teal.feed.play", rkey); + let uri = super::super::teal::assemble_at_uri(did, STABLE_PLAY_COLLECTION, rkey); play_ingestor .insert_play( @@ -334,8 +372,9 @@ impl CarImportIngestor { /// Process a profile record using the existing ActorProfileIngestor async fn process_profile_record(&self, data: &Value, did: &str, _rkey: &str) -> Result<()> { + let data = normalize_legacy_record_type(data); let profile_record: types::fm_teal::actor::profile::Profile = - value::from_json_value::(data.clone())?; + value::from_json_value::(data)?; let profile_ingestor = super::super::teal::actor_profile::ActorProfileIngestor::new(self.sql.clone()); @@ -353,8 +392,9 @@ impl CarImportIngestor { /// Process a status record using the existing ActorStatusIngestor async fn process_status_record(&self, data: &Value, did: &str, rkey: &str) -> Result<()> { + let data = normalize_legacy_record_type(data); let status_record: types::fm_teal::actor::status::Status = - value::from_json_value::(data.clone())?; + value::from_json_value::(data)?; let status_ingestor = super::super::teal::actor_status::ActorStatusIngestor::new(self.sql.clone()); @@ -652,32 +692,70 @@ mod tests { #[test] fn test_parse_teal_key() { - // This test doesn't need a database connection or async - let key = "fm.teal.feed.play/3k2akjdlkjsf"; - - // Test the parsing logic directly - if let Some(slash_pos) = key.rfind('/') { - let collection = key[..slash_pos].to_string(); - let rkey = key[slash_pos + 1..].to_string(); + for collection in [STABLE_PLAY_COLLECTION, LEGACY_PLAY_COLLECTION] { + let key = format!("{collection}/3k2akjdlkjsf"); + let (parsed_collection, rkey) = parse_teal_key(&key).expect("valid Teal key"); - assert_eq!(collection, "fm.teal.feed.play"); + assert_eq!(parsed_collection, collection); assert_eq!(rkey, "3k2akjdlkjsf"); - } else { - panic!("Should have found slash in key"); } } #[test] fn test_is_teal_record_key() { - // Test the logic directly without needing an ingestor instance - fn is_teal_record_key(key: &str) -> bool { - key.starts_with("fm.teal.") && key.contains("/") - } - assert!(is_teal_record_key("fm.teal.feed.play/abc123")); assert!(is_teal_record_key("fm.teal.actor.profile/def456")); + assert!(is_teal_record_key("fm.teal.alpha.feed.play/abc123")); + assert!(is_teal_record_key("fm.teal.alpha.actor.profile/def456")); + assert!(is_teal_record_key("fm.teal.alpha.actor.status/ghi789")); assert!(!is_teal_record_key("app.bsky.feed.post/xyz789")); assert!(!is_teal_record_key("fm.teal.feed.play")); // No rkey + assert!(!is_teal_record_key("fm.teal.feed.play/")); // Empty rkey + } + + #[test] + fn test_legacy_collections_route_to_stable_ingestors() { + let collections = [ + ( + LEGACY_PLAY_COLLECTION, + STABLE_PLAY_COLLECTION, + "3k2akjdlkjsf", + ), + (LEGACY_PROFILE_COLLECTION, STABLE_PROFILE_COLLECTION, "self"), + (LEGACY_STATUS_COLLECTION, STABLE_STATUS_COLLECTION, "self"), + ]; + + for (legacy_collection, stable_collection, rkey) in collections { + let key = format!("{legacy_collection}/{rkey}"); + let (parsed_collection, parsed_rkey) = + parse_teal_key(&key).expect("legacy Teal record should be retained"); + + assert_eq!(parsed_collection, legacy_collection); + assert_eq!(parsed_rkey, rkey); + assert_eq!( + stable_collection_for(&parsed_collection), + Some(stable_collection) + ); + assert_eq!( + crate::ingestors::teal::assemble_at_uri( + "did:plc:historical", + stable_collection_for(&parsed_collection).unwrap(), + &parsed_rkey, + ), + format!("at://did:plc:historical/{stable_collection}/{rkey}"), + ); + } + } + + #[test] + fn test_normalize_legacy_record_type() { + let data = serde_json::json!({ + "$type": "fm.teal.alpha.actor.status", + "time": "2024-01-01T00:00:00Z" + }); + + let normalized = normalize_legacy_record_type(&data); + assert_eq!(normalized["$type"], "fm.teal.actor.status"); } #[test] diff --git a/services/cadet/src/ingestors/teal/feed_play.rs b/services/cadet/src/ingestors/teal/feed_play.rs index ab20e8b..7a47b7e 100644 --- a/services/cadet/src/ingestors/teal/feed_play.rs +++ b/services/cadet/src/ingestors/teal/feed_play.rs @@ -1600,7 +1600,11 @@ impl LexiconIngestor for PlayIngestor { // TODO: verify cid self.insert_play( &record, - &assemble_at_uri(&message.did, &commit.collection, &commit.rkey), + &assemble_at_uri( + &message.did, + crate::ingestors::teal::canonical_collection(&commit.collection), + &commit.rkey, + ), cid, &message.did, &commit.rkey, @@ -1610,7 +1614,12 @@ impl LexiconIngestor for PlayIngestor { } } else { println!("{}: Message {} deleted", message.did, commit.rkey); - self.remove_play(&message.did).await?; + let uri = assemble_at_uri( + &message.did, + crate::ingestors::teal::canonical_collection(&commit.collection), + &commit.rkey, + ); + self.remove_play(&uri).await?; } } else { return Err(anyhow!("Message has no commit")); diff --git a/services/cadet/src/ingestors/teal/mod.rs b/services/cadet/src/ingestors/teal/mod.rs index 5f402ac..daa0b7c 100644 --- a/services/cadet/src/ingestors/teal/mod.rs +++ b/services/cadet/src/ingestors/teal/mod.rs @@ -2,6 +2,42 @@ pub mod actor_profile; pub mod actor_status; pub mod feed_play; +pub const STABLE_FEED_PLAY: &str = "fm.teal.feed.play"; +pub const STABLE_ACTOR_PROFILE: &str = "fm.teal.actor.profile"; +pub const STABLE_ACTOR_STATUS: &str = "fm.teal.actor.status"; + +pub const ALPHA_FEED_PLAY: &str = "fm.teal.alpha.feed.play"; +pub const ALPHA_ACTOR_PROFILE: &str = "fm.teal.alpha.actor.profile"; +pub const ALPHA_ACTOR_STATUS: &str = "fm.teal.alpha.actor.status"; + +const COLLECTION_ALIASES: [(&str, &str); 3] = [ + (ALPHA_FEED_PLAY, STABLE_FEED_PLAY), + (ALPHA_ACTOR_PROFILE, STABLE_ACTOR_PROFILE), + (ALPHA_ACTOR_STATUS, STABLE_ACTOR_STATUS), +]; + +pub fn canonical_collection(collection: &str) -> &str { + COLLECTION_ALIASES + .iter() + .find_map(|(alias, stable)| (*alias == collection).then_some(*stable)) + .unwrap_or(collection) +} + +pub fn wanted_collections() -> Vec { + [ + STABLE_FEED_PLAY, + STABLE_ACTOR_PROFILE, + STABLE_ACTOR_STATUS, + ALPHA_FEED_PLAY, + ALPHA_ACTOR_PROFILE, + ALPHA_ACTOR_STATUS, + "com.atproto.repo.importRepo", + ] + .into_iter() + .map(str::to_string) + .collect() +} + /// Parses an AT uri into parts: /// did/handle, collection, rkey // fn parse_at_parts(aturi: &str) -> (&str, Option<&str>, Option<&str>) { @@ -15,3 +51,35 @@ pub mod feed_play; pub fn assemble_at_uri(did: &str, collection: &str, rkey: &str) -> String { format!("at://{did}/{collection}/{rkey}") } + +#[cfg(test)] +mod tests { + use super::{canonical_collection, wanted_collections}; + + #[test] + fn canonicalizes_alpha_collections_to_stable_names() { + for (alpha, stable) in [ + ("fm.teal.alpha.feed.play", "fm.teal.feed.play"), + ("fm.teal.alpha.actor.profile", "fm.teal.actor.profile"), + ("fm.teal.alpha.actor.status", "fm.teal.actor.status"), + ] { + assert_eq!(canonical_collection(alpha), stable); + } + } + + #[test] + fn wanted_collections_include_stable_and_alpha_records() { + let wanted = wanted_collections(); + + for collection in [ + "fm.teal.feed.play", + "fm.teal.actor.profile", + "fm.teal.actor.status", + "fm.teal.alpha.feed.play", + "fm.teal.alpha.actor.profile", + "fm.teal.alpha.actor.status", + ] { + assert!(wanted.iter().any(|wanted| wanted == collection)); + } + } +} diff --git a/services/cadet/src/main.rs b/services/cadet/src/main.rs index 7594abf..b942549 100644 --- a/services/cadet/src/main.rs +++ b/services/cadet/src/main.rs @@ -48,41 +48,46 @@ async fn main() { .expect("Could not get PostgreSQL pool"); let opts = JetstreamOptions::builder() - .wanted_collections( - [ - "fm.teal.feed.play", - "fm.teal.actor.profile", - "fm.teal.actor.status", - "com.atproto.repo.importRepo", - ] - .iter() - .map(|collection| collection.to_string()) - .collect(), - ) + .wanted_collections(ingestors::teal::wanted_collections()) .build(); let jetstream = JetstreamConnection::new(opts); let mut ingestors: HashMap> = HashMap::new(); - ingestors.insert( - "fm.teal.feed.play".to_string(), - Box::new(ingestors::teal::feed_play::PlayIngestor::new(pool.clone())), - ); + for collection in [ + ingestors::teal::STABLE_FEED_PLAY, + ingestors::teal::ALPHA_FEED_PLAY, + ] { + ingestors.insert( + collection.to_string(), + Box::new(ingestors::teal::feed_play::PlayIngestor::new(pool.clone())), + ); + } - ingestors.insert( - "fm.teal.actor.profile".to_string(), - Box::new(ingestors::teal::actor_profile::ActorProfileIngestor::new( - pool.clone(), - )), - ); + for collection in [ + ingestors::teal::STABLE_ACTOR_PROFILE, + ingestors::teal::ALPHA_ACTOR_PROFILE, + ] { + ingestors.insert( + collection.to_string(), + Box::new(ingestors::teal::actor_profile::ActorProfileIngestor::new( + pool.clone(), + )), + ); + } - ingestors.insert( - "fm.teal.actor.status".to_string(), - Box::new(ingestors::teal::actor_status::ActorStatusIngestor::new( - pool.clone(), - )), - ); + for collection in [ + ingestors::teal::STABLE_ACTOR_STATUS, + ingestors::teal::ALPHA_ACTOR_STATUS, + ] { + ingestors.insert( + collection.to_string(), + Box::new(ingestors::teal::actor_status::ActorStatusIngestor::new( + pool.clone(), + )), + ); + } ingestors.insert( "com.atproto.repo.importRepo".to_string(), -- 2.51.2 From 1a5ad0568f4bfc5b6732dcf4adb05139ff0c148a Mon Sep 17 00:00:00 2001 From: mmattbtw Date: Wed, 12 Aug 2026 19:20:30 -0500 Subject: [PATCH 12/16] fix(cadet): deduplicate alpha and stable CAR records --- .../cadet/src/ingestors/car/car_import.rs | 109 +++++++++++++++++- 1 file changed, 108 insertions(+), 1 deletion(-) diff --git a/services/cadet/src/ingestors/car/car_import.rs b/services/cadet/src/ingestors/car/car_import.rs index 7c5ee52..3327cce 100644 --- a/services/cadet/src/ingestors/car/car_import.rs +++ b/services/cadet/src/ingestors/car/car_import.rs @@ -105,6 +105,45 @@ fn normalize_legacy_record_type(data: &Value) -> Value { Value::Object(normalized) } +fn is_legacy_collection(collection: &str) -> bool { + matches!( + collection, + LEGACY_PLAY_COLLECTION | LEGACY_PROFILE_COLLECTION | LEGACY_STATUS_COLLECTION + ) +} + +/// Drop duplicate stable/alpha records from a repository snapshot. +/// +/// The namespace is part of a record's `$type`, so compare records after only +/// normalizing that root NSID. Records with the same canonical collection, +/// exact rkey, and exact normalized JSON are the same logical record. Prefer +/// the stable collection when both namespace variants are present. +fn deduplicate_records(records: Vec) -> Vec { + let mut deduplicated: Vec = Vec::with_capacity(records.len()); + + for record in records { + let canonical_collection = stable_collection_for(&record.collection); + let normalized_data = normalize_legacy_record_type(&record.data); + let duplicate_index = deduplicated.iter().position(|existing| { + stable_collection_for(&existing.collection) == canonical_collection + && existing.rkey == record.rkey + && normalize_legacy_record_type(&existing.data) == normalized_data + }); + + if let Some(index) = duplicate_index { + if is_legacy_collection(&deduplicated[index].collection) + && !is_legacy_collection(&record.collection) + { + deduplicated[index] = record; + } + } else { + deduplicated.push(record); + } + } + + deduplicated +} + /// CAR Import Ingestor handles importing Teal records from CAR files using atmst pub struct CarImportIngestor { sql: PgPool, @@ -168,8 +207,14 @@ impl CarImportIngestor { let records = self .extract_records_from_mst(&mst, &data_importer, did) .await?; + let extracted_count = records.len(); + let records = deduplicate_records(records); - info!("Extracted {} records from MST", records.len()); + info!( + "Extracted {} records from MST ({} after namespace deduplication)", + extracted_count, + records.len() + ); // Process each record through the appropriate ingestor let mut processed_count = 0; @@ -758,6 +803,68 @@ mod tests { assert_eq!(normalized["$type"], "fm.teal.actor.status"); } + #[test] + fn test_deduplicate_identical_alpha_and_stable_records_prefers_stable() { + let record_fields = serde_json::json!({ + "trackName": "Same recording", + "playedTime": "2024-01-01T00:00:00Z" + }); + let mut legacy_data = record_fields.clone(); + legacy_data["$type"] = serde_json::json!(LEGACY_PLAY_COLLECTION); + let mut stable_data = record_fields; + stable_data["$type"] = serde_json::json!(STABLE_PLAY_COLLECTION); + + let records = deduplicate_records(vec![ + ExtractedRecord { + collection: LEGACY_PLAY_COLLECTION.to_string(), + rkey: "same-rkey".to_string(), + data: legacy_data, + }, + ExtractedRecord { + collection: STABLE_PLAY_COLLECTION.to_string(), + rkey: "same-rkey".to_string(), + data: stable_data, + }, + ]); + + assert_eq!(records.len(), 1); + assert_eq!(records[0].collection, STABLE_PLAY_COLLECTION); + assert_eq!(records[0].rkey, "same-rkey"); + assert_eq!(records[0].data["$type"], STABLE_PLAY_COLLECTION); + } + + #[test] + fn test_deduplicate_keeps_different_content_or_rkeys() { + let records = deduplicate_records(vec![ + ExtractedRecord { + collection: LEGACY_STATUS_COLLECTION.to_string(), + rkey: "same-rkey".to_string(), + data: serde_json::json!({ + "$type": LEGACY_STATUS_COLLECTION, + "time": "2024-01-01T00:00:00Z" + }), + }, + ExtractedRecord { + collection: STABLE_STATUS_COLLECTION.to_string(), + rkey: "same-rkey".to_string(), + data: serde_json::json!({ + "$type": STABLE_STATUS_COLLECTION, + "time": "2024-01-01T00:01:00Z" + }), + }, + ExtractedRecord { + collection: STABLE_STATUS_COLLECTION.to_string(), + rkey: "different-rkey".to_string(), + data: serde_json::json!({ + "$type": STABLE_STATUS_COLLECTION, + "time": "2024-01-01T00:00:00Z" + }), + }, + ]); + + assert_eq!(records.len(), 3); + } + #[test] fn test_ipld_to_json_conversion() { // Test IPLD to JSON conversion logic directly -- 2.51.2 From adcc72524235c0e4d2e20327b975bd1850dfa570 Mon Sep 17 00:00:00 2001 From: mmattbtw Date: Wed, 12 Aug 2026 19:48:44 -0500 Subject: [PATCH 13/16] fix(namespace): complete stable API migration compatibility Preserve legacy onboarding and direct ingestion during the namespace rollout, while restoring stable Aqua endpoints and response fields. --- ...19d213124144d9ecb22aa2302d675a80ce7c4.json | 42 ++++++++ ...e681b97669c1d6d33455cc0f7f33ae107aad5.json | 41 +++++++ apps/amethyst/components/actor/actorView.tsx | 2 +- .../lib/__tests__/onboardingRecords.test.ts | 40 +++++++ apps/amethyst/lib/atp/onboardingRecords.ts | 7 +- apps/amethyst/stores/authenticationSlice.tsx | 2 +- apps/aqua/src/repos/actor_profile.rs | 95 +++++++++++++++- apps/aqua/src/xrpc/actor.rs | 102 +++++++++++++++--- apps/aqua/src/xrpc/feed.rs | 80 ++++++++++++-- .../cadet/src/ingestors/car/car_import.rs | 16 +-- .../cadet/src/ingestors/teal/actor_profile.rs | 55 +++++++++- .../cadet/src/ingestors/teal/actor_status.rs | 60 ++++++++++- .../cadet/src/ingestors/teal/feed_play.rs | 53 ++++++++- services/cadet/src/ingestors/teal/mod.rs | 18 ++++ tools/lexicon-cli/src/commands/validate.ts | 2 +- 15 files changed, 552 insertions(+), 63 deletions(-) create mode 100644 .sqlx/query-41b7d971ace6a57750c7a4d3fbf19d213124144d9ecb22aa2302d675a80ce7c4.json create mode 100644 .sqlx/query-7e4ab6be5c601dab08817293924e681b97669c1d6d33455cc0f7f33ae107aad5.json diff --git a/.sqlx/query-41b7d971ace6a57750c7a4d3fbf19d213124144d9ecb22aa2302d675a80ce7c4.json b/.sqlx/query-41b7d971ace6a57750c7a4d3fbf19d213124144d9ecb22aa2302d675a80ce7c4.json new file mode 100644 index 0000000..aca0fda --- /dev/null +++ b/.sqlx/query-41b7d971ace6a57750c7a4d3fbf19d213124144d9ecb22aa2302d675a80ce7c4.json @@ -0,0 +1,42 @@ +{ + "db_name": "PostgreSQL", + "query": "\n SELECT avatar, did, display_name, handle\n FROM profiles\n WHERE display_name ILIKE '%' || $1 || '%' ESCAPE '!'\n OR description ILIKE '%' || $1 || '%' ESCAPE '!'\n OR handle ILIKE '%' || $1 || '%' ESCAPE '!'\n ORDER BY display_name NULLS LAST, did\n LIMIT $2 OFFSET $3\n ", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "avatar", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "did", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "display_name", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "handle", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "Text", + "Int8", + "Int8" + ] + }, + "nullable": [ + true, + false, + true, + true + ] + }, + "hash": "41b7d971ace6a57750c7a4d3fbf19d213124144d9ecb22aa2302d675a80ce7c4" +} diff --git a/.sqlx/query-7e4ab6be5c601dab08817293924e681b97669c1d6d33455cc0f7f33ae107aad5.json b/.sqlx/query-7e4ab6be5c601dab08817293924e681b97669c1d6d33455cc0f7f33ae107aad5.json new file mode 100644 index 0000000..25db21f --- /dev/null +++ b/.sqlx/query-7e4ab6be5c601dab08817293924e681b97669c1d6d33455cc0f7f33ae107aad5.json @@ -0,0 +1,41 @@ +{ + "db_name": "PostgreSQL", + "query": "SELECT p.avatar, p.did, p.display_name, p.handle\n FROM profiles p\n WHERE (p.did = ANY($1)) OR (p.handle = ANY($2))\n ORDER BY p.display_name NULLS LAST, p.did", + "describe": { + "columns": [ + { + "ordinal": 0, + "name": "avatar", + "type_info": "Text" + }, + { + "ordinal": 1, + "name": "did", + "type_info": "Text" + }, + { + "ordinal": 2, + "name": "display_name", + "type_info": "Text" + }, + { + "ordinal": 3, + "name": "handle", + "type_info": "Text" + } + ], + "parameters": { + "Left": [ + "TextArray", + "TextArray" + ] + }, + "nullable": [ + true, + false, + true, + true + ] + }, + "hash": "7e4ab6be5c601dab08817293924e681b97669c1d6d33455cc0f7f33ae107aad5" +} diff --git a/apps/amethyst/components/actor/actorView.tsx b/apps/amethyst/components/actor/actorView.tsx index a434463..c6c9ef1 100644 --- a/apps/amethyst/components/actor/actorView.tsx +++ b/apps/amethyst/components/actor/actorView.tsx @@ -52,7 +52,7 @@ export default function ActorView({ actorDid, pdsAgent }: ActorViewProps) { { headers: { "atproto-proxy": tealDid + "#teal_fm_appview" } }, ); if (isMounted) { - setProfile(res.data["actor"] as GetProfileOutputSchema["actor"]); + setProfile(res.data.actor as GetProfileOutputSchema["actor"]); } } catch (error) { console.error("Error fetching profile:", error); diff --git a/apps/amethyst/lib/__tests__/onboardingRecords.test.ts b/apps/amethyst/lib/__tests__/onboardingRecords.test.ts index 00b7232..9ce8ca7 100644 --- a/apps/amethyst/lib/__tests__/onboardingRecords.test.ts +++ b/apps/amethyst/lib/__tests__/onboardingRecords.test.ts @@ -72,6 +72,46 @@ describe("readRepoRecordWithLegacyFallback", () => { ), ).resolves.toBeNull(); }); + + it("propagates a legacy read failure when the stable record is missing", async () => { + const legacyError = { + error: "NetworkError", + message: "legacy read failed", + }; + const call = jest + .fn() + .mockRejectedValueOnce({ error: "RecordNotFound", message: "missing" }) + .mockRejectedValueOnce(legacyError); + const agent = { call, did: "did:plc:test" }; + + await expect( + readRepoRecordWithLegacyFallback( + agent as never, + STABLE_PROFILE_COLLECTION, + LEGACY_PROFILE_COLLECTION, + ), + ).rejects.toBe(legacyError); + }); + + it("propagates a stable read failure when the legacy record is missing", async () => { + const stableError = { + error: "NetworkError", + message: "stable read failed", + }; + const call = jest + .fn() + .mockRejectedValueOnce(stableError) + .mockRejectedValueOnce({ error: "RecordNotFound", message: "missing" }); + const agent = { call, did: "did:plc:test" }; + + await expect( + readRepoRecordWithLegacyFallback( + agent as never, + STABLE_PROFILE_COLLECTION, + LEGACY_PROFILE_COLLECTION, + ), + ).rejects.toBe(stableError); + }); }); describe("getBlobHash", () => { diff --git a/apps/amethyst/lib/atp/onboardingRecords.ts b/apps/amethyst/lib/atp/onboardingRecords.ts index b372b91..8d3b044 100644 --- a/apps/amethyst/lib/atp/onboardingRecords.ts +++ b/apps/amethyst/lib/atp/onboardingRecords.ts @@ -33,11 +33,14 @@ export async function readRepoRecordWithLegacyFallback( try { return await readRepoRecord(agent, legacyCollection); } catch (legacyError) { - if (isRecordNotFound(stableError) || isRecordNotFound(legacyError)) { + const stableNotFound = isRecordNotFound(stableError); + const legacyNotFound = isRecordNotFound(legacyError); + + if (stableNotFound && legacyNotFound) { return null; } - throw stableError; + throw stableNotFound ? legacyError : stableError; } } } diff --git a/apps/amethyst/stores/authenticationSlice.tsx b/apps/amethyst/stores/authenticationSlice.tsx index d117cef..28d5f40 100644 --- a/apps/amethyst/stores/authenticationSlice.tsx +++ b/apps/amethyst/stores/authenticationSlice.tsx @@ -192,7 +192,7 @@ export const createAuthenticationSlice: StateCreator = ( ) .then((profile) => { console.log(profile); - return profile.data.agent || null; + return profile.data.actor || null; }); set({ diff --git a/apps/aqua/src/repos/actor_profile.rs b/apps/aqua/src/repos/actor_profile.rs index 642d8d5..239be32 100644 --- a/apps/aqua/src/repos/actor_profile.rs +++ b/apps/aqua/src/repos/actor_profile.rs @@ -3,7 +3,7 @@ use jacquard_common::from_json_value; use serde_json::Value; use types::{ app_bsky::richtext::facet::Facet, - fm_teal::actor::{ProfileView, StatusView}, + fm_teal::actor::{MiniProfileView, ProfileView, StatusView}, }; use super::{pg::PgDataSource, utc_to_atrium_datetime}; @@ -15,6 +15,16 @@ pub trait ActorProfileRepo { &self, identities: &[String], ) -> anyhow::Result>; + async fn get_multiple_actor_mini_profiles( + &self, + identities: &[String], + ) -> anyhow::Result>; + async fn search_actor_profiles( + &self, + query: &str, + limit: i64, + offset: i64, + ) -> anyhow::Result>; } pub struct PgProfileRepoRows { @@ -28,6 +38,25 @@ pub struct PgProfileRepoRows { pub status: Option, } +pub struct PgMiniProfileRepoRows { + pub avatar: Option, + pub did: Option, + pub display_name: Option, + pub handle: Option, +} + +impl From for MiniProfileView { + fn from(row: PgMiniProfileRepoRows) -> Self { + Self { + avatar: row.avatar.map(Into::into), + did: row.did.map(Into::into), + display_name: row.display_name.map(Into::into), + handle: row.handle.map(Into::into), + extra_data: Default::default(), + } + } +} + impl From for ProfileView { fn from(row: PgProfileRepoRows) -> Self { Self { @@ -96,4 +125,68 @@ impl ActorProfileRepo for PgDataSource { .await?; Ok(profiles.into_iter().map(|p| p.into()).collect()) } + + async fn get_multiple_actor_mini_profiles( + &self, + identities: &[String], + ) -> anyhow::Result> { + let (dids, handles) = split_identities(identities); + let profiles = sqlx::query_as!( + PgMiniProfileRepoRows, + "SELECT p.avatar, p.did, p.display_name, p.handle + FROM profiles p + WHERE (p.did = ANY($1)) OR (p.handle = ANY($2)) + ORDER BY p.display_name NULLS LAST, p.did", + &dids, + &handles, + ) + .fetch_all(&self.db) + .await?; + + Ok(profiles.into_iter().map(Into::into).collect()) + } + + async fn search_actor_profiles( + &self, + query: &str, + limit: i64, + offset: i64, + ) -> anyhow::Result> { + let query = query + .replace('!', "!!") + .replace('%', "!%") + .replace('_', "!_"); + let profiles = sqlx::query_as!( + PgMiniProfileRepoRows, + r#" + SELECT avatar, did, display_name, handle + FROM profiles + WHERE display_name ILIKE '%' || $1 || '%' ESCAPE '!' + OR description ILIKE '%' || $1 || '%' ESCAPE '!' + OR handle ILIKE '%' || $1 || '%' ESCAPE '!' + ORDER BY display_name NULLS LAST, did + LIMIT $2 OFFSET $3 + "#, + query, + limit, + offset, + ) + .fetch_all(&self.db) + .await?; + + Ok(profiles.into_iter().map(Into::into).collect()) + } +} + +fn split_identities(identities: &[String]) -> (Vec, Vec) { + let mut dids = Vec::new(); + let mut handles = Vec::new(); + for identity in identities { + if identity.starts_with("did:") { + dids.push(identity.clone()); + } else { + handles.push(identity.clone()); + } + } + (dids, handles) } diff --git a/apps/aqua/src/xrpc/actor.rs b/apps/aqua/src/xrpc/actor.rs index 67282af..7b6ddfb 100644 --- a/apps/aqua/src/xrpc/actor.rs +++ b/apps/aqua/src/xrpc/actor.rs @@ -1,14 +1,15 @@ use crate::ctx::Context; -use axum::{Extension, http::StatusCode, response::IntoResponse, routing::get}; +use axum::{http::StatusCode, response::IntoResponse, routing::get, Extension}; use jacquard_common::IntoStatic; use serde::{Deserialize, Serialize}; -use types::fm_teal::actor::ProfileView; +use types::fm_teal::actor::{MiniProfileView, ProfileView}; // mount actor routes pub fn actor_routes() -> axum::Router { axum::Router::new() .route("/fm.teal.actor.getProfile", get(get_actor)) .route("/fm.teal.actor.getProfiles", get(get_actors)) + .route("/fm.teal.actor.searchActors", get(search_actors)) } #[derive(Deserialize)] @@ -18,7 +19,7 @@ pub struct GetProfileQuery { #[derive(Serialize)] pub struct GetProfileResponse { - profile: ProfileView, + actor: ProfileView, } pub async fn get_actor( @@ -26,24 +27,91 @@ pub async fn get_actor( axum::extract::Query(query): axum::extract::Query, ) -> Result { let repo = &ctx.db; // assuming ctx.db is Box - let identity = &query.actor; + let identity = match query.actor.as_deref() { + Some(identity) => identity, + None => return Err((StatusCode::BAD_REQUEST, "actor is required".to_string())), + }; - if identity.is_none() { - return Err((StatusCode::BAD_REQUEST, "actor is required".to_string())); - } - - match repo - .get_actor_profile(identity.as_ref().expect("actor is not none").as_str()) - .await - { + match repo.get_actor_profile(identity).await { Ok(Some(profile)) => Ok(axum::Json(GetProfileResponse { - profile: profile.into_static(), + actor: profile.into_static(), })), Ok(None) => Err((StatusCode::NOT_FOUND, "Profile not found".to_string())), Err(e) => Err((StatusCode::INTERNAL_SERVER_ERROR, e.to_string())), } } +#[derive(Deserialize)] +pub struct SearchActorsQuery { + pub q: String, + pub limit: Option, + pub cursor: Option, +} + +#[derive(Serialize)] +pub struct SearchActorsResponse { + actors: Vec, + #[serde(skip_serializing_if = "Option::is_none")] + cursor: Option, +} + +pub async fn search_actors( + Extension(ctx): Extension, + axum::extract::Query(query): axum::extract::Query, +) -> Result { + if query.q.trim().is_empty() { + return Err((StatusCode::BAD_REQUEST, "q is required".to_string())); + } + + let limit = query.limit.unwrap_or(25); + if !(1..=25).contains(&limit) { + return Err(( + StatusCode::BAD_REQUEST, + "limit must be between 1 and 25".to_string(), + )); + } + let offset = query + .cursor + .as_deref() + .unwrap_or("0") + .parse::() + .map_err(|_| { + ( + StatusCode::BAD_REQUEST, + "cursor must be a non-negative integer".to_string(), + ) + })?; + if offset < 0 { + return Err(( + StatusCode::BAD_REQUEST, + "cursor must be a non-negative integer".to_string(), + )); + } + + let next_offset = offset.checked_add(limit).ok_or_else(|| { + ( + StatusCode::BAD_REQUEST, + "cursor is out of range".to_string(), + ) + })?; + let mut actors = ctx + .db + .search_actor_profiles(query.q.trim(), limit + 1, offset) + .await + .map_err(|e| (StatusCode::INTERNAL_SERVER_ERROR, e.to_string()))?; + let cursor = if actors.len() > limit as usize { + actors.truncate(limit as usize); + Some(next_offset.to_string()) + } else { + None + }; + + Ok(axum::Json(SearchActorsResponse { + actors: actors.into_static(), + cursor, + })) +} + #[derive(Deserialize)] pub struct GetProfilesQuery { pub actors: Vec, @@ -51,7 +119,7 @@ pub struct GetProfilesQuery { #[derive(Serialize)] pub struct GetProfilesResponse { - profiles: Vec, + actors: Vec, } pub async fn get_actors( @@ -65,9 +133,9 @@ pub async fn get_actors( return Err((StatusCode::BAD_REQUEST, "actor is required".to_string())); } - match repo.get_multiple_actor_profiles(actor).await { - Ok(profiles) => Ok(axum::Json(GetProfilesResponse { - profiles: profiles.into_static(), + match repo.get_multiple_actor_mini_profiles(actor).await { + Ok(actors) => Ok(axum::Json(GetProfilesResponse { + actors: actors.into_static(), })), Err(e) => Err((StatusCode::INTERNAL_SERVER_ERROR, e.to_string())), } diff --git a/apps/aqua/src/xrpc/feed.rs b/apps/aqua/src/xrpc/feed.rs index b81c598..72aff6e 100644 --- a/apps/aqua/src/xrpc/feed.rs +++ b/apps/aqua/src/xrpc/feed.rs @@ -1,5 +1,5 @@ use crate::ctx::Context; -use axum::{Extension, http::StatusCode, response::IntoResponse, routing::get}; +use axum::{http::StatusCode, response::IntoResponse, routing::get, Extension}; use jacquard_common::IntoStatic; use serde::{Deserialize, Serialize}; use types::fm_teal::feed::PlayView; @@ -9,11 +9,14 @@ pub fn feed_routes() -> axum::Router { axum::Router::new() .route("/fm.teal.feed.getPlay", get(get_feed_play)) .route("/fm.teal.feed.getPlays", get(get_feed_plays)) + .route("/fm.teal.feed.getActorFeed", get(get_actor_feed)) } #[derive(Deserialize)] pub struct GetFeedPlayQuery { - pub identity: Option, + #[serde(rename = "authorDID")] + pub author_did: Option, + pub rkey: Option, } #[derive(Serialize)] @@ -26,16 +29,20 @@ pub async fn get_feed_play( axum::extract::Query(query): axum::extract::Query, ) -> Result { let repo = &ctx.db; - let identity = &query.identity; + let (author_did, rkey) = match (query.author_did.as_deref(), query.rkey.as_deref()) { + (Some(author_did), Some(rkey)) if !author_did.is_empty() && !rkey.is_empty() => { + (author_did, rkey) + } + _ => { + return Err(( + StatusCode::BAD_REQUEST, + "authorDID and rkey are required".to_string(), + )); + } + }; + let identity = format!("at://{author_did}/fm.teal.feed.play/{rkey}"); - if identity.is_none() { - return Err((StatusCode::BAD_REQUEST, "identity is required".to_string())); - } - - match repo - .get_feed_play(identity.as_ref().expect("identity is not none").as_str()) - .await - { + match repo.get_feed_play(&identity).await { Ok(Some(play)) => Ok(axum::Json(GetFeedPlayResponse { play: play.into_static(), })), @@ -75,3 +82,54 @@ pub async fn get_feed_plays( Err(e) => Err((StatusCode::INTERNAL_SERVER_ERROR, e.to_string())), } } + +#[derive(Deserialize)] +pub struct GetActorFeedQuery { + #[serde(rename = "authorDID")] + pub author_did: String, + pub cursor: Option, + pub limit: Option, +} + +#[derive(Serialize)] +pub struct GetActorFeedResponse { + plays: Vec, +} + +pub async fn get_actor_feed( + Extension(ctx): Extension, + axum::extract::Query(query): axum::extract::Query, +) -> Result { + if !query.author_did.starts_with("did:") { + return Err(( + StatusCode::BAD_REQUEST, + "authorDID must be a DID".to_string(), + )); + } + + let limit = query.limit.unwrap_or(20); + if !(1..=50).contains(&limit) { + return Err(( + StatusCode::BAD_REQUEST, + "limit must be between 1 and 50".to_string(), + )); + } + let limit = limit as usize; + let offset = query + .cursor + .as_deref() + .unwrap_or("0") + .parse::() + .map_err(|_| (StatusCode::BAD_REQUEST, "cursor is invalid".to_string()))?; + + match ctx + .db + .get_feed_plays_for_profile(std::slice::from_ref(&query.author_did)) + .await + { + Ok(plays) => Ok(axum::Json(GetActorFeedResponse { + plays: plays.into_iter().skip(offset).take(limit).collect(), + })), + Err(e) => Err((StatusCode::INTERNAL_SERVER_ERROR, e.to_string())), + } +} diff --git a/services/cadet/src/ingestors/car/car_import.rs b/services/cadet/src/ingestors/car/car_import.rs index 3327cce..4dafbdd 100644 --- a/services/cadet/src/ingestors/car/car_import.rs +++ b/services/cadet/src/ingestors/car/car_import.rs @@ -31,6 +31,7 @@ //! and use the original rkey from the AT Protocol MST structure. use crate::ingestors::car::jobs::{queue_keys, CarImportJob}; +use crate::ingestors::teal::normalize_legacy_record_type; use crate::redis_client::RedisClient; use anyhow::{anyhow, Result}; use async_trait::async_trait; @@ -90,21 +91,6 @@ fn parse_teal_key(key: &str) -> Option<(String, String)> { Some((collection.to_string(), rkey.to_string())) } -fn normalize_legacy_record_type(data: &Value) -> Value { - let Value::Object(object) = data else { - return data.clone(); - }; - - let mut normalized = object.clone(); - if let Some(Value::String(record_type)) = normalized.get_mut("$type") { - if let Some(stable_type) = record_type.strip_prefix("fm.teal.alpha.") { - *record_type = format!("fm.teal.{stable_type}"); - } - } - - Value::Object(normalized) -} - fn is_legacy_collection(collection: &str) -> bool { matches!( collection, diff --git a/services/cadet/src/ingestors/teal/actor_profile.rs b/services/cadet/src/ingestors/teal/actor_profile.rs index ff4fbee..b1a5aa3 100644 --- a/services/cadet/src/ingestors/teal/actor_profile.rs +++ b/services/cadet/src/ingestors/teal/actor_profile.rs @@ -4,6 +4,7 @@ use rocketman::{ingestion::LexiconIngestor, types::event::Event}; use serde_json::Value; use sqlx::PgPool; +use crate::ingestors::teal::normalize_legacy_record_type; use crate::resolve::resolve_identity; pub struct ActorProfileIngestor { @@ -86,10 +87,7 @@ impl LexiconIngestor for ActorProfileIngestor { async fn ingest(&self, message: Event) -> anyhow::Result<()> { if let Some(commit) = &message.commit { if let Some(ref record) = &commit.record { - let record: types::fm_teal::actor::profile::Profile = - value::from_json_value::( - record.clone(), - )?; + let record = parse_profile_record(record)?; if let Some(ref commit) = message.commit { if let Some(ref _cid) = commit.cid { // TODO: verify cid @@ -106,3 +104,52 @@ impl LexiconIngestor for ActorProfileIngestor { Ok(()) } } + +/// Normalize legacy namespace tags before deserializing the generated record type. +fn parse_profile_record(record: &Value) -> anyhow::Result { + Ok(value::from_json_value::< + types::fm_teal::actor::profile::Profile, + >(normalize_legacy_record_type(record))?) +} + +#[cfg(test)] +mod tests { + use super::parse_profile_record; + use crate::ingestors::teal::{ALPHA_ACTOR_PROFILE, STABLE_ACTOR_PROFILE}; + use rocketman::types::event::Event; + use serde_json::{json, Value}; + + fn direct_record(operation: &str, collection: &str) -> Value { + let event: Event = serde_json::from_value(json!({ + "did": "did:plc:test", + "kind": "commit", + "commit": { + "rev": "3ltest", + "operation": operation, + "collection": collection, + "rkey": "self", + "record": {"$type": collection, "displayName": "Test User"}, + "cid": "bafytest" + } + })) + .expect("valid direct event"); + + event.commit.expect("commit event").record.expect("record") + } + + #[test] + fn direct_create_and_update_records_accept_stable_and_legacy_types() { + for operation in ["create", "update"] { + for record_type in [STABLE_ACTOR_PROFILE, ALPHA_ACTOR_PROFILE] { + let record = direct_record(operation, record_type); + let parsed = parse_profile_record(&record) + .unwrap_or_else(|error| panic!("{operation} record should parse: {error}")); + + assert_eq!( + parsed.display_name.as_ref().map(|name| name.as_str()), + Some("Test User") + ); + } + } + } +} diff --git a/services/cadet/src/ingestors/teal/actor_status.rs b/services/cadet/src/ingestors/teal/actor_status.rs index 6f085e7..df8ba63 100644 --- a/services/cadet/src/ingestors/teal/actor_status.rs +++ b/services/cadet/src/ingestors/teal/actor_status.rs @@ -4,7 +4,7 @@ use rocketman::{ingestion::LexiconIngestor, types::event::Event}; use serde_json::Value; use sqlx::PgPool; -use crate::ingestors::teal::assemble_at_uri; +use crate::ingestors::teal::{assemble_at_uri, normalize_legacy_record_type}; pub struct ActorStatusIngestor { sql: PgPool, @@ -68,10 +68,7 @@ impl LexiconIngestor for ActorStatusIngestor { async fn ingest(&self, message: Event) -> anyhow::Result<()> { if let Some(commit) = &message.commit { if let Some(ref record) = &commit.record { - let record: types::fm_teal::actor::status::Status = - value::from_json_value::( - record.clone(), - )?; + let record = parse_status_record(record)?; if let Some(ref cid) = commit.cid { self.insert_status(&message.did, &commit.rkey, cid, &record) @@ -87,3 +84,56 @@ impl LexiconIngestor for ActorStatusIngestor { Ok(()) } } + +/// Normalize legacy namespace tags before deserializing the generated record type. +fn parse_status_record(record: &Value) -> anyhow::Result { + Ok(value::from_json_value::< + types::fm_teal::actor::status::Status, + >(normalize_legacy_record_type(record))?) +} + +#[cfg(test)] +mod tests { + use super::parse_status_record; + use crate::ingestors::teal::{ALPHA_ACTOR_STATUS, STABLE_ACTOR_STATUS}; + use rocketman::types::event::Event; + use serde_json::{json, Value}; + + fn direct_record(operation: &str, collection: &str) -> Value { + let event: Event = serde_json::from_value(json!({ + "did": "did:plc:test", + "kind": "commit", + "commit": { + "rev": "3ltest", + "operation": operation, + "collection": collection, + "rkey": "self", + "record": { + "$type": collection, + "time": "2024-01-01T00:00:00Z", + "item": { + "artists": [{"artistName": "Test Artist"}], + "trackName": "Test Song" + } + }, + "cid": "bafytest" + } + })) + .expect("valid direct event"); + + event.commit.expect("commit event").record.expect("record") + } + + #[test] + fn direct_create_and_update_records_accept_stable_and_legacy_types() { + for operation in ["create", "update"] { + for record_type in [STABLE_ACTOR_STATUS, ALPHA_ACTOR_STATUS] { + let record = direct_record(operation, record_type); + let parsed = parse_status_record(&record) + .unwrap_or_else(|error| panic!("{operation} record should parse: {error}")); + + assert_eq!(parsed.item.track_name.as_str(), "Test Song"); + } + } + } +} diff --git a/services/cadet/src/ingestors/teal/feed_play.rs b/services/cadet/src/ingestors/teal/feed_play.rs index 7a47b7e..6276439 100644 --- a/services/cadet/src/ingestors/teal/feed_play.rs +++ b/services/cadet/src/ingestors/teal/feed_play.rs @@ -12,7 +12,7 @@ use serde_json::Value; use sqlx::{types::Uuid, PgPool}; use unicode_normalization::UnicodeNormalization; -use super::assemble_at_uri; +use super::{assemble_at_uri, normalize_legacy_record_type}; #[derive(Debug, Clone)] struct FuzzyMatchCandidate { @@ -1591,10 +1591,7 @@ impl LexiconIngestor for PlayIngestor { async fn ingest(&self, message: Event) -> anyhow::Result<()> { if let Some(commit) = &message.commit { if let Some(ref record) = &commit.record { - let record: types::fm_teal::feed::play::Play = - value::from_json_value::( - record.clone(), - )?; + let record = parse_play_record(record)?; if let Some(ref commit) = message.commit { if let Some(ref cid) = commit.cid { // TODO: verify cid @@ -1627,3 +1624,49 @@ impl LexiconIngestor for PlayIngestor { Ok(()) } } + +/// Normalize legacy namespace tags before deserializing the generated record type. +fn parse_play_record(record: &Value) -> anyhow::Result { + Ok(value::from_json_value::( + normalize_legacy_record_type(record), + )?) +} + +#[cfg(test)] +mod tests { + use super::parse_play_record; + use crate::ingestors::teal::{ALPHA_FEED_PLAY, STABLE_FEED_PLAY}; + use rocketman::types::event::Event; + use serde_json::{json, Value}; + + fn direct_record(operation: &str, collection: &str) -> Value { + let event: Event = serde_json::from_value(json!({ + "did": "did:plc:test", + "kind": "commit", + "commit": { + "rev": "3ltest", + "operation": operation, + "collection": collection, + "rkey": "3ltest", + "record": {"$type": collection, "trackName": "Test Song"}, + "cid": "bafytest" + } + })) + .expect("valid direct event"); + + event.commit.expect("commit event").record.expect("record") + } + + #[test] + fn direct_create_and_update_records_accept_stable_and_legacy_types() { + for operation in ["create", "update"] { + for record_type in [STABLE_FEED_PLAY, ALPHA_FEED_PLAY] { + let record = direct_record(operation, record_type); + let parsed = parse_play_record(&record) + .unwrap_or_else(|error| panic!("{operation} record should parse: {error}")); + + assert_eq!(parsed.track_name.as_str(), "Test Song"); + } + } + } +} diff --git a/services/cadet/src/ingestors/teal/mod.rs b/services/cadet/src/ingestors/teal/mod.rs index daa0b7c..0213b6b 100644 --- a/services/cadet/src/ingestors/teal/mod.rs +++ b/services/cadet/src/ingestors/teal/mod.rs @@ -2,6 +2,8 @@ pub mod actor_profile; pub mod actor_status; pub mod feed_play; +use serde_json::Value; + pub const STABLE_FEED_PLAY: &str = "fm.teal.feed.play"; pub const STABLE_ACTOR_PROFILE: &str = "fm.teal.actor.profile"; pub const STABLE_ACTOR_STATUS: &str = "fm.teal.actor.status"; @@ -10,6 +12,22 @@ pub const ALPHA_FEED_PLAY: &str = "fm.teal.alpha.feed.play"; pub const ALPHA_ACTOR_PROFILE: &str = "fm.teal.alpha.actor.profile"; pub const ALPHA_ACTOR_STATUS: &str = "fm.teal.alpha.actor.status"; +/// Normalize the root record namespace used by historical Teal records. +pub fn normalize_legacy_record_type(data: &Value) -> Value { + let Value::Object(object) = data else { + return data.clone(); + }; + + let mut normalized = object.clone(); + if let Some(Value::String(record_type)) = normalized.get_mut("$type") { + if let Some(stable_type) = record_type.strip_prefix("fm.teal.alpha.") { + *record_type = format!("fm.teal.{stable_type}"); + } + } + + Value::Object(normalized) +} + const COLLECTION_ALIASES: [(&str, &str); 3] = [ (ALPHA_FEED_PLAY, STABLE_FEED_PLAY), (ALPHA_ACTOR_PROFILE, STABLE_ACTOR_PROFILE), diff --git a/tools/lexicon-cli/src/commands/validate.ts b/tools/lexicon-cli/src/commands/validate.ts index 5d25c9a..c9bc4b1 100644 --- a/tools/lexicon-cli/src/commands/validate.ts +++ b/tools/lexicon-cli/src/commands/validate.ts @@ -46,7 +46,7 @@ async function validateTypeScriptGeneration(workspaceRoot: string) { const sourceFiles = await glob('**/*.json', { cwd: lexiconsPath }); for (const sourceFile of sourceFiles) { - const namespace = sourceFile + const namespace: string = sourceFile .replace(/\.json$/, '') .split('/') .flatMap((segment) => segment.split('.')) -- 2.51.2 From 1eefc8779c39c3388ea643a69342bdbdfc28f580 Mon Sep 17 00:00:00 2001 From: mmattbtw Date: Wed, 12 Aug 2026 20:04:27 -0500 Subject: [PATCH 14/16] fix(ci): update Jacquard lexicon generator Use the compatible Jacquard generator release and map generated URI fields at Aqua and Cadet boundaries. --- apps/aqua/src/repos/feed_play.rs | 10 +++++----- apps/aqua/src/repos/mod.rs | 4 ++++ apps/aqua/src/repos/stats.rs | 4 ++-- services/cadet/src/ingestors/teal/feed_play.rs | 4 ++-- tools/lexicon-cli/src/commands/generate.ts | 6 +++--- 5 files changed, 16 insertions(+), 12 deletions(-) diff --git a/apps/aqua/src/repos/feed_play.rs b/apps/aqua/src/repos/feed_play.rs index 7c8f32d..0cdbefc 100644 --- a/apps/aqua/src/repos/feed_play.rs +++ b/apps/aqua/src/repos/feed_play.rs @@ -2,7 +2,7 @@ use async_trait::async_trait; use jacquard_common::from_json_value; use types::fm_teal::feed::{Artist, PlayView}; -use super::{mbid_uri, pg::PgDataSource, utc_to_atrium_datetime}; +use super::{mbid_uri, pg::PgDataSource, uri_value, utc_to_atrium_datetime}; #[async_trait] pub trait FeedPlayRepo: Send + Sync { @@ -58,8 +58,8 @@ impl FeedPlayRepo for PgDataSource { release_name: row.release_name.clone().map(|s| s.into()), release_mb_id: row.release_mbid.map(mbid_uri), isrc: row.isrc.map(|s| s.into()), - origin_url: row.origin_url.map(|s| s.into()), - music_service_base_domain: row.music_service_base_domain.map(|s| s.into()), + origin_uri: row.origin_url.map(uri_value), + music_service_uri: row.music_service_base_domain.map(uri_value), submission_client_agent: row.submission_client_agent.map(|s| s.into()), played_time: row .played_time @@ -117,8 +117,8 @@ impl FeedPlayRepo for PgDataSource { release_name: row.release_name.clone().map(|s| s.into()), release_mb_id: row.release_mbid.map(mbid_uri), isrc: row.isrc.map(|s| s.into()), - origin_url: row.origin_url.map(|s| s.into()), - music_service_base_domain: row.music_service_base_domain.map(|s| s.into()), + origin_uri: row.origin_url.map(uri_value), + music_service_uri: row.music_service_base_domain.map(uri_value), submission_client_agent: row.submission_client_agent.map(|s| s.into()), played_time: row .played_time diff --git a/apps/aqua/src/repos/mod.rs b/apps/aqua/src/repos/mod.rs index 25b75c4..1b5db3b 100644 --- a/apps/aqua/src/repos/mod.rs +++ b/apps/aqua/src/repos/mod.rs @@ -35,3 +35,7 @@ pub fn time_to_chrono_utc(dt: time::OffsetDateTime) -> chrono::DateTime UriValue { UriValue::Any(SmolStr::new(format!("mbid:{mbid}"))) } + +pub fn uri_value(value: String) -> UriValue { + UriValue::Any(SmolStr::new(value)) +} diff --git a/apps/aqua/src/repos/stats.rs b/apps/aqua/src/repos/stats.rs index 0293e41..babc6df 100644 --- a/apps/aqua/src/repos/stats.rs +++ b/apps/aqua/src/repos/stats.rs @@ -230,8 +230,8 @@ impl StatsRepo for PgDataSource { release_name: row.release_name.map(|s| s.into()), release_mb_id: row.release_mbid.map(mbid_uri), isrc: row.isrc.map(|s| s.into()), - origin_url: row.origin_url.map(|s| s.into()), - music_service_base_domain: row.music_service_base_domain.map(|s| s.into()), + origin_uri: row.origin_url.map(crate::repos::uri_value), + music_service_uri: row.music_service_base_domain.map(crate::repos::uri_value), submission_client_agent: row.submission_client_agent.map(|s| s.into()), played_time: row .played_time diff --git a/services/cadet/src/ingestors/teal/feed_play.rs b/services/cadet/src/ingestors/teal/feed_play.rs index 6276439..92173e7 100644 --- a/services/cadet/src/ingestors/teal/feed_play.rs +++ b/services/cadet/src/ingestors/teal/feed_play.rs @@ -1468,9 +1468,9 @@ impl PlayIngestor { .as_ref() .map(ToString::to_string); let music_service_base_domain = play_record - .music_service_base_domain + .music_service_uri .as_ref() - .map(ToString::to_string); + .map(|uri| uri.as_str().to_string()); sqlx::query!( r#" diff --git a/tools/lexicon-cli/src/commands/generate.ts b/tools/lexicon-cli/src/commands/generate.ts index 365e82c..70f7157 100644 --- a/tools/lexicon-cli/src/commands/generate.ts +++ b/tools/lexicon-cli/src/commands/generate.ts @@ -96,7 +96,7 @@ async function generateRust(workspaceRoot: string, force?: boolean) { await execa("cargo", ["binstall", "--version"], { stdio: "pipe" }); await execa( "cargo", - ["binstall", "-y", "jacquard-lexgen", "--version", "0.12.0-beta.2"], + ["binstall", "-y", "jacquard-lexgen", "--version", "0.12.1"], { stdio: "inherit", }, @@ -107,7 +107,7 @@ async function generateRust(workspaceRoot: string, force?: boolean) { "install", "jacquard-lexgen", "--version", - "0.12.0-beta.2", + "0.12.1", ], { stdio: "inherit", }); @@ -115,7 +115,7 @@ async function generateRust(workspaceRoot: string, force?: boolean) { console.log(pc.green(" ✓ jacquard-codegen installed successfully")); } catch (installError) { throw new Error( - "Failed to install jacquard-codegen. Please install manually: cargo install jacquard-lexgen --version 0.12.0-beta.2", + "Failed to install jacquard-codegen. Please install manually: cargo install jacquard-lexgen --version 0.12.1", ); } } -- 2.51.2 From 4c1e864a4239ec3ac3b99b37bf68f3950ce41c10 Mon Sep 17 00:00:00 2001 From: Matt Morris Date: Thu, 13 Aug 2026 12:04:24 -0500 Subject: [PATCH 15/16] update type --- services/types/src/app_bsky.rs | 13 + services/types/src/app_bsky/actor.rs | 1510 +- .../src/app_bsky/actor/get_suggestions.rs | 5 +- services/types/src/app_bsky/actor/profile.rs | 81 +- services/types/src/app_bsky/actor/status.rs | 26 +- services/types/src/app_bsky/embed.rs | 28 +- services/types/src/app_bsky/embed/external.rs | 1238 +- services/types/src/app_bsky/embed/images.rs | 35 +- services/types/src/app_bsky/embed/record.rs | 120 +- .../src/app_bsky/embed/record_with_media.rs | 60 +- services/types/src/app_bsky/embed/video.rs | 268 +- services/types/src/app_bsky/feed.rs | 418 +- services/types/src/app_bsky/feed/generator.rs | 30 +- services/types/src/app_bsky/feed/get_likes.rs | 30 +- services/types/src/app_bsky/feed/like.rs | 26 +- services/types/src/app_bsky/feed/post.rs | 60 +- services/types/src/app_bsky/feed/repost.rs | 26 +- .../src/app_bsky/feed/send_interactions.rs | 28 +- .../types/src/app_bsky/feed/threadgate.rs | 6 +- services/types/src/app_bsky/graph.rs | 534 +- services/types/src/app_bsky/graph/follow.rs | 29 +- .../types/src/app_bsky/graph/get_lists.rs | 20 +- .../graph/get_suggested_follows_by_actor.rs | 9 +- services/types/src/app_bsky/graph/list.rs | 30 +- .../types/src/app_bsky/graph/listblock.rs | 26 +- services/types/src/app_bsky/graph/listitem.rs | 30 +- .../types/src/app_bsky/graph/starterpack.rs | 48 +- .../types/src/app_bsky/graph/verification.rs | 78 +- services/types/src/app_bsky/labeler.rs | 148 +- .../types/src/app_bsky/labeler/service.rs | 26 +- services/types/src/app_bsky/notification.rs | 379 +- .../notification/list_notifications.rs | 144 +- .../notification/put_preferences_v2.rs | 1 + .../app_bsky/notification/register_push.rs | 60 +- .../app_bsky/notification/unregister_push.rs | 34 +- services/types/src/app_bsky/richtext/facet.rs | 26 +- services/types/src/app_bsky/unspecced.rs | 343 +- .../unspecced/get_post_thread_other_v2.rs | 65 +- .../app_bsky/unspecced/get_post_thread_v2.rs | 93 +- .../app_bsky/unspecced/get_suggested_users.rs | 6 + .../unspecced/get_suggested_users_skeleton.rs | 6 + .../unspecced/get_suggestions_skeleton.rs | 5 +- .../unspecced/get_tagged_suggestions.rs | 30 +- services/types/src/app_bsky/video.rs | 30 +- services/types/src/chat_bsky.rs | 6 +- services/types/src/chat_bsky/actor.rs | 652 +- .../types/src/chat_bsky/actor/declaration.rs | 136 +- services/types/src/chat_bsky/convo.rs | 12015 +++++++++++++--- .../types/src/chat_bsky/convo/accept_convo.rs | 46 +- .../types/src/chat_bsky/convo/add_reaction.rs | 19 + .../convo/delete_message_for_self.rs | 56 +- .../types/src/chat_bsky/convo/get_convo.rs | 46 +- .../chat_bsky/convo/get_convo_for_members.rs | 93 +- services/types/src/chat_bsky/convo/get_log.rs | 60 + .../types/src/chat_bsky/convo/get_messages.rs | 51 +- .../types/src/chat_bsky/convo/leave_convo.rs | 56 +- .../types/src/chat_bsky/convo/list_convos.rs | 54 +- .../types/src/chat_bsky/convo/mute_convo.rs | 46 +- .../src/chat_bsky/convo/remove_reaction.rs | 19 + .../types/src/chat_bsky/convo/send_message.rs | 64 +- .../src/chat_bsky/convo/send_message_batch.rs | 64 +- .../types/src/chat_bsky/convo/unmute_convo.rs | 46 +- .../types/src/chat_bsky/convo/update_read.rs | 46 +- services/types/src/chat_bsky/moderation.rs | 628 +- .../moderation/get_actor_metadata.rs | 62 +- .../moderation/get_message_context.rs | 39 +- .../moderation/update_actor_access.rs | 26 +- services/types/src/com_atproto/admin.rs | 56 +- .../admin/update_account_handle.rs | 26 +- .../admin/update_account_password.rs | 26 +- services/types/src/com_atproto/identity.rs | 48 +- services/types/src/com_atproto/label.rs | 118 +- services/types/src/com_atproto/lexicon.rs | 1 + services/types/src/com_atproto/moderation.rs | 414 +- .../com_atproto/moderation/create_report.rs | 26 +- .../src/com_atproto/repo/apply_writes.rs | 78 +- .../src/com_atproto/repo/create_record.rs | 48 +- .../src/com_atproto/repo/delete_record.rs | 30 +- .../types/src/com_atproto/repo/get_record.rs | 30 +- .../src/com_atproto/repo/list_records.rs | 30 +- .../types/src/com_atproto/repo/strong_ref.rs | 26 +- services/types/src/com_atproto/server.rs | 186 +- .../com_atproto/server/create_app_password.rs | 30 +- .../com_atproto/server/create_invite_codes.rs | 26 +- .../src/com_atproto/server/delete_session.rs | 57 +- .../com_atproto/server/get_service_auth.rs | 8 +- .../src/com_atproto/server/refresh_session.rs | 24 + .../types/src/com_atproto/sync/get_blocks.rs | 26 +- .../types/src/com_atproto/sync/get_record.rs | 30 +- .../src/com_atproto/sync/subscribe_repos.rs | 396 +- services/types/src/com_atproto/temp.rs | 5 +- services/types/src/fm_teal/actor/status.rs | 26 +- services/types/src/fm_teal/feed.rs | 26 +- .../src/fm_teal/feed/social/playlist_item.rs | 30 +- .../types/src/fm_teal/feed/social/post.rs | 52 +- .../types/src/fm_teal/feed/social/repost.rs | 26 +- services/types/src/fm_teal/music.rs | 180 +- services/types/src/fm_teal/richtext/facet.rs | 26 +- services/types/src/fm_teal/search.rs | 78 +- services/types/src/lib.rs | 4 + services/types/src/tools_ozone.rs | 2 + .../types/src/tools_ozone/communication.rs | 160 +- services/types/src/tools_ozone/moderation.rs | 3301 ++++- .../src/tools_ozone/moderation/emit_event.rs | 317 +- .../tools_ozone/moderation/query_events.rs | 144 +- .../tools_ozone/moderation/query_statuses.rs | 115 +- services/types/src/tools_ozone/safelink.rs | 304 +- .../src/tools_ozone/safelink/add_rule.rs | 56 +- .../src/tools_ozone/safelink/update_rule.rs | 56 +- services/types/src/tools_ozone/set.rs | 52 +- services/types/src/tools_ozone/setting.rs | 102 +- .../src/tools_ozone/setting/remove_options.rs | 26 +- services/types/src/tools_ozone/team.rs | 42 +- .../types/src/tools_ozone/team/add_member.rs | 26 +- .../types/src/tools_ozone/verification.rs | 96 +- .../verification/grant_verifications.rs | 56 +- .../verification/revoke_verifications.rs | 26 +- 117 files changed, 21301 insertions(+), 6311 deletions(-) diff --git a/services/types/src/app_bsky.rs b/services/types/src/app_bsky.rs index 50d8e1d..4d2bf24 100644 --- a/services/types/src/app_bsky.rs +++ b/services/types/src/app_bsky.rs @@ -4,6 +4,19 @@ // Any manual changes will be overwritten on the next regeneration. pub mod actor; +pub mod ageassurance; +pub mod auth_create_posts; +pub mod auth_delete_content; +pub mod auth_full_app; +pub mod auth_manage_feed_declarations; +pub mod auth_manage_labeler_service; +pub mod auth_manage_moderation; +pub mod auth_manage_notifications; +pub mod auth_manage_profile; +pub mod auth_view_all; +pub mod bookmark; +pub mod contact; +pub mod draft; pub mod embed; pub mod feed; pub mod graph; diff --git a/services/types/src/app_bsky/actor.rs b/services/types/src/app_bsky/actor.rs index 1b05a5b..a70be4d 100644 --- a/services/types/src/app_bsky/actor.rs +++ b/services/types/src/app_bsky/actor.rs @@ -26,7 +26,7 @@ use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; #[allow(unused_imports)] use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation; use jacquard_common::deps::smol_str::SmolStr; -use jacquard_common::types::string::{Did, Handle, AtUri, Datetime, UriValue}; +use jacquard_common::types::string::{Did, Handle, AtUri, Cid, Datetime, UriValue}; use jacquard_common::types::value::Data; use jacquard_derive::{IntoStatic, open_union}; use jacquard_lexicon::lexicon::LexiconDoc; @@ -75,6 +75,9 @@ pub struct BskyAppProgressGuide { pub struct BskyAppStatePref { #[serde(skip_serializing_if = "Option::is_none")] pub active_progress_guide: Option>, + ///Indicates if the user is participating in the beta features program. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_beta_user: Option, ///Storage for NUXs the user has encountered. #[serde(skip_serializing_if = "Option::is_none")] pub nuxs: Option>>, @@ -187,6 +190,24 @@ where } } +/// Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct DeclaredAgePref { + ///Indicates if the user has declared that they are over 13 years of age. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_over_age13: Option, + ///Indicates if the user has declared that they are over 16 years of age. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_over_age16: Option, + ///Indicates if the user has declared that they are over 18 years of age. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_over_age18: Option, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -262,6 +283,22 @@ pub struct LabelersPref { pub extra_data: Option>>, } +/// Preferences for live events. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LiveEventPreferences { + ///A list of feed IDs that the user has hidden from live events. + #[serde(skip_serializing_if = "Option::is_none")] + pub hidden_feed_ids: Option>, + ///Whether to hide all feeds from live events. Defaults to `false`. + #[serde(skip_serializing_if = "Option::is_none")] + #[serde(default = "_default_live_event_preferences_hide_all_feeds")] + pub hide_all_feeds: Option, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + /// A word that the account owner has muted. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] @@ -525,6 +562,8 @@ pub enum PreferencesItem { SavedFeedsPrefV2(Box>), #[serde(rename = "app.bsky.actor.defs#personalDetailsPref")] PersonalDetailsPref(Box>), + #[serde(rename = "app.bsky.actor.defs#declaredAgePref")] + DeclaredAgePref(Box>), #[serde(rename = "app.bsky.actor.defs#feedViewPref")] FeedViewPref(Box>), #[serde(rename = "app.bsky.actor.defs#threadViewPref")] @@ -543,6 +582,8 @@ pub enum PreferencesItem { PostInteractionSettingsPref(Box>), #[serde(rename = "app.bsky.actor.defs#verificationPrefs")] VerificationPrefs(Box>), + #[serde(rename = "app.bsky.actor.defs#liveEventPreferences")] + LiveEventPreferences(Box>), } pub type Preferences = Vec>; @@ -557,6 +598,8 @@ pub struct ProfileAssociated { #[serde(skip_serializing_if = "Option::is_none")] pub feedgens: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub germ: Option>, + #[serde(skip_serializing_if = "Option::is_none")] pub labeler: Option, #[serde(skip_serializing_if = "Option::is_none")] pub lists: Option, @@ -679,12 +722,105 @@ where #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ProfileAssociatedChat { + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_group_invites: Option>, pub allow_incoming: ProfileAssociatedChatAllowIncoming, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ProfileAssociatedChatAllowGroupInvites { + All, + None, + Following, + Other(S), +} + +impl ProfileAssociatedChatAllowGroupInvites { + pub fn as_str(&self) -> &str { + match self { + Self::All => "all", + Self::None => "none", + Self::Following => "following", + Self::Other(s) => s.as_ref(), + } + } + /// Construct from a string-like value, matching known values. + pub fn from_value(s: S) -> Self { + match s.as_ref() { + "all" => Self::All, + "none" => Self::None, + "following" => Self::Following, + _ => Self::Other(s), + } + } +} + +impl core::fmt::Display for ProfileAssociatedChatAllowGroupInvites { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl AsRef for ProfileAssociatedChatAllowGroupInvites { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl Serialize for ProfileAssociatedChatAllowGroupInvites { + fn serialize(&self, serializer: Ser) -> Result + where + Ser: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> +for ProfileAssociatedChatAllowGroupInvites { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = S::deserialize(deserializer)?; + Ok(Self::from_value(s)) + } +} + +impl Default for ProfileAssociatedChatAllowGroupInvites { + fn default() -> Self { + Self::Other(Default::default()) + } +} + +impl jacquard_common::IntoStatic for ProfileAssociatedChatAllowGroupInvites +where + S: BosStr + jacquard_common::IntoStatic, + S::Output: BosStr, +{ + type Output = ProfileAssociatedChatAllowGroupInvites; + fn into_static(self) -> Self::Output { + match self { + ProfileAssociatedChatAllowGroupInvites::All => { + ProfileAssociatedChatAllowGroupInvites::All + } + ProfileAssociatedChatAllowGroupInvites::None => { + ProfileAssociatedChatAllowGroupInvites::None + } + ProfileAssociatedChatAllowGroupInvites::Following => { + ProfileAssociatedChatAllowGroupInvites::Following + } + ProfileAssociatedChatAllowGroupInvites::Other(v) => { + ProfileAssociatedChatAllowGroupInvites::Other(v.into_static()) + } + } + } +} + + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum ProfileAssociatedChatAllowIncoming { All, @@ -776,6 +912,101 @@ where } +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ProfileAssociatedGerm { + pub message_me_url: UriValue, + pub show_button_to: ProfileAssociatedGermShowButtonTo, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ProfileAssociatedGermShowButtonTo { + UsersIFollow, + Everyone, + Other(S), +} + +impl ProfileAssociatedGermShowButtonTo { + pub fn as_str(&self) -> &str { + match self { + Self::UsersIFollow => "usersIFollow", + Self::Everyone => "everyone", + Self::Other(s) => s.as_ref(), + } + } + /// Construct from a string-like value, matching known values. + pub fn from_value(s: S) -> Self { + match s.as_ref() { + "usersIFollow" => Self::UsersIFollow, + "everyone" => Self::Everyone, + _ => Self::Other(s), + } + } +} + +impl core::fmt::Display for ProfileAssociatedGermShowButtonTo { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl AsRef for ProfileAssociatedGermShowButtonTo { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl Serialize for ProfileAssociatedGermShowButtonTo { + fn serialize(&self, serializer: Ser) -> Result + where + Ser: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> +for ProfileAssociatedGermShowButtonTo { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = S::deserialize(deserializer)?; + Ok(Self::from_value(s)) + } +} + +impl Default for ProfileAssociatedGermShowButtonTo { + fn default() -> Self { + Self::Other(Default::default()) + } +} + +impl jacquard_common::IntoStatic for ProfileAssociatedGermShowButtonTo +where + S: BosStr + jacquard_common::IntoStatic, + S::Output: BosStr, +{ + type Output = ProfileAssociatedGermShowButtonTo; + fn into_static(self) -> Self::Output { + match self { + ProfileAssociatedGermShowButtonTo::UsersIFollow => { + ProfileAssociatedGermShowButtonTo::UsersIFollow + } + ProfileAssociatedGermShowButtonTo::Everyone => { + ProfileAssociatedGermShowButtonTo::Everyone + } + ProfileAssociatedGermShowButtonTo::Other(v) => { + ProfileAssociatedGermShowButtonTo::Other(v.into_static()) + } + } + } +} + + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ProfileView { @@ -785,6 +1016,9 @@ pub struct ProfileView { pub avatar: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub created_at: Option, + ///Debug information for internal development + #[serde(skip_serializing_if = "Option::is_none")] + pub debug: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, pub did: Did, @@ -796,6 +1030,8 @@ pub struct ProfileView { #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option>>, #[serde(skip_serializing_if = "Option::is_none")] + pub pronouns: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub status: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub verification: Option>, @@ -815,6 +1051,9 @@ pub struct ProfileViewBasic { pub avatar: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub created_at: Option, + ///Debug information for internal development + #[serde(skip_serializing_if = "Option::is_none")] + pub debug: Option>, pub did: Did, #[serde(skip_serializing_if = "Option::is_none")] pub display_name: Option, @@ -822,6 +1061,8 @@ pub struct ProfileViewBasic { #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option>>, #[serde(skip_serializing_if = "Option::is_none")] + pub pronouns: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub status: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub verification: Option>, @@ -843,6 +1084,9 @@ pub struct ProfileViewDetailed { pub banner: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub created_at: Option, + ///Debug information for internal development + #[serde(skip_serializing_if = "Option::is_none")] + pub debug: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub description: Option, pub did: Did, @@ -864,11 +1108,15 @@ pub struct ProfileViewDetailed { #[serde(skip_serializing_if = "Option::is_none")] pub posts_count: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub pronouns: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub status: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub verification: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub viewer: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub website: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } @@ -992,6 +1240,8 @@ pub struct SavedFeedsPrefV2 { #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct StatusView { + #[serde(skip_serializing_if = "Option::is_none")] + pub cid: Option>, ///An optional embed associated with the status. #[serde(skip_serializing_if = "Option::is_none")] pub embed: Option>, @@ -1001,9 +1251,16 @@ pub struct StatusView { ///True if the status is not expired, false if it is expired. Only present if expiration was set. #[serde(skip_serializing_if = "Option::is_none")] pub is_active: Option, + ///True if the user's go-live access has been disabled by a moderator, false otherwise. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_disabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub labels: Option>>, pub record: Data, ///The status for the account. pub status: StatusViewStatus, + #[serde(skip_serializing_if = "Option::is_none")] + pub uri: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } @@ -1087,9 +1344,6 @@ where #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ThreadViewPref { - ///Show followed users at the top of all replies. - #[serde(skip_serializing_if = "Option::is_none")] - pub prioritize_followed_users: Option, ///Sorting mode for threads. #[serde(skip_serializing_if = "Option::is_none")] pub sort: Option>, @@ -1411,6 +1665,12 @@ pub struct VerificationView { pub is_valid: bool, ///The user who issued this verification. pub issuer: Did, + ///The display name of the issuer. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer_display_name: Option, + ///The handle of the issuer. + #[serde(skip_serializing_if = "Option::is_none")] + pub issuer_handle: Option>, ///The AT-URI of the verification record. pub uri: AtUri, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] @@ -1537,6 +1797,21 @@ impl LexiconSchema for ContentLabelPref { } } +impl LexiconSchema for DeclaredAgePref { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "declaredAgePref" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + impl LexiconSchema for FeedViewPref { fn nsid() -> &'static str { "app.bsky.actor.defs" @@ -1660,6 +1935,21 @@ impl LexiconSchema for LabelersPref { } } +impl LexiconSchema for LiveEventPreferences { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "liveEventPreferences" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + impl LexiconSchema for MutedWord { fn nsid() -> &'static str { "app.bsky.actor.defs" @@ -1857,6 +2147,21 @@ impl LexiconSchema for ProfileAssociatedChat { } } +impl LexiconSchema for ProfileAssociatedGerm { + fn nsid() -> &'static str { + "app.bsky.actor.defs" + } + fn def_name() -> &'static str { + "profileAssociatedGerm" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_app_bsky_actor_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + impl LexiconSchema for ProfileView { fn nsid() -> &'static str { "app.bsky.actor.defs" @@ -2330,6 +2635,12 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("isBetaUser"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); map.insert( SmolStr::new_static("nuxs"), LexObjectProperty::Array(LexArray { @@ -2404,6 +2715,40 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("declaredAgePref"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Read-only preference containing value(s) inferred from the user's declared birthdate. Absence of this preference object in the response indicates that the user has not made a declaration.", + ), + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("isOverAge13"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("isOverAge16"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("isOverAge18"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); map.insert( SmolStr::new_static("feedViewPref"), LexUserType::Object(LexObject { @@ -2595,7 +2940,41 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("mutedWord"), + SmolStr::new_static("liveEventPreferences"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static("Preferences for live events."), + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("hiddenFeedIds"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "A list of feed IDs that the user has hidden from live events.", + ), + ), + items: LexArrayItem::String(LexString { + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("hideAllFeeds"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("mutedWord"), LexUserType::Object(LexObject { description: Some( CowStr::new_static("A word that the account owner has muted."), @@ -2845,6 +3224,7 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { CowStr::new_static("#savedFeedsPref"), CowStr::new_static("#savedFeedsPrefV2"), CowStr::new_static("#personalDetailsPref"), + CowStr::new_static("#declaredAgePref"), CowStr::new_static("#feedViewPref"), CowStr::new_static("#threadViewPref"), CowStr::new_static("#interestsPref"), @@ -2853,7 +3233,8 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { CowStr::new_static("#bskyAppStatePref"), CowStr::new_static("#labelersPref"), CowStr::new_static("#postInteractionSettingsPref"), - CowStr::new_static("#verificationPrefs") + CowStr::new_static("#verificationPrefs"), + CowStr::new_static("#liveEventPreferences") ], ..Default::default() }), @@ -2888,6 +3269,13 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("germ"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#profileAssociatedGerm"), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("labeler"), LexObjectProperty::Boolean(LexBoolean { @@ -2934,6 +3322,10 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("allowGroupInvites"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); map.insert( SmolStr::new_static("allowIncoming"), LexObjectProperty::String(LexString { ..Default::default() }), @@ -2943,6 +3335,34 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("profileAssociatedGerm"), + LexUserType::Object(LexObject { + required: Some( + vec![ + SmolStr::new_static("showButtonTo"), + SmolStr::new_static("messageMeUrl") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("messageMeUrl"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Uri), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("showButtonTo"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); map.insert( SmolStr::new_static("profileView"), LexUserType::Object(LexObject { @@ -2973,6 +3393,12 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("debug"), + LexObjectProperty::Unknown(LexUnknown { + ..Default::default() + }), + ); map.insert( SmolStr::new_static("description"), LexObjectProperty::String(LexString { @@ -3020,6 +3446,10 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("pronouns"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); map.insert( SmolStr::new_static("status"), LexObjectProperty::Ref(LexRef { @@ -3076,6 +3506,12 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("debug"), + LexObjectProperty::Unknown(LexUnknown { + ..Default::default() + }), + ); map.insert( SmolStr::new_static("did"), LexObjectProperty::String(LexString { @@ -3108,6 +3544,10 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("pronouns"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); map.insert( SmolStr::new_static("status"), LexObjectProperty::Ref(LexRef { @@ -3171,6 +3611,12 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("debug"), + LexObjectProperty::Unknown(LexUnknown { + ..Default::default() + }), + ); map.insert( SmolStr::new_static("description"), LexObjectProperty::String(LexString { @@ -3252,6 +3698,10 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("pronouns"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); map.insert( SmolStr::new_static("status"), LexObjectProperty::Ref(LexRef { @@ -3273,6 +3723,13 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("website"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Uri), + ..Default::default() + }), + ); map }, ..Default::default() @@ -3386,6 +3843,13 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("cid"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Cid), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("embed"), LexObjectProperty::Union(LexRefUnion { @@ -3418,6 +3882,22 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("isDisabled"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("labels"), + LexObjectProperty::Array(LexArray { + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static("com.atproto.label.defs#label"), + ..Default::default() + }), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("record"), LexObjectProperty::Unknown(LexUnknown { @@ -3433,6 +3913,13 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("uri"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::AtUri), + ..Default::default() + }), + ); map }, ..Default::default() @@ -3444,12 +3931,6 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); - map.insert( - SmolStr::new_static("prioritizeFollowedUsers"), - LexObjectProperty::Boolean(LexBoolean { - ..Default::default() - }), - ); map.insert( SmolStr::new_static("sort"), LexObjectProperty::String(LexString { @@ -3593,6 +4074,25 @@ fn lexicon_doc_app_bsky_actor_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("issuerDisplayName"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("The display name of the issuer."), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("issuerHandle"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("The handle of the issuer."), + ), + format: Some(LexStringFormat::Handle), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("uri"), LexObjectProperty::String(LexString { @@ -4235,6 +4735,20 @@ where } } +fn _default_live_event_preferences_hide_all_feeds() -> Option { + Some(false) +} + +impl Default for LiveEventPreferences { + fn default() -> Self { + Self { + hidden_feed_ids: None, + hide_all_feeds: Some(false), + extra_data: Default::default(), + } + } +} + pub mod muted_word_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; @@ -4245,37 +4759,37 @@ pub mod muted_word_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Targets; type Value; + type Targets; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Targets = Unset; type Value = Unset; - } - ///State transition - sets the `targets` field to Set - pub struct SetTargets(PhantomData St>); - impl sealed::Sealed for SetTargets {} - impl State for SetTargets { - type Targets = Set; - type Value = St::Value; + type Targets = Unset; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData St>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Targets = St::Targets; type Value = Set; + type Targets = St::Targets; + } + ///State transition - sets the `targets` field to Set + pub struct SetTargets(PhantomData St>); + impl sealed::Sealed for SetTargets {} + impl State for SetTargets { + type Value = St::Value; + type Targets = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `targets` field - pub struct targets(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `targets` field + pub struct targets(()); } } @@ -4393,8 +4907,8 @@ where impl MutedWordBuilder where St: muted_word_state::State, - St::Targets: muted_word_state::IsSet, St::Value: muted_word_state::IsSet, + St::Targets: muted_word_state::IsSet, { /// Build the final struct. pub fn build(self) -> MutedWord { @@ -4537,37 +5051,37 @@ pub mod nux_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Completed; type Id; + type Completed; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Completed = Unset; type Id = Unset; - } - ///State transition - sets the `completed` field to Set - pub struct SetCompleted(PhantomData St>); - impl sealed::Sealed for SetCompleted {} - impl State for SetCompleted { - type Completed = Set; - type Id = St::Id; + type Completed = Unset; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData St>); impl sealed::Sealed for SetId {} impl State for SetId { - type Completed = St::Completed; type Id = Set; + type Completed = St::Completed; + } + ///State transition - sets the `completed` field to Set + pub struct SetCompleted(PhantomData St>); + impl sealed::Sealed for SetCompleted {} + impl State for SetCompleted { + type Id = St::Id; + type Completed = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `completed` field - pub struct completed(()); ///Marker type for the `id` field pub struct id(()); + ///Marker type for the `completed` field + pub struct completed(()); } } @@ -4660,8 +5174,8 @@ where impl NuxBuilder where St: nux_state::State, - St::Completed: nux_state::IsSet, St::Id: nux_state::IsSet, + St::Completed: nux_state::IsSet, { /// Build the final struct. pub fn build(self) -> Nux { @@ -4685,7 +5199,7 @@ where } } -pub mod profile_view_state { +pub mod profile_associated_germ_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -4695,81 +5209,231 @@ pub mod profile_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; - type Handle; + type ShowButtonTo; + type MessageMeUrl; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; - type Handle = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Handle = St::Handle; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData St>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type Did = St::Did; - type Handle = Set; + type ShowButtonTo = Unset; + type MessageMeUrl = Unset; + } + ///State transition - sets the `show_button_to` field to Set + pub struct SetShowButtonTo(PhantomData St>); + impl sealed::Sealed for SetShowButtonTo {} + impl State for SetShowButtonTo { + type ShowButtonTo = Set; + type MessageMeUrl = St::MessageMeUrl; + } + ///State transition - sets the `message_me_url` field to Set + pub struct SetMessageMeUrl(PhantomData St>); + impl sealed::Sealed for SetMessageMeUrl {} + impl State for SetMessageMeUrl { + type ShowButtonTo = St::ShowButtonTo; + type MessageMeUrl = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); - ///Marker type for the `handle` field - pub struct handle(()); + ///Marker type for the `show_button_to` field + pub struct show_button_to(()); + ///Marker type for the `message_me_url` field + pub struct message_me_url(()); } } /// Builder for constructing an instance of this type. -pub struct ProfileViewBuilder { +pub struct ProfileAssociatedGermBuilder< + S: BosStr, + St: profile_associated_germ_state::State, +> { _state: PhantomData St>, - _fields: ( - Option>, - Option>, - Option, - Option, - Option>, - Option, - Option>, - Option, - Option>>, - Option>, - Option>, - Option>, - ), + _fields: (Option>, Option>), _type: PhantomData S>, } -impl ProfileView { +impl ProfileAssociatedGerm { /// Create a new builder for this type. - pub fn new() -> ProfileViewBuilder { - ProfileViewBuilder::new() + pub fn new() -> ProfileAssociatedGermBuilder< + S, + profile_associated_germ_state::Empty, + > { + ProfileAssociatedGermBuilder::new() } } -impl ProfileViewBuilder { +impl ProfileAssociatedGermBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - ProfileViewBuilder { + ProfileAssociatedGermBuilder { _state: PhantomData, - _fields: ( - None, - None, - None, - None, - None, - None, - None, - None, + _fields: (None, None), + _type: PhantomData, + } + } +} + +impl ProfileAssociatedGermBuilder +where + St: profile_associated_germ_state::State, + St::MessageMeUrl: profile_associated_germ_state::IsUnset, +{ + /// Set the `messageMeUrl` field (required) + pub fn message_me_url( + mut self, + value: impl Into>, + ) -> ProfileAssociatedGermBuilder< + S, + profile_associated_germ_state::SetMessageMeUrl, + > { + self._fields.0 = Option::Some(value.into()); + ProfileAssociatedGermBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ProfileAssociatedGermBuilder +where + St: profile_associated_germ_state::State, + St::ShowButtonTo: profile_associated_germ_state::IsUnset, +{ + /// Set the `showButtonTo` field (required) + pub fn show_button_to( + mut self, + value: impl Into>, + ) -> ProfileAssociatedGermBuilder< + S, + profile_associated_germ_state::SetShowButtonTo, + > { + self._fields.1 = Option::Some(value.into()); + ProfileAssociatedGermBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ProfileAssociatedGermBuilder +where + St: profile_associated_germ_state::State, + St::ShowButtonTo: profile_associated_germ_state::IsSet, + St::MessageMeUrl: profile_associated_germ_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> ProfileAssociatedGerm { + ProfileAssociatedGerm { + message_me_url: self._fields.0.unwrap(), + show_button_to: self._fields.1.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> ProfileAssociatedGerm { + ProfileAssociatedGerm { + message_me_url: self._fields.0.unwrap(), + show_button_to: self._fields.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod profile_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Handle; + type Did; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Handle = Unset; + type Did = Unset; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData St>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Handle = Set; + type Did = St::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = St::Handle; + type Did = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `handle` field + pub struct handle(()); + ///Marker type for the `did` field + pub struct did(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct ProfileViewBuilder { + _state: PhantomData St>, + _fields: ( + Option>, + Option>, + Option, + Option>, + Option, + Option>, + Option, + Option>, + Option, + Option>>, + Option, + Option>, + Option>, + Option>, + ), + _type: PhantomData S>, +} + +impl ProfileView { + /// Create a new builder for this type. + pub fn new() -> ProfileViewBuilder { + ProfileViewBuilder::new() + } +} + +impl ProfileViewBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + ProfileViewBuilder { + _state: PhantomData, + _fields: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, None, None, None, @@ -4825,15 +5489,28 @@ impl ProfileViewBuilder { } } +impl ProfileViewBuilder { + /// Set the `debug` field (optional) + pub fn debug(mut self, value: impl Into>>) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `debug` field to an Option value (optional) + pub fn maybe_debug(mut self, value: Option>) -> Self { + self._fields.3 = value; + self + } +} + impl ProfileViewBuilder { /// Set the `description` field (optional) pub fn description(mut self, value: impl Into>) -> Self { - self._fields.3 = value.into(); + self._fields.4 = value.into(); self } /// Set the `description` field to an Option value (optional) pub fn maybe_description(mut self, value: Option) -> Self { - self._fields.3 = value; + self._fields.4 = value; self } } @@ -4848,7 +5525,7 @@ where mut self, value: impl Into>, ) -> ProfileViewBuilder> { - self._fields.4 = Option::Some(value.into()); + self._fields.5 = Option::Some(value.into()); ProfileViewBuilder { _state: PhantomData, _fields: self._fields, @@ -4860,12 +5537,12 @@ where impl ProfileViewBuilder { /// Set the `displayName` field (optional) pub fn display_name(mut self, value: impl Into>) -> Self { - self._fields.5 = value.into(); + self._fields.6 = value.into(); self } /// Set the `displayName` field to an Option value (optional) pub fn maybe_display_name(mut self, value: Option) -> Self { - self._fields.5 = value; + self._fields.6 = value; self } } @@ -4880,7 +5557,7 @@ where mut self, value: impl Into>, ) -> ProfileViewBuilder> { - self._fields.6 = Option::Some(value.into()); + self._fields.7 = Option::Some(value.into()); ProfileViewBuilder { _state: PhantomData, _fields: self._fields, @@ -4892,12 +5569,12 @@ where impl ProfileViewBuilder { /// Set the `indexedAt` field (optional) pub fn indexed_at(mut self, value: impl Into>) -> Self { - self._fields.7 = value.into(); + self._fields.8 = value.into(); self } /// Set the `indexedAt` field to an Option value (optional) pub fn maybe_indexed_at(mut self, value: Option) -> Self { - self._fields.7 = value; + self._fields.8 = value; self } } @@ -4905,12 +5582,25 @@ impl ProfileViewBuilder { impl ProfileViewBuilder { /// Set the `labels` field (optional) pub fn labels(mut self, value: impl Into>>>) -> Self { - self._fields.8 = value.into(); + self._fields.9 = value.into(); self } /// Set the `labels` field to an Option value (optional) pub fn maybe_labels(mut self, value: Option>>) -> Self { - self._fields.8 = value; + self._fields.9 = value; + self + } +} + +impl ProfileViewBuilder { + /// Set the `pronouns` field (optional) + pub fn pronouns(mut self, value: impl Into>) -> Self { + self._fields.10 = value.into(); + self + } + /// Set the `pronouns` field to an Option value (optional) + pub fn maybe_pronouns(mut self, value: Option) -> Self { + self._fields.10 = value; self } } @@ -4918,12 +5608,12 @@ impl ProfileViewBuilder { impl ProfileViewBuilder { /// Set the `status` field (optional) pub fn status(mut self, value: impl Into>>) -> Self { - self._fields.9 = value.into(); + self._fields.11 = value.into(); self } /// Set the `status` field to an Option value (optional) pub fn maybe_status(mut self, value: Option>) -> Self { - self._fields.9 = value; + self._fields.11 = value; self } } @@ -4934,7 +5624,7 @@ impl ProfileViewBuilder { mut self, value: impl Into>>, ) -> Self { - self._fields.10 = value.into(); + self._fields.12 = value.into(); self } /// Set the `verification` field to an Option value (optional) @@ -4942,7 +5632,7 @@ impl ProfileViewBuilder { mut self, value: Option>, ) -> Self { - self._fields.10 = value; + self._fields.12 = value; self } } @@ -4950,12 +5640,12 @@ impl ProfileViewBuilder { impl ProfileViewBuilder { /// Set the `viewer` field (optional) pub fn viewer(mut self, value: impl Into>>) -> Self { - self._fields.11 = value.into(); + self._fields.13 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer(mut self, value: Option>) -> Self { - self._fields.11 = value; + self._fields.13 = value; self } } @@ -4963,8 +5653,8 @@ impl ProfileViewBuilder { impl ProfileViewBuilder where St: profile_view_state::State, - St::Did: profile_view_state::IsSet, St::Handle: profile_view_state::IsSet, + St::Did: profile_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> ProfileView { @@ -4972,15 +5662,17 @@ where associated: self._fields.0, avatar: self._fields.1, created_at: self._fields.2, - description: self._fields.3, - did: self._fields.4.unwrap(), - display_name: self._fields.5, - handle: self._fields.6.unwrap(), - indexed_at: self._fields.7, - labels: self._fields.8, - status: self._fields.9, - verification: self._fields.10, - viewer: self._fields.11, + debug: self._fields.3, + description: self._fields.4, + did: self._fields.5.unwrap(), + display_name: self._fields.6, + handle: self._fields.7.unwrap(), + indexed_at: self._fields.8, + labels: self._fields.9, + pronouns: self._fields.10, + status: self._fields.11, + verification: self._fields.12, + viewer: self._fields.13, extra_data: Default::default(), } } @@ -4993,15 +5685,17 @@ where associated: self._fields.0, avatar: self._fields.1, created_at: self._fields.2, - description: self._fields.3, - did: self._fields.4.unwrap(), - display_name: self._fields.5, - handle: self._fields.6.unwrap(), - indexed_at: self._fields.7, - labels: self._fields.8, - status: self._fields.9, - verification: self._fields.10, - viewer: self._fields.11, + debug: self._fields.3, + description: self._fields.4, + did: self._fields.5.unwrap(), + display_name: self._fields.6, + handle: self._fields.7.unwrap(), + indexed_at: self._fields.8, + labels: self._fields.9, + pronouns: self._fields.10, + status: self._fields.11, + verification: self._fields.12, + viewer: self._fields.13, extra_data: Some(extra_data), } } @@ -5058,10 +5752,12 @@ pub struct ProfileViewBasicBuilder>, Option>, Option, + Option>, Option>, Option, Option>, Option>>, + Option, Option>, Option>, Option>, @@ -5081,7 +5777,20 @@ impl ProfileViewBasicBuilder { pub fn new() -> Self { ProfileViewBasicBuilder { _state: PhantomData, - _fields: (None, None, None, None, None, None, None, None, None, None), + _fields: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), _type: PhantomData, } } @@ -5132,6 +5841,19 @@ impl ProfileViewBasicBuilder ProfileViewBasicBuilder { + /// Set the `debug` field (optional) + pub fn debug(mut self, value: impl Into>>) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `debug` field to an Option value (optional) + pub fn maybe_debug(mut self, value: Option>) -> Self { + self._fields.3 = value; + self + } +} + impl ProfileViewBasicBuilder where St: profile_view_basic_state::State, @@ -5142,7 +5864,7 @@ where mut self, value: impl Into>, ) -> ProfileViewBasicBuilder> { - self._fields.3 = Option::Some(value.into()); + self._fields.4 = Option::Some(value.into()); ProfileViewBasicBuilder { _state: PhantomData, _fields: self._fields, @@ -5154,12 +5876,12 @@ where impl ProfileViewBasicBuilder { /// Set the `displayName` field (optional) pub fn display_name(mut self, value: impl Into>) -> Self { - self._fields.4 = value.into(); + self._fields.5 = value.into(); self } /// Set the `displayName` field to an Option value (optional) pub fn maybe_display_name(mut self, value: Option) -> Self { - self._fields.4 = value; + self._fields.5 = value; self } } @@ -5174,7 +5896,7 @@ where mut self, value: impl Into>, ) -> ProfileViewBasicBuilder> { - self._fields.5 = Option::Some(value.into()); + self._fields.6 = Option::Some(value.into()); ProfileViewBasicBuilder { _state: PhantomData, _fields: self._fields, @@ -5186,12 +5908,25 @@ where impl ProfileViewBasicBuilder { /// Set the `labels` field (optional) pub fn labels(mut self, value: impl Into>>>) -> Self { - self._fields.6 = value.into(); + self._fields.7 = value.into(); self } /// Set the `labels` field to an Option value (optional) pub fn maybe_labels(mut self, value: Option>>) -> Self { - self._fields.6 = value; + self._fields.7 = value; + self + } +} + +impl ProfileViewBasicBuilder { + /// Set the `pronouns` field (optional) + pub fn pronouns(mut self, value: impl Into>) -> Self { + self._fields.8 = value.into(); + self + } + /// Set the `pronouns` field to an Option value (optional) + pub fn maybe_pronouns(mut self, value: Option) -> Self { + self._fields.8 = value; self } } @@ -5199,12 +5934,12 @@ impl ProfileViewBasicBuilder ProfileViewBasicBuilder { /// Set the `status` field (optional) pub fn status(mut self, value: impl Into>>) -> Self { - self._fields.7 = value.into(); + self._fields.9 = value.into(); self } /// Set the `status` field to an Option value (optional) pub fn maybe_status(mut self, value: Option>) -> Self { - self._fields.7 = value; + self._fields.9 = value; self } } @@ -5215,7 +5950,7 @@ impl ProfileViewBasicBuilder>>, ) -> Self { - self._fields.8 = value.into(); + self._fields.10 = value.into(); self } /// Set the `verification` field to an Option value (optional) @@ -5223,7 +5958,7 @@ impl ProfileViewBasicBuilder>, ) -> Self { - self._fields.8 = value; + self._fields.10 = value; self } } @@ -5231,12 +5966,12 @@ impl ProfileViewBasicBuilder ProfileViewBasicBuilder { /// Set the `viewer` field (optional) pub fn viewer(mut self, value: impl Into>>) -> Self { - self._fields.9 = value.into(); + self._fields.11 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer(mut self, value: Option>) -> Self { - self._fields.9 = value; + self._fields.11 = value; self } } @@ -5253,13 +5988,15 @@ where associated: self._fields.0, avatar: self._fields.1, created_at: self._fields.2, - did: self._fields.3.unwrap(), - display_name: self._fields.4, - handle: self._fields.5.unwrap(), - labels: self._fields.6, - status: self._fields.7, - verification: self._fields.8, - viewer: self._fields.9, + debug: self._fields.3, + did: self._fields.4.unwrap(), + display_name: self._fields.5, + handle: self._fields.6.unwrap(), + labels: self._fields.7, + pronouns: self._fields.8, + status: self._fields.9, + verification: self._fields.10, + viewer: self._fields.11, extra_data: Default::default(), } } @@ -5272,13 +6009,15 @@ where associated: self._fields.0, avatar: self._fields.1, created_at: self._fields.2, - did: self._fields.3.unwrap(), - display_name: self._fields.4, - handle: self._fields.5.unwrap(), - labels: self._fields.6, - status: self._fields.7, - verification: self._fields.8, - viewer: self._fields.9, + debug: self._fields.3, + did: self._fields.4.unwrap(), + display_name: self._fields.5, + handle: self._fields.6.unwrap(), + labels: self._fields.7, + pronouns: self._fields.8, + status: self._fields.9, + verification: self._fields.10, + viewer: self._fields.11, extra_data: Some(extra_data), } } @@ -5294,37 +6033,37 @@ pub mod profile_view_detailed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Handle; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Handle = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Handle = St::Handle; + type Did = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData St>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Did = St::Did; type Handle = Set; + type Did = St::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = St::Handle; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -5339,6 +6078,7 @@ pub struct ProfileViewDetailedBuilder< Option>, Option>, Option, + Option>, Option, Option>, Option, @@ -5350,9 +6090,11 @@ pub struct ProfileViewDetailedBuilder< Option>>, Option>, Option, + Option, Option>, Option>, Option>, + Option>, ), _type: PhantomData S>, } @@ -5388,6 +6130,9 @@ impl ProfileViewDetailedBuilder ProfileViewDetailedBuilder { + /// Set the `debug` field (optional) + pub fn debug(mut self, value: impl Into>>) -> Self { + self._fields.4 = value.into(); + self + } + /// Set the `debug` field to an Option value (optional) + pub fn maybe_debug(mut self, value: Option>) -> Self { + self._fields.4 = value; + self + } +} + impl< S: BosStr, St: profile_view_detailed_state::State, > ProfileViewDetailedBuilder { /// Set the `description` field (optional) pub fn description(mut self, value: impl Into>) -> Self { - self._fields.4 = value.into(); + self._fields.5 = value.into(); self } /// Set the `description` field to an Option value (optional) pub fn maybe_description(mut self, value: Option) -> Self { - self._fields.4 = value; + self._fields.5 = value; self } } @@ -5490,7 +6251,7 @@ where mut self, value: impl Into>, ) -> ProfileViewDetailedBuilder> { - self._fields.5 = Option::Some(value.into()); + self._fields.6 = Option::Some(value.into()); ProfileViewDetailedBuilder { _state: PhantomData, _fields: self._fields, @@ -5505,12 +6266,12 @@ impl< > ProfileViewDetailedBuilder { /// Set the `displayName` field (optional) pub fn display_name(mut self, value: impl Into>) -> Self { - self._fields.6 = value.into(); + self._fields.7 = value.into(); self } /// Set the `displayName` field to an Option value (optional) pub fn maybe_display_name(mut self, value: Option) -> Self { - self._fields.6 = value; + self._fields.7 = value; self } } @@ -5521,12 +6282,12 @@ impl< > ProfileViewDetailedBuilder { /// Set the `followersCount` field (optional) pub fn followers_count(mut self, value: impl Into>) -> Self { - self._fields.7 = value.into(); + self._fields.8 = value.into(); self } /// Set the `followersCount` field to an Option value (optional) pub fn maybe_followers_count(mut self, value: Option) -> Self { - self._fields.7 = value; + self._fields.8 = value; self } } @@ -5537,12 +6298,12 @@ impl< > ProfileViewDetailedBuilder { /// Set the `followsCount` field (optional) pub fn follows_count(mut self, value: impl Into>) -> Self { - self._fields.8 = value.into(); + self._fields.9 = value.into(); self } /// Set the `followsCount` field to an Option value (optional) pub fn maybe_follows_count(mut self, value: Option) -> Self { - self._fields.8 = value; + self._fields.9 = value; self } } @@ -5557,7 +6318,7 @@ where mut self, value: impl Into>, ) -> ProfileViewDetailedBuilder> { - self._fields.9 = Option::Some(value.into()); + self._fields.10 = Option::Some(value.into()); ProfileViewDetailedBuilder { _state: PhantomData, _fields: self._fields, @@ -5572,12 +6333,12 @@ impl< > ProfileViewDetailedBuilder { /// Set the `indexedAt` field (optional) pub fn indexed_at(mut self, value: impl Into>) -> Self { - self._fields.10 = value.into(); + self._fields.11 = value.into(); self } /// Set the `indexedAt` field to an Option value (optional) pub fn maybe_indexed_at(mut self, value: Option) -> Self { - self._fields.10 = value; + self._fields.11 = value; self } } @@ -5591,7 +6352,7 @@ impl< mut self, value: impl Into>>, ) -> Self { - self._fields.11 = value.into(); + self._fields.12 = value.into(); self } /// Set the `joinedViaStarterPack` field to an Option value (optional) @@ -5599,7 +6360,7 @@ impl< mut self, value: Option>, ) -> Self { - self._fields.11 = value; + self._fields.12 = value; self } } @@ -5610,12 +6371,12 @@ impl< > ProfileViewDetailedBuilder { /// Set the `labels` field (optional) pub fn labels(mut self, value: impl Into>>>) -> Self { - self._fields.12 = value.into(); + self._fields.13 = value.into(); self } /// Set the `labels` field to an Option value (optional) pub fn maybe_labels(mut self, value: Option>>) -> Self { - self._fields.12 = value; + self._fields.13 = value; self } } @@ -5626,12 +6387,12 @@ impl< > ProfileViewDetailedBuilder { /// Set the `pinnedPost` field (optional) pub fn pinned_post(mut self, value: impl Into>>) -> Self { - self._fields.13 = value.into(); + self._fields.14 = value.into(); self } /// Set the `pinnedPost` field to an Option value (optional) pub fn maybe_pinned_post(mut self, value: Option>) -> Self { - self._fields.13 = value; + self._fields.14 = value; self } } @@ -5642,12 +6403,28 @@ impl< > ProfileViewDetailedBuilder { /// Set the `postsCount` field (optional) pub fn posts_count(mut self, value: impl Into>) -> Self { - self._fields.14 = value.into(); + self._fields.15 = value.into(); self } /// Set the `postsCount` field to an Option value (optional) pub fn maybe_posts_count(mut self, value: Option) -> Self { - self._fields.14 = value; + self._fields.15 = value; + self + } +} + +impl< + S: BosStr, + St: profile_view_detailed_state::State, +> ProfileViewDetailedBuilder { + /// Set the `pronouns` field (optional) + pub fn pronouns(mut self, value: impl Into>) -> Self { + self._fields.16 = value.into(); + self + } + /// Set the `pronouns` field to an Option value (optional) + pub fn maybe_pronouns(mut self, value: Option) -> Self { + self._fields.16 = value; self } } @@ -5658,12 +6435,12 @@ impl< > ProfileViewDetailedBuilder { /// Set the `status` field (optional) pub fn status(mut self, value: impl Into>>) -> Self { - self._fields.15 = value.into(); + self._fields.17 = value.into(); self } /// Set the `status` field to an Option value (optional) pub fn maybe_status(mut self, value: Option>) -> Self { - self._fields.15 = value; + self._fields.17 = value; self } } @@ -5677,7 +6454,7 @@ impl< mut self, value: impl Into>>, ) -> Self { - self._fields.16 = value.into(); + self._fields.18 = value.into(); self } /// Set the `verification` field to an Option value (optional) @@ -5685,7 +6462,7 @@ impl< mut self, value: Option>, ) -> Self { - self._fields.16 = value; + self._fields.18 = value; self } } @@ -5696,12 +6473,28 @@ impl< > ProfileViewDetailedBuilder { /// Set the `viewer` field (optional) pub fn viewer(mut self, value: impl Into>>) -> Self { - self._fields.17 = value.into(); + self._fields.19 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer(mut self, value: Option>) -> Self { - self._fields.17 = value; + self._fields.19 = value; + self + } +} + +impl< + S: BosStr, + St: profile_view_detailed_state::State, +> ProfileViewDetailedBuilder { + /// Set the `website` field (optional) + pub fn website(mut self, value: impl Into>>) -> Self { + self._fields.20 = value.into(); + self + } + /// Set the `website` field to an Option value (optional) + pub fn maybe_website(mut self, value: Option>) -> Self { + self._fields.20 = value; self } } @@ -5709,8 +6502,8 @@ impl< impl ProfileViewDetailedBuilder where St: profile_view_detailed_state::State, - St::Did: profile_view_detailed_state::IsSet, St::Handle: profile_view_detailed_state::IsSet, + St::Did: profile_view_detailed_state::IsSet, { /// Build the final struct. pub fn build(self) -> ProfileViewDetailed { @@ -5719,20 +6512,23 @@ where avatar: self._fields.1, banner: self._fields.2, created_at: self._fields.3, - description: self._fields.4, - did: self._fields.5.unwrap(), - display_name: self._fields.6, - followers_count: self._fields.7, - follows_count: self._fields.8, - handle: self._fields.9.unwrap(), - indexed_at: self._fields.10, - joined_via_starter_pack: self._fields.11, - labels: self._fields.12, - pinned_post: self._fields.13, - posts_count: self._fields.14, - status: self._fields.15, - verification: self._fields.16, - viewer: self._fields.17, + debug: self._fields.4, + description: self._fields.5, + did: self._fields.6.unwrap(), + display_name: self._fields.7, + followers_count: self._fields.8, + follows_count: self._fields.9, + handle: self._fields.10.unwrap(), + indexed_at: self._fields.11, + joined_via_starter_pack: self._fields.12, + labels: self._fields.13, + pinned_post: self._fields.14, + posts_count: self._fields.15, + pronouns: self._fields.16, + status: self._fields.17, + verification: self._fields.18, + viewer: self._fields.19, + website: self._fields.20, extra_data: Default::default(), } } @@ -5746,20 +6542,23 @@ where avatar: self._fields.1, banner: self._fields.2, created_at: self._fields.3, - description: self._fields.4, - did: self._fields.5.unwrap(), - display_name: self._fields.6, - followers_count: self._fields.7, - follows_count: self._fields.8, - handle: self._fields.9.unwrap(), - indexed_at: self._fields.10, - joined_via_starter_pack: self._fields.11, - labels: self._fields.12, - pinned_post: self._fields.13, - posts_count: self._fields.14, - status: self._fields.15, - verification: self._fields.16, - viewer: self._fields.17, + debug: self._fields.4, + description: self._fields.5, + did: self._fields.6.unwrap(), + display_name: self._fields.7, + followers_count: self._fields.8, + follows_count: self._fields.9, + handle: self._fields.10.unwrap(), + indexed_at: self._fields.11, + joined_via_starter_pack: self._fields.12, + labels: self._fields.13, + pinned_post: self._fields.14, + posts_count: self._fields.15, + pronouns: self._fields.16, + status: self._fields.17, + verification: self._fields.18, + viewer: self._fields.19, + website: self._fields.20, extra_data: Some(extra_data), } } @@ -5775,65 +6574,65 @@ pub mod saved_feed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Type; type Id; type Pinned; - type Type; type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Type = Unset; type Id = Unset; type Pinned = Unset; - type Type = Unset; type Value = Unset; } + ///State transition - sets the `type` field to Set + pub struct SetType(PhantomData St>); + impl sealed::Sealed for SetType {} + impl State for SetType { + type Type = Set; + type Id = St::Id; + type Pinned = St::Pinned; + type Value = St::Value; + } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData St>); impl sealed::Sealed for SetId {} impl State for SetId { + type Type = St::Type; type Id = Set; type Pinned = St::Pinned; - type Type = St::Type; type Value = St::Value; } ///State transition - sets the `pinned` field to Set pub struct SetPinned(PhantomData St>); impl sealed::Sealed for SetPinned {} impl State for SetPinned { - type Id = St::Id; - type Pinned = Set; type Type = St::Type; - type Value = St::Value; - } - ///State transition - sets the `type` field to Set - pub struct SetType(PhantomData St>); - impl sealed::Sealed for SetType {} - impl State for SetType { type Id = St::Id; - type Pinned = St::Pinned; - type Type = Set; + type Pinned = Set; type Value = St::Value; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData St>); impl sealed::Sealed for SetValue {} impl State for SetValue { + type Type = St::Type; type Id = St::Id; type Pinned = St::Pinned; - type Type = St::Type; type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `type` field + pub struct r#type(()); ///Marker type for the `id` field pub struct id(()); ///Marker type for the `pinned` field pub struct pinned(()); - ///Marker type for the `type` field - pub struct r#type(()); ///Marker type for the `value` field pub struct value(()); } @@ -5943,9 +6742,9 @@ where impl SavedFeedBuilder where St: saved_feed_state::State, + St::Type: saved_feed_state::IsSet, St::Id: saved_feed_state::IsSet, St::Pinned: saved_feed_state::IsSet, - St::Type: saved_feed_state::IsSet, St::Value: saved_feed_state::IsSet, { /// Build the final struct. @@ -5983,37 +6782,37 @@ pub mod saved_feeds_pref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Pinned; type Saved; + type Pinned; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Pinned = Unset; type Saved = Unset; - } - ///State transition - sets the `pinned` field to Set - pub struct SetPinned(PhantomData St>); - impl sealed::Sealed for SetPinned {} - impl State for SetPinned { - type Pinned = Set; - type Saved = St::Saved; + type Pinned = Unset; } ///State transition - sets the `saved` field to Set pub struct SetSaved(PhantomData St>); impl sealed::Sealed for SetSaved {} impl State for SetSaved { - type Pinned = St::Pinned; type Saved = Set; + type Pinned = St::Pinned; + } + ///State transition - sets the `pinned` field to Set + pub struct SetPinned(PhantomData St>); + impl sealed::Sealed for SetPinned {} + impl State for SetPinned { + type Saved = St::Saved; + type Pinned = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `pinned` field - pub struct pinned(()); ///Marker type for the `saved` field pub struct saved(()); + ///Marker type for the `pinned` field + pub struct pinned(()); } } @@ -6096,8 +6895,8 @@ impl SavedFeedsPrefBuilder impl SavedFeedsPrefBuilder where St: saved_feeds_pref_state::State, - St::Pinned: saved_feeds_pref_state::IsSet, St::Saved: saved_feeds_pref_state::IsSet, + St::Pinned: saved_feeds_pref_state::IsSet, { /// Build the final struct. pub fn build(self) -> SavedFeedsPref { @@ -6232,37 +7031,37 @@ pub mod status_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; type Status; + type Record; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; type Status = Unset; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData St>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Record = Set; - type Status = St::Status; + type Record = Unset; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData St>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type Record = St::Record; type Status = Set; + type Record = St::Record; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData St>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Status = St::Status; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `record` field + pub struct record(()); } } @@ -6270,11 +7069,15 @@ pub mod status_view_state { pub struct StatusViewBuilder { _state: PhantomData St>, _fields: ( + Option>, Option>, Option, Option, + Option, + Option>>, Option>, Option>, + Option>, ), _type: PhantomData S>, } @@ -6291,21 +7094,34 @@ impl StatusViewBuilder { pub fn new() -> Self { StatusViewBuilder { _state: PhantomData, - _fields: (None, None, None, None, None), + _fields: (None, None, None, None, None, None, None, None, None), _type: PhantomData, } } } +impl StatusViewBuilder { + /// Set the `cid` field (optional) + pub fn cid(mut self, value: impl Into>>) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `cid` field to an Option value (optional) + pub fn maybe_cid(mut self, value: Option>) -> Self { + self._fields.0 = value; + self + } +} + impl StatusViewBuilder { /// Set the `embed` field (optional) pub fn embed(mut self, value: impl Into>>) -> Self { - self._fields.0 = value.into(); + self._fields.1 = value.into(); self } /// Set the `embed` field to an Option value (optional) pub fn maybe_embed(mut self, value: Option>) -> Self { - self._fields.0 = value; + self._fields.1 = value; self } } @@ -6313,12 +7129,12 @@ impl StatusViewBuilder { impl StatusViewBuilder { /// Set the `expiresAt` field (optional) pub fn expires_at(mut self, value: impl Into>) -> Self { - self._fields.1 = value.into(); + self._fields.2 = value.into(); self } /// Set the `expiresAt` field to an Option value (optional) pub fn maybe_expires_at(mut self, value: Option) -> Self { - self._fields.1 = value; + self._fields.2 = value; self } } @@ -6326,12 +7142,38 @@ impl StatusViewBuilder { impl StatusViewBuilder { /// Set the `isActive` field (optional) pub fn is_active(mut self, value: impl Into>) -> Self { - self._fields.2 = value.into(); + self._fields.3 = value.into(); self } /// Set the `isActive` field to an Option value (optional) pub fn maybe_is_active(mut self, value: Option) -> Self { - self._fields.2 = value; + self._fields.3 = value; + self + } +} + +impl StatusViewBuilder { + /// Set the `isDisabled` field (optional) + pub fn is_disabled(mut self, value: impl Into>) -> Self { + self._fields.4 = value.into(); + self + } + /// Set the `isDisabled` field to an Option value (optional) + pub fn maybe_is_disabled(mut self, value: Option) -> Self { + self._fields.4 = value; + self + } +} + +impl StatusViewBuilder { + /// Set the `labels` field (optional) + pub fn labels(mut self, value: impl Into>>>) -> Self { + self._fields.5 = value.into(); + self + } + /// Set the `labels` field to an Option value (optional) + pub fn maybe_labels(mut self, value: Option>>) -> Self { + self._fields.5 = value; self } } @@ -6346,7 +7188,7 @@ where mut self, value: impl Into>, ) -> StatusViewBuilder> { - self._fields.3 = Option::Some(value.into()); + self._fields.6 = Option::Some(value.into()); StatusViewBuilder { _state: PhantomData, _fields: self._fields, @@ -6365,7 +7207,7 @@ where mut self, value: impl Into>, ) -> StatusViewBuilder> { - self._fields.4 = Option::Some(value.into()); + self._fields.7 = Option::Some(value.into()); StatusViewBuilder { _state: PhantomData, _fields: self._fields, @@ -6374,20 +7216,37 @@ where } } +impl StatusViewBuilder { + /// Set the `uri` field (optional) + pub fn uri(mut self, value: impl Into>>) -> Self { + self._fields.8 = value.into(); + self + } + /// Set the `uri` field to an Option value (optional) + pub fn maybe_uri(mut self, value: Option>) -> Self { + self._fields.8 = value; + self + } +} + impl StatusViewBuilder where St: status_view_state::State, - St::Record: status_view_state::IsSet, St::Status: status_view_state::IsSet, + St::Record: status_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> StatusView { StatusView { - embed: self._fields.0, - expires_at: self._fields.1, - is_active: self._fields.2, - record: self._fields.3.unwrap(), - status: self._fields.4.unwrap(), + cid: self._fields.0, + embed: self._fields.1, + expires_at: self._fields.2, + is_active: self._fields.3, + is_disabled: self._fields.4, + labels: self._fields.5, + record: self._fields.6.unwrap(), + status: self._fields.7.unwrap(), + uri: self._fields.8, extra_data: Default::default(), } } @@ -6397,11 +7256,15 @@ where extra_data: BTreeMap>, ) -> StatusView { StatusView { - embed: self._fields.0, - expires_at: self._fields.1, - is_active: self._fields.2, - record: self._fields.3.unwrap(), - status: self._fields.4.unwrap(), + cid: self._fields.0, + embed: self._fields.1, + expires_at: self._fields.2, + is_active: self._fields.3, + is_disabled: self._fields.4, + labels: self._fields.5, + record: self._fields.6.unwrap(), + status: self._fields.7.unwrap(), + uri: self._fields.8, extra_data: Some(extra_data), } } @@ -6608,73 +7471,80 @@ pub mod verification_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type CreatedAt; + type Uri; type Issuer; type IsValid; - type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type CreatedAt = Unset; + type Uri = Unset; type Issuer = Unset; type IsValid = Unset; - type Uri = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData St>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type CreatedAt = Set; + type Uri = St::Uri; + type Issuer = St::Issuer; + type IsValid = St::IsValid; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type CreatedAt = St::CreatedAt; + type Uri = Set; type Issuer = St::Issuer; type IsValid = St::IsValid; - type Uri = St::Uri; } ///State transition - sets the `issuer` field to Set pub struct SetIssuer(PhantomData St>); impl sealed::Sealed for SetIssuer {} impl State for SetIssuer { type CreatedAt = St::CreatedAt; + type Uri = St::Uri; type Issuer = Set; type IsValid = St::IsValid; - type Uri = St::Uri; } ///State transition - sets the `is_valid` field to Set pub struct SetIsValid(PhantomData St>); impl sealed::Sealed for SetIsValid {} impl State for SetIsValid { type CreatedAt = St::CreatedAt; - type Issuer = St::Issuer; - type IsValid = Set; type Uri = St::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type CreatedAt = St::CreatedAt; type Issuer = St::Issuer; - type IsValid = St::IsValid; - type Uri = Set; + type IsValid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `is_valid` field - pub struct is_valid(()); - ///Marker type for the `issuer` field - pub struct issuer(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `issuer` field + pub struct issuer(()); + ///Marker type for the `is_valid` field + pub struct is_valid(()); } } /// Builder for constructing an instance of this type. pub struct VerificationViewBuilder { _state: PhantomData St>, - _fields: (Option, Option, Option>, Option>), + _fields: ( + Option, + Option, + Option>, + Option, + Option>, + Option>, + ), _type: PhantomData S>, } @@ -6690,7 +7560,7 @@ impl VerificationViewBuilder { pub fn new() -> Self { VerificationViewBuilder { _state: PhantomData, - _fields: (None, None, None, None), + _fields: (None, None, None, None, None, None), _type: PhantomData, } } @@ -6753,6 +7623,32 @@ where } } +impl VerificationViewBuilder { + /// Set the `issuerDisplayName` field (optional) + pub fn issuer_display_name(mut self, value: impl Into>) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `issuerDisplayName` field to an Option value (optional) + pub fn maybe_issuer_display_name(mut self, value: Option) -> Self { + self._fields.3 = value; + self + } +} + +impl VerificationViewBuilder { + /// Set the `issuerHandle` field (optional) + pub fn issuer_handle(mut self, value: impl Into>>) -> Self { + self._fields.4 = value.into(); + self + } + /// Set the `issuerHandle` field to an Option value (optional) + pub fn maybe_issuer_handle(mut self, value: Option>) -> Self { + self._fields.4 = value; + self + } +} + impl VerificationViewBuilder where St: verification_view_state::State, @@ -6763,7 +7659,7 @@ where mut self, value: impl Into>, ) -> VerificationViewBuilder> { - self._fields.3 = Option::Some(value.into()); + self._fields.5 = Option::Some(value.into()); VerificationViewBuilder { _state: PhantomData, _fields: self._fields, @@ -6776,9 +7672,9 @@ impl VerificationViewBuilder where St: verification_view_state::State, St::CreatedAt: verification_view_state::IsSet, + St::Uri: verification_view_state::IsSet, St::Issuer: verification_view_state::IsSet, St::IsValid: verification_view_state::IsSet, - St::Uri: verification_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> VerificationView { @@ -6786,7 +7682,9 @@ where created_at: self._fields.0.unwrap(), is_valid: self._fields.1.unwrap(), issuer: self._fields.2.unwrap(), - uri: self._fields.3.unwrap(), + issuer_display_name: self._fields.3, + issuer_handle: self._fields.4, + uri: self._fields.5.unwrap(), extra_data: Default::default(), } } @@ -6799,7 +7697,9 @@ where created_at: self._fields.0.unwrap(), is_valid: self._fields.1.unwrap(), issuer: self._fields.2.unwrap(), - uri: self._fields.3.unwrap(), + issuer_display_name: self._fields.3, + issuer_handle: self._fields.4, + uri: self._fields.5.unwrap(), extra_data: Some(extra_data), } } diff --git a/services/types/src/app_bsky/actor/get_suggestions.rs b/services/types/src/app_bsky/actor/get_suggestions.rs index c0c49b4..42222d7 100644 --- a/services/types/src/app_bsky/actor/get_suggestions.rs +++ b/services/types/src/app_bsky/actor/get_suggestions.rs @@ -35,9 +35,12 @@ pub struct GetSuggestionsOutput { pub actors: Vec>, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, - ///Snowflake for this recommendation, use when submitting recommendation events. + ///DEPRECATED: use recIdStr instead. #[serde(skip_serializing_if = "Option::is_none")] pub rec_id: Option, + ///Snowflake for this recommendation, use when submitting recommendation events. + #[serde(skip_serializing_if = "Option::is_none")] + pub rec_id_str: Option, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } diff --git a/services/types/src/app_bsky/actor/profile.rs b/services/types/src/app_bsky/actor/profile.rs index 3be5924..e7b396f 100644 --- a/services/types/src/app_bsky/actor/profile.rs +++ b/services/types/src/app_bsky/actor/profile.rs @@ -17,7 +17,7 @@ use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::blob::BlobRef; use jacquard_common::types::collection::{Collection, RecordError}; -use jacquard_common::types::string::{AtUri, Cid, Datetime}; +use jacquard_common::types::string::{AtUri, Cid, Datetime, UriValue}; use jacquard_common::types::uri::{RecordUri, UriError}; use jacquard_common::types::value::Data; use jacquard_common::xrpc::XrpcResp; @@ -60,6 +60,11 @@ pub struct Profile { pub labels: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub pinned_post: Option>, + ///Free-form pronouns text. + #[serde(skip_serializing_if = "Option::is_none")] + pub pronouns: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub website: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } @@ -243,6 +248,28 @@ impl LexiconSchema for Profile { } } } + if let Some(ref value) = self.pronouns { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 200usize { + return Err(ConstraintError::MaxLength { + path: ValidationPath::from_field("pronouns"), + max: 200usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.pronouns { + { + let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count(); + if count > 20usize { + return Err(ConstraintError::MaxGraphemes { + path: ValidationPath::from_field("pronouns"), + max: 20usize, + actual: count, + }); + } + } + } Ok(()) } } @@ -278,6 +305,8 @@ pub struct ProfileBuilder { Option>, Option>, Option>, + Option, + Option>, ), _type: PhantomData S>, } @@ -294,7 +323,7 @@ impl ProfileBuilder { pub fn new() -> Self { ProfileBuilder { _state: PhantomData, - _fields: (None, None, None, None, None, None, None, None), + _fields: (None, None, None, None, None, None, None, None, None, None), _type: PhantomData, } } @@ -407,6 +436,32 @@ impl ProfileBuilder { } } +impl ProfileBuilder { + /// Set the `pronouns` field (optional) + pub fn pronouns(mut self, value: impl Into>) -> Self { + self._fields.8 = value.into(); + self + } + /// Set the `pronouns` field to an Option value (optional) + pub fn maybe_pronouns(mut self, value: Option) -> Self { + self._fields.8 = value; + self + } +} + +impl ProfileBuilder { + /// Set the `website` field (optional) + pub fn website(mut self, value: impl Into>>) -> Self { + self._fields.9 = value.into(); + self + } + /// Set the `website` field to an Option value (optional) + pub fn maybe_website(mut self, value: Option>) -> Self { + self._fields.9 = value; + self + } +} + impl ProfileBuilder where St: profile_state::State, @@ -422,6 +477,8 @@ where joined_via_starter_pack: self._fields.5, labels: self._fields.6, pinned_post: self._fields.7, + pronouns: self._fields.8, + website: self._fields.9, extra_data: Default::default(), } } @@ -436,6 +493,8 @@ where joined_via_starter_pack: self._fields.5, labels: self._fields.6, pinned_post: self._fields.7, + pronouns: self._fields.8, + website: self._fields.9, extra_data: Some(extra_data), } } @@ -524,6 +583,24 @@ fn lexicon_doc_app_bsky_actor_profile() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("pronouns"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("Free-form pronouns text."), + ), + max_length: Some(200usize), + max_graphemes: Some(20usize), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("website"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Uri), + ..Default::default() + }), + ); map }, ..Default::default() diff --git a/services/types/src/app_bsky/actor/status.rs b/services/types/src/app_bsky/actor/status.rs index d24fe1a..f4d9fa4 100644 --- a/services/types/src/app_bsky/actor/status.rs +++ b/services/types/src/app_bsky/actor/status.rs @@ -214,37 +214,37 @@ pub mod status_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Status; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Status = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Status = St::Status; + type CreatedAt = Unset; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData St>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type CreatedAt = St::CreatedAt; type Status = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Status = St::Status; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -345,8 +345,8 @@ where impl StatusBuilder where St: status_state::State, - St::CreatedAt: status_state::IsSet, St::Status: status_state::IsSet, + St::CreatedAt: status_state::IsSet, { /// Build the final struct. pub fn build(self) -> Status { diff --git a/services/types/src/app_bsky/embed.rs b/services/types/src/app_bsky/embed.rs index b1efa9f..c38e6d7 100644 --- a/services/types/src/app_bsky/embed.rs +++ b/services/types/src/app_bsky/embed.rs @@ -6,6 +6,8 @@ // Any manual changes will be overwritten on the next regeneration. pub mod external; +pub mod gallery; +pub mod get_embed_external_view; pub mod images; pub mod record; pub mod record_with_media; @@ -86,37 +88,37 @@ pub mod aspect_ratio_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Height; type Width; + type Height; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Height = Unset; type Width = Unset; - } - ///State transition - sets the `height` field to Set - pub struct SetHeight(PhantomData St>); - impl sealed::Sealed for SetHeight {} - impl State for SetHeight { - type Height = Set; - type Width = St::Width; + type Height = Unset; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData St>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type Height = St::Height; type Width = Set; + type Height = St::Height; + } + ///State transition - sets the `height` field to Set + pub struct SetHeight(PhantomData St>); + impl sealed::Sealed for SetHeight {} + impl State for SetHeight { + type Width = St::Width; + type Height = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `height` field - pub struct height(()); ///Marker type for the `width` field pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); } } @@ -186,8 +188,8 @@ where impl AspectRatioBuilder where St: aspect_ratio_state::State, - St::Height: aspect_ratio_state::IsSet, St::Width: aspect_ratio_state::IsSet, + St::Height: aspect_ratio_state::IsSet, { /// Build the final struct. pub fn build(self) -> AspectRatio { diff --git a/services/types/src/app_bsky/embed/external.rs b/services/types/src/app_bsky/embed/external.rs index 0fe51d1..16835be 100644 --- a/services/types/src/app_bsky/embed/external.rs +++ b/services/types/src/app_bsky/embed/external.rs @@ -16,7 +16,7 @@ use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::blob::BlobRef; -use jacquard_common::types::string::UriValue; +use jacquard_common::types::string::{Datetime, UriValue}; use jacquard_common::types::value::Data; use jacquard_derive::IntoStatic; use jacquard_lexicon::lexicon::LexiconDoc; @@ -25,11 +25,29 @@ use jacquard_lexicon::schema::LexiconSchema; #[allow(unused_imports)] use jacquard_lexicon::validation::{ConstraintError, ValidationPath}; use serde::{Serialize, Deserialize}; +use crate::app_bsky::actor::ProfileViewBasic; +use crate::com_atproto::label::Label; +use crate::com_atproto::repo::strong_ref::StrongRef; use crate::app_bsky::embed::external; +/// RGB color definition, inspired by site.standard.theme.color#rgb + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ColorRgb { + pub b: i64, + pub g: i64, + pub r: i64, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct External { + ///StrongRefs (uri+cid) of the Atmosphere records that backed this view. + #[serde(skip_serializing_if = "Option::is_none")] + pub associated_refs: Option>>, pub description: S, #[serde(skip_serializing_if = "Option::is_none")] pub thumb: Option>, @@ -62,15 +80,145 @@ pub struct View { #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ViewExternal { + ///Profiles of the owners of the Atmosphere records that backed this view. + #[serde(skip_serializing_if = "Option::is_none")] + pub associated_profiles: Option>>, + ///StrongRefs (uri+cid) of the Atmosphere records that backed this view. + #[serde(skip_serializing_if = "Option::is_none")] + pub associated_refs: Option>>, + ///When the external content was created, if available. Example: a publication date, for an article. + #[serde(skip_serializing_if = "Option::is_none")] + pub created_at: Option, pub description: S, #[serde(skip_serializing_if = "Option::is_none")] + pub labels: Option>>, + ///Estimated reading time in minutes, if applicable and available. + #[serde(skip_serializing_if = "Option::is_none")] + pub reading_time: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub source: Option>, + #[serde(skip_serializing_if = "Option::is_none")] pub thumb: Option>, pub title: S, + ///When the external content was updated, if available. + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + pub uri: UriValue, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// The source of an external embed, such as a standard.site publication. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ViewExternalSource { + #[serde(skip_serializing_if = "Option::is_none")] + pub description: Option, + ///Fully-qualified URL where an icon representing the source can be fetched. For example, CDN location provided by the App View. + #[serde(skip_serializing_if = "Option::is_none")] + pub icon: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub theme: Option>, + pub title: S, + ///URI of the source, if available. Example: the https:// URL of a site.standard.publication record. pub uri: UriValue, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } +/// The theme colors of an external source, such as a site.standard.publication. These colors may be used when rendering an embed from that source. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ViewExternalSourceTheme { + #[serde(skip_serializing_if = "Option::is_none")] + pub accent_foreground_rgb: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub accent_rgb: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub background_rgb: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub foreground_rgb: Option>, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +impl LexiconSchema for ColorRgb { + fn nsid() -> &'static str { + "app.bsky.embed.external" + } + fn def_name() -> &'static str { + "colorRGB" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_external() + } + fn validate(&self) -> Result<(), ConstraintError> { + { + let value = &self.b; + if *value > 255i64 { + return Err(ConstraintError::Maximum { + path: ValidationPath::from_field("b"), + max: 255i64, + actual: *value, + }); + } + } + { + let value = &self.b; + if *value < 0i64 { + return Err(ConstraintError::Minimum { + path: ValidationPath::from_field("b"), + min: 0i64, + actual: *value, + }); + } + } + { + let value = &self.g; + if *value > 255i64 { + return Err(ConstraintError::Maximum { + path: ValidationPath::from_field("g"), + max: 255i64, + actual: *value, + }); + } + } + { + let value = &self.g; + if *value < 0i64 { + return Err(ConstraintError::Minimum { + path: ValidationPath::from_field("g"), + min: 0i64, + actual: *value, + }); + } + } + { + let value = &self.r; + if *value > 255i64 { + return Err(ConstraintError::Maximum { + path: ValidationPath::from_field("r"), + max: 255i64, + actual: *value, + }); + } + } + { + let value = &self.r; + if *value < 0i64 { + return Err(ConstraintError::Minimum { + path: ValidationPath::from_field("r"), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} + impl LexiconSchema for External { fn nsid() -> &'static str { "app.bsky.embed.external" @@ -169,7 +317,37 @@ impl LexiconSchema for ViewExternal { } } -pub mod external_state { +impl LexiconSchema for ViewExternalSource { + fn nsid() -> &'static str { + "app.bsky.embed.external" + } + fn def_name() -> &'static str { + "viewExternalSource" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_external() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for ViewExternalSourceTheme { + fn nsid() -> &'static str { + "app.bsky.embed.external" + } + fn def_name() -> &'static str { + "viewExternalSourceTheme" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_app_bsky_embed_external() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +pub mod color_rgb_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -179,91 +357,91 @@ pub mod external_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Description; - type Title; - type Uri; + type G; + type R; + type B; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Description = Unset; - type Title = Unset; - type Uri = Unset; - } - ///State transition - sets the `description` field to Set - pub struct SetDescription(PhantomData St>); - impl sealed::Sealed for SetDescription {} - impl State for SetDescription { - type Description = Set; - type Title = St::Title; - type Uri = St::Uri; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData St>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Description = St::Description; - type Title = Set; - type Uri = St::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Description = St::Description; - type Title = St::Title; - type Uri = Set; + type G = Unset; + type R = Unset; + type B = Unset; + } + ///State transition - sets the `g` field to Set + pub struct SetG(PhantomData St>); + impl sealed::Sealed for SetG {} + impl State for SetG { + type G = Set; + type R = St::R; + type B = St::B; + } + ///State transition - sets the `r` field to Set + pub struct SetR(PhantomData St>); + impl sealed::Sealed for SetR {} + impl State for SetR { + type G = St::G; + type R = Set; + type B = St::B; + } + ///State transition - sets the `b` field to Set + pub struct SetB(PhantomData St>); + impl sealed::Sealed for SetB {} + impl State for SetB { + type G = St::G; + type R = St::R; + type B = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `description` field - pub struct description(()); - ///Marker type for the `title` field - pub struct title(()); - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `g` field + pub struct g(()); + ///Marker type for the `r` field + pub struct r(()); + ///Marker type for the `b` field + pub struct b(()); } } /// Builder for constructing an instance of this type. -pub struct ExternalBuilder { +pub struct ColorRgbBuilder { _state: PhantomData St>, - _fields: (Option, Option>, Option, Option>), + _fields: (Option, Option, Option), _type: PhantomData S>, } -impl External { +impl ColorRgb { /// Create a new builder for this type. - pub fn new() -> ExternalBuilder { - ExternalBuilder::new() + pub fn new() -> ColorRgbBuilder { + ColorRgbBuilder::new() } } -impl ExternalBuilder { +impl ColorRgbBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - ExternalBuilder { + ColorRgbBuilder { _state: PhantomData, - _fields: (None, None, None, None), + _fields: (None, None, None), _type: PhantomData, } } } -impl ExternalBuilder +impl ColorRgbBuilder where - St: external_state::State, - St::Description: external_state::IsUnset, + St: color_rgb_state::State, + St::B: color_rgb_state::IsUnset, { - /// Set the `description` field (required) - pub fn description( + /// Set the `b` field (required) + pub fn b( mut self, - value: impl Into, - ) -> ExternalBuilder> { + value: impl Into, + ) -> ColorRgbBuilder> { self._fields.0 = Option::Some(value.into()); - ExternalBuilder { + ColorRgbBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -271,31 +449,18 @@ where } } -impl ExternalBuilder { - /// Set the `thumb` field (optional) - pub fn thumb(mut self, value: impl Into>>) -> Self { - self._fields.1 = value.into(); - self - } - /// Set the `thumb` field to an Option value (optional) - pub fn maybe_thumb(mut self, value: Option>) -> Self { - self._fields.1 = value; - self - } -} - -impl ExternalBuilder +impl ColorRgbBuilder where - St: external_state::State, - St::Title: external_state::IsUnset, + St: color_rgb_state::State, + St::G: color_rgb_state::IsUnset, { - /// Set the `title` field (required) - pub fn title( + /// Set the `g` field (required) + pub fn g( mut self, - value: impl Into, - ) -> ExternalBuilder> { - self._fields.2 = Option::Some(value.into()); - ExternalBuilder { + value: impl Into, + ) -> ColorRgbBuilder> { + self._fields.1 = Option::Some(value.into()); + ColorRgbBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -303,18 +468,18 @@ where } } -impl ExternalBuilder +impl ColorRgbBuilder where - St: external_state::State, - St::Uri: external_state::IsUnset, + St: color_rgb_state::State, + St::R: color_rgb_state::IsUnset, { - /// Set the `uri` field (required) - pub fn uri( + /// Set the `r` field (required) + pub fn r( mut self, - value: impl Into>, - ) -> ExternalBuilder> { - self._fields.3 = Option::Some(value.into()); - ExternalBuilder { + value: impl Into, + ) -> ColorRgbBuilder> { + self._fields.2 = Option::Some(value.into()); + ColorRgbBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -322,30 +487,28 @@ where } } -impl ExternalBuilder +impl ColorRgbBuilder where - St: external_state::State, - St::Description: external_state::IsSet, - St::Title: external_state::IsSet, - St::Uri: external_state::IsSet, + St: color_rgb_state::State, + St::G: color_rgb_state::IsSet, + St::R: color_rgb_state::IsSet, + St::B: color_rgb_state::IsSet, { /// Build the final struct. - pub fn build(self) -> External { - External { - description: self._fields.0.unwrap(), - thumb: self._fields.1, - title: self._fields.2.unwrap(), - uri: self._fields.3.unwrap(), + pub fn build(self) -> ColorRgb { + ColorRgb { + b: self._fields.0.unwrap(), + g: self._fields.1.unwrap(), + r: self._fields.2.unwrap(), extra_data: Default::default(), } } /// Build the final struct with custom extra_data. - pub fn build_with_data(self, extra_data: BTreeMap>) -> External { - External { - description: self._fields.0.unwrap(), - thumb: self._fields.1, - title: self._fields.2.unwrap(), - uri: self._fields.3.unwrap(), + pub fn build_with_data(self, extra_data: BTreeMap>) -> ColorRgb { + ColorRgb { + b: self._fields.0.unwrap(), + g: self._fields.1.unwrap(), + r: self._fields.2.unwrap(), extra_data: Some(extra_data), } } @@ -361,6 +524,52 @@ fn lexicon_doc_app_bsky_embed_external() -> LexiconDoc<'static> { id: CowStr::new_static("app.bsky.embed.external"), defs: { let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("colorRGB"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "RGB color definition, inspired by site.standard.theme.color#rgb", + ), + ), + required: Some( + vec![ + SmolStr::new_static("r"), SmolStr::new_static("g"), + SmolStr::new_static("b") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("b"), + LexObjectProperty::Integer(LexInteger { + minimum: Some(0i64), + maximum: Some(255i64), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("g"), + LexObjectProperty::Integer(LexInteger { + minimum: Some(0i64), + maximum: Some(255i64), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("r"), + LexObjectProperty::Integer(LexInteger { + minimum: Some(0i64), + maximum: Some(255i64), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); map.insert( SmolStr::new_static("external"), LexUserType::Object(LexObject { @@ -373,6 +582,21 @@ fn lexicon_doc_app_bsky_embed_external() -> LexiconDoc<'static> { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("associatedRefs"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "StrongRefs (uri+cid) of the Atmosphere records that backed this view.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static("com.atproto.repo.strongRef"), + ..Default::default() + }), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("description"), LexObjectProperty::String(LexString { ..Default::default() }), @@ -452,10 +676,77 @@ fn lexicon_doc_app_bsky_embed_external() -> LexiconDoc<'static> { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("associatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles of the owners of the Atmosphere records that backed this view.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "app.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("associatedRefs"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "StrongRefs (uri+cid) of the Atmosphere records that backed this view.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static("com.atproto.repo.strongRef"), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("createdAt"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "When the external content was created, if available. Example: a publication date, for an article.", + ), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("description"), LexObjectProperty::String(LexString { ..Default::default() }), ); + map.insert( + SmolStr::new_static("labels"), + LexObjectProperty::Array(LexArray { + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static("com.atproto.label.defs#label"), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("readingTime"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("source"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#viewExternalSource"), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("thumb"), LexObjectProperty::String(LexString { @@ -467,6 +758,18 @@ fn lexicon_doc_app_bsky_embed_external() -> LexiconDoc<'static> { SmolStr::new_static("title"), LexObjectProperty::String(LexString { ..Default::default() }), ); + map.insert( + SmolStr::new_static("updatedAt"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "When the external content was updated, if available.", + ), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("uri"), LexObjectProperty::String(LexString { @@ -479,17 +782,325 @@ fn lexicon_doc_app_bsky_embed_external() -> LexiconDoc<'static> { ..Default::default() }), ); - map - }, - ..Default::default() - } -} - -pub mod external_record_state { - - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; - #[allow(unused)] - use ::core::marker::PhantomData; + map.insert( + SmolStr::new_static("viewExternalSource"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "The source of an external embed, such as a standard.site publication.", + ), + ), + required: Some( + vec![SmolStr::new_static("uri"), SmolStr::new_static("title")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("description"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("icon"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Fully-qualified URL where an icon representing the source can be fetched. For example, CDN location provided by the App View.", + ), + ), + format: Some(LexStringFormat::Uri), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("theme"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#viewExternalSourceTheme"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("title"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("uri"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "URI of the source, if available. Example: the https:// URL of a site.standard.publication record.", + ), + ), + format: Some(LexStringFormat::Uri), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("viewExternalSourceTheme"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "The theme colors of an external source, such as a site.standard.publication. These colors may be used when rendering an embed from that source.", + ), + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("accentForegroundRGB"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#colorRGB"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("accentRGB"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#colorRGB"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("backgroundRGB"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#colorRGB"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("foregroundRGB"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#colorRGB"), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map + }, + ..Default::default() + } +} + +pub mod external_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Title; + type Uri; + type Description; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Title = Unset; + type Uri = Unset; + type Description = Unset; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData St>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Title = Set; + type Uri = St::Uri; + type Description = St::Description; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Title = St::Title; + type Uri = Set; + type Description = St::Description; + } + ///State transition - sets the `description` field to Set + pub struct SetDescription(PhantomData St>); + impl sealed::Sealed for SetDescription {} + impl State for SetDescription { + type Title = St::Title; + type Uri = St::Uri; + type Description = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `title` field + pub struct title(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `description` field + pub struct description(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct ExternalBuilder { + _state: PhantomData St>, + _fields: ( + Option>>, + Option, + Option>, + Option, + Option>, + ), + _type: PhantomData S>, +} + +impl External { + /// Create a new builder for this type. + pub fn new() -> ExternalBuilder { + ExternalBuilder::new() + } +} + +impl ExternalBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + ExternalBuilder { + _state: PhantomData, + _fields: (None, None, None, None, None), + _type: PhantomData, + } + } +} + +impl ExternalBuilder { + /// Set the `associatedRefs` field (optional) + pub fn associated_refs( + mut self, + value: impl Into>>>, + ) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `associatedRefs` field to an Option value (optional) + pub fn maybe_associated_refs(mut self, value: Option>>) -> Self { + self._fields.0 = value; + self + } +} + +impl ExternalBuilder +where + St: external_state::State, + St::Description: external_state::IsUnset, +{ + /// Set the `description` field (required) + pub fn description( + mut self, + value: impl Into, + ) -> ExternalBuilder> { + self._fields.1 = Option::Some(value.into()); + ExternalBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ExternalBuilder { + /// Set the `thumb` field (optional) + pub fn thumb(mut self, value: impl Into>>) -> Self { + self._fields.2 = value.into(); + self + } + /// Set the `thumb` field to an Option value (optional) + pub fn maybe_thumb(mut self, value: Option>) -> Self { + self._fields.2 = value; + self + } +} + +impl ExternalBuilder +where + St: external_state::State, + St::Title: external_state::IsUnset, +{ + /// Set the `title` field (required) + pub fn title( + mut self, + value: impl Into, + ) -> ExternalBuilder> { + self._fields.3 = Option::Some(value.into()); + ExternalBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ExternalBuilder +where + St: external_state::State, + St::Uri: external_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ExternalBuilder> { + self._fields.4 = Option::Some(value.into()); + ExternalBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ExternalBuilder +where + St: external_state::State, + St::Title: external_state::IsSet, + St::Uri: external_state::IsSet, + St::Description: external_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> External { + External { + associated_refs: self._fields.0, + description: self._fields.1.unwrap(), + thumb: self._fields.2, + title: self._fields.3.unwrap(), + uri: self._fields.4.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data(self, extra_data: BTreeMap>) -> External { + External { + associated_refs: self._fields.0, + description: self._fields.1.unwrap(), + thumb: self._fields.2, + title: self._fields.3.unwrap(), + uri: self._fields.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod external_record_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; mod sealed { pub trait Sealed {} } @@ -692,58 +1303,70 @@ pub mod view_external_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Description; - type Title; type Uri; + type Title; + type Description; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Description = Unset; - type Title = Unset; type Uri = Unset; + type Title = Unset; + type Description = Unset; } - ///State transition - sets the `description` field to Set - pub struct SetDescription(PhantomData St>); - impl sealed::Sealed for SetDescription {} - impl State for SetDescription { - type Description = Set; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type Title = St::Title; - type Uri = St::Uri; + type Description = St::Description; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData St>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { - type Description = St::Description; - type Title = Set; type Uri = St::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + type Title = Set; type Description = St::Description; + } + ///State transition - sets the `description` field to Set + pub struct SetDescription(PhantomData St>); + impl sealed::Sealed for SetDescription {} + impl State for SetDescription { + type Uri = St::Uri; type Title = St::Title; - type Uri = Set; + type Description = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `description` field - pub struct description(()); - ///Marker type for the `title` field - pub struct title(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); + ///Marker type for the `description` field + pub struct description(()); } } /// Builder for constructing an instance of this type. pub struct ViewExternalBuilder { _state: PhantomData St>, - _fields: (Option, Option>, Option, Option>), + _fields: ( + Option>>, + Option>>, + Option, + Option, + Option>>, + Option, + Option>, + Option>, + Option, + Option, + Option>, + ), _type: PhantomData S>, } @@ -759,12 +1382,60 @@ impl ViewExternalBuilder { pub fn new() -> Self { ViewExternalBuilder { _state: PhantomData, - _fields: (None, None, None, None), + _fields: (None, None, None, None, None, None, None, None, None, None, None), _type: PhantomData, } } } +impl ViewExternalBuilder { + /// Set the `associatedProfiles` field (optional) + pub fn associated_profiles( + mut self, + value: impl Into>>>, + ) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `associatedProfiles` field to an Option value (optional) + pub fn maybe_associated_profiles( + mut self, + value: Option>>, + ) -> Self { + self._fields.0 = value; + self + } +} + +impl ViewExternalBuilder { + /// Set the `associatedRefs` field (optional) + pub fn associated_refs( + mut self, + value: impl Into>>>, + ) -> Self { + self._fields.1 = value.into(); + self + } + /// Set the `associatedRefs` field to an Option value (optional) + pub fn maybe_associated_refs(mut self, value: Option>>) -> Self { + self._fields.1 = value; + self + } +} + +impl ViewExternalBuilder { + /// Set the `createdAt` field (optional) + pub fn created_at(mut self, value: impl Into>) -> Self { + self._fields.2 = value.into(); + self + } + /// Set the `createdAt` field to an Option value (optional) + pub fn maybe_created_at(mut self, value: Option) -> Self { + self._fields.2 = value; + self + } +} + impl ViewExternalBuilder where St: view_external_state::State, @@ -775,7 +1446,7 @@ where mut self, value: impl Into, ) -> ViewExternalBuilder> { - self._fields.0 = Option::Some(value.into()); + self._fields.3 = Option::Some(value.into()); ViewExternalBuilder { _state: PhantomData, _fields: self._fields, @@ -784,15 +1455,60 @@ where } } +impl ViewExternalBuilder { + /// Set the `labels` field (optional) + pub fn labels(mut self, value: impl Into>>>) -> Self { + self._fields.4 = value.into(); + self + } + /// Set the `labels` field to an Option value (optional) + pub fn maybe_labels(mut self, value: Option>>) -> Self { + self._fields.4 = value; + self + } +} + +impl ViewExternalBuilder { + /// Set the `readingTime` field (optional) + pub fn reading_time(mut self, value: impl Into>) -> Self { + self._fields.5 = value.into(); + self + } + /// Set the `readingTime` field to an Option value (optional) + pub fn maybe_reading_time(mut self, value: Option) -> Self { + self._fields.5 = value; + self + } +} + +impl ViewExternalBuilder { + /// Set the `source` field (optional) + pub fn source( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.6 = value.into(); + self + } + /// Set the `source` field to an Option value (optional) + pub fn maybe_source( + mut self, + value: Option>, + ) -> Self { + self._fields.6 = value; + self + } +} + impl ViewExternalBuilder { /// Set the `thumb` field (optional) pub fn thumb(mut self, value: impl Into>>) -> Self { - self._fields.1 = value.into(); + self._fields.7 = value.into(); self } /// Set the `thumb` field to an Option value (optional) pub fn maybe_thumb(mut self, value: Option>) -> Self { - self._fields.1 = value; + self._fields.7 = value; self } } @@ -807,7 +1523,7 @@ where mut self, value: impl Into, ) -> ViewExternalBuilder> { - self._fields.2 = Option::Some(value.into()); + self._fields.8 = Option::Some(value.into()); ViewExternalBuilder { _state: PhantomData, _fields: self._fields, @@ -816,6 +1532,19 @@ where } } +impl ViewExternalBuilder { + /// Set the `updatedAt` field (optional) + pub fn updated_at(mut self, value: impl Into>) -> Self { + self._fields.9 = value.into(); + self + } + /// Set the `updatedAt` field to an Option value (optional) + pub fn maybe_updated_at(mut self, value: Option) -> Self { + self._fields.9 = value; + self + } +} + impl ViewExternalBuilder where St: view_external_state::State, @@ -826,7 +1555,7 @@ where mut self, value: impl Into>, ) -> ViewExternalBuilder> { - self._fields.3 = Option::Some(value.into()); + self._fields.10 = Option::Some(value.into()); ViewExternalBuilder { _state: PhantomData, _fields: self._fields, @@ -838,17 +1567,24 @@ where impl ViewExternalBuilder where St: view_external_state::State, - St::Description: view_external_state::IsSet, - St::Title: view_external_state::IsSet, St::Uri: view_external_state::IsSet, + St::Title: view_external_state::IsSet, + St::Description: view_external_state::IsSet, { /// Build the final struct. pub fn build(self) -> ViewExternal { ViewExternal { - description: self._fields.0.unwrap(), - thumb: self._fields.1, - title: self._fields.2.unwrap(), - uri: self._fields.3.unwrap(), + associated_profiles: self._fields.0, + associated_refs: self._fields.1, + created_at: self._fields.2, + description: self._fields.3.unwrap(), + labels: self._fields.4, + reading_time: self._fields.5, + source: self._fields.6, + thumb: self._fields.7, + title: self._fields.8.unwrap(), + updated_at: self._fields.9, + uri: self._fields.10.unwrap(), extra_data: Default::default(), } } @@ -858,10 +1594,208 @@ where extra_data: BTreeMap>, ) -> ViewExternal { ViewExternal { - description: self._fields.0.unwrap(), - thumb: self._fields.1, - title: self._fields.2.unwrap(), - uri: self._fields.3.unwrap(), + associated_profiles: self._fields.0, + associated_refs: self._fields.1, + created_at: self._fields.2, + description: self._fields.3.unwrap(), + labels: self._fields.4, + reading_time: self._fields.5, + source: self._fields.6, + thumb: self._fields.7, + title: self._fields.8.unwrap(), + updated_at: self._fields.9, + uri: self._fields.10.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod view_external_source_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Uri; + type Title; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + type Title = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type Title = St::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData St>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Uri = St::Uri; + type Title = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `title` field + pub struct title(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct ViewExternalSourceBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>, + Option, + Option>, + ), + _type: PhantomData S>, +} + +impl ViewExternalSource { + /// Create a new builder for this type. + pub fn new() -> ViewExternalSourceBuilder { + ViewExternalSourceBuilder::new() + } +} + +impl ViewExternalSourceBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + ViewExternalSourceBuilder { + _state: PhantomData, + _fields: (None, None, None, None, None), + _type: PhantomData, + } + } +} + +impl ViewExternalSourceBuilder { + /// Set the `description` field (optional) + pub fn description(mut self, value: impl Into>) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `description` field to an Option value (optional) + pub fn maybe_description(mut self, value: Option) -> Self { + self._fields.0 = value; + self + } +} + +impl ViewExternalSourceBuilder { + /// Set the `icon` field (optional) + pub fn icon(mut self, value: impl Into>>) -> Self { + self._fields.1 = value.into(); + self + } + /// Set the `icon` field to an Option value (optional) + pub fn maybe_icon(mut self, value: Option>) -> Self { + self._fields.1 = value; + self + } +} + +impl ViewExternalSourceBuilder { + /// Set the `theme` field (optional) + pub fn theme( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.2 = value.into(); + self + } + /// Set the `theme` field to an Option value (optional) + pub fn maybe_theme( + mut self, + value: Option>, + ) -> Self { + self._fields.2 = value; + self + } +} + +impl ViewExternalSourceBuilder +where + St: view_external_source_state::State, + St::Title: view_external_source_state::IsUnset, +{ + /// Set the `title` field (required) + pub fn title( + mut self, + value: impl Into, + ) -> ViewExternalSourceBuilder> { + self._fields.3 = Option::Some(value.into()); + ViewExternalSourceBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ViewExternalSourceBuilder +where + St: view_external_source_state::State, + St::Uri: view_external_source_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> ViewExternalSourceBuilder> { + self._fields.4 = Option::Some(value.into()); + ViewExternalSourceBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ViewExternalSourceBuilder +where + St: view_external_source_state::State, + St::Uri: view_external_source_state::IsSet, + St::Title: view_external_source_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> ViewExternalSource { + ViewExternalSource { + description: self._fields.0, + icon: self._fields.1, + theme: self._fields.2, + title: self._fields.3.unwrap(), + uri: self._fields.4.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> ViewExternalSource { + ViewExternalSource { + description: self._fields.0, + icon: self._fields.1, + theme: self._fields.2, + title: self._fields.3.unwrap(), + uri: self._fields.4.unwrap(), extra_data: Some(extra_data), } } diff --git a/services/types/src/app_bsky/embed/images.rs b/services/types/src/app_bsky/embed/images.rs index 2f337f4..e233b81 100644 --- a/services/types/src/app_bsky/embed/images.rs +++ b/services/types/src/app_bsky/embed/images.rs @@ -35,6 +35,7 @@ pub struct Image { pub alt: S, #[serde(skip_serializing_if = "Option::is_none")] pub aspect_ratio: Option>, + ///The raw image file. May be up to 2 MB, formerly limited to 1 MB. pub image: BlobRef, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, @@ -89,10 +90,10 @@ impl LexiconSchema for Image { let value = &self.image; { let size = value.blob().size; - if size > 1000000usize { + if size > 2000000usize { return Err(ConstraintError::BlobTooLarge { path: ValidationPath::from_field("image"), - max: 1000000usize, + max: 2000000usize, actual: size, }); } @@ -708,50 +709,50 @@ pub mod view_image_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Alt; - type Fullsize; type Thumb; + type Fullsize; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Alt = Unset; - type Fullsize = Unset; type Thumb = Unset; + type Fullsize = Unset; } ///State transition - sets the `alt` field to Set pub struct SetAlt(PhantomData St>); impl sealed::Sealed for SetAlt {} impl State for SetAlt { type Alt = Set; - type Fullsize = St::Fullsize; - type Thumb = St::Thumb; - } - ///State transition - sets the `fullsize` field to Set - pub struct SetFullsize(PhantomData St>); - impl sealed::Sealed for SetFullsize {} - impl State for SetFullsize { - type Alt = St::Alt; - type Fullsize = Set; type Thumb = St::Thumb; + type Fullsize = St::Fullsize; } ///State transition - sets the `thumb` field to Set pub struct SetThumb(PhantomData St>); impl sealed::Sealed for SetThumb {} impl State for SetThumb { type Alt = St::Alt; - type Fullsize = St::Fullsize; type Thumb = Set; + type Fullsize = St::Fullsize; + } + ///State transition - sets the `fullsize` field to Set + pub struct SetFullsize(PhantomData St>); + impl sealed::Sealed for SetFullsize {} + impl State for SetFullsize { + type Alt = St::Alt; + type Thumb = St::Thumb; + type Fullsize = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `alt` field pub struct alt(()); - ///Marker type for the `fullsize` field - pub struct fullsize(()); ///Marker type for the `thumb` field pub struct thumb(()); + ///Marker type for the `fullsize` field + pub struct fullsize(()); } } @@ -859,8 +860,8 @@ impl ViewImageBuilder where St: view_image_state::State, St::Alt: view_image_state::IsSet, - St::Fullsize: view_image_state::IsSet, St::Thumb: view_image_state::IsSet, + St::Fullsize: view_image_state::IsSet, { /// Build the final struct. pub fn build(self) -> ViewImage { diff --git a/services/types/src/app_bsky/embed/record.rs b/services/types/src/app_bsky/embed/record.rs index 914c45e..a265a08 100644 --- a/services/types/src/app_bsky/embed/record.rs +++ b/services/types/src/app_bsky/embed/record.rs @@ -33,6 +33,7 @@ use crate::app_bsky::labeler::LabelerView; use crate::com_atproto::label::Label; use crate::com_atproto::repo::strong_ref::StrongRef; use crate::app_bsky::embed::external; +use crate::app_bsky::embed::gallery; use crate::app_bsky::embed::images; use crate::app_bsky::embed::record; use crate::app_bsky::embed::record_with_media; @@ -144,6 +145,8 @@ pub enum ViewRecordEmbedsItem { ImagesView(Box>), #[serde(rename = "app.bsky.embed.video#view")] VideoView(Box>), + #[serde(rename = "app.bsky.embed.gallery#view")] + GalleryView(Box>), #[serde(rename = "app.bsky.embed.external#view")] ExternalView(Box>), #[serde(rename = "app.bsky.embed.record#view")] @@ -525,6 +528,7 @@ fn lexicon_doc_app_bsky_embed_record() -> LexiconDoc<'static> { refs: vec![ CowStr::new_static("app.bsky.embed.images#view"), CowStr::new_static("app.bsky.embed.video#view"), + CowStr::new_static("app.bsky.embed.gallery#view"), CowStr::new_static("app.bsky.embed.external#view"), CowStr::new_static("app.bsky.embed.record#view"), CowStr::new_static("app.bsky.embed.recordWithMedia#view") @@ -706,51 +710,51 @@ pub mod view_blocked_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Uri; type Author; type Blocked; - type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Uri = Unset; type Author = Unset; type Blocked = Unset; - type Uri = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type Author = St::Author; + type Blocked = St::Blocked; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData St>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { + type Uri = St::Uri; type Author = Set; type Blocked = St::Blocked; - type Uri = St::Uri; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData St>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { - type Author = St::Author; - type Blocked = Set; type Uri = St::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { type Author = St::Author; - type Blocked = St::Blocked; - type Uri = Set; + type Blocked = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `author` field pub struct author(()); ///Marker type for the `blocked` field pub struct blocked(()); - ///Marker type for the `uri` field - pub struct uri(()); } } @@ -839,9 +843,9 @@ where impl ViewBlockedBuilder where St: view_blocked_state::State, + St::Uri: view_blocked_state::IsSet, St::Author: view_blocked_state::IsSet, St::Blocked: view_blocked_state::IsSet, - St::Uri: view_blocked_state::IsSet, { /// Build the final struct. pub fn build(self) -> ViewBlocked { @@ -1144,85 +1148,85 @@ pub mod view_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Author; - type Cid; - type IndexedAt; type Uri; type Value; + type Cid; + type Author; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Author = Unset; - type Cid = Unset; - type IndexedAt = Unset; type Uri = Unset; type Value = Unset; + type Cid = Unset; + type Author = Unset; + type IndexedAt = Unset; } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData St>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { - type Author = Set; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type Value = St::Value; type Cid = St::Cid; + type Author = St::Author; type IndexedAt = St::IndexedAt; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData St>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { type Uri = St::Uri; - type Value = St::Value; + type Value = Set; + type Cid = St::Cid; + type Author = St::Author; + type IndexedAt = St::IndexedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Author = St::Author; + type Uri = St::Uri; + type Value = St::Value; type Cid = Set; + type Author = St::Author; type IndexedAt = St::IndexedAt; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData St>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { type Uri = St::Uri; type Value = St::Value; + type Cid = St::Cid; + type Author = Set; + type IndexedAt = St::IndexedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Author = St::Author; - type Cid = St::Cid; - type IndexedAt = Set; type Uri = St::Uri; type Value = St::Value; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Author = St::Author; type Cid = St::Cid; - type IndexedAt = St::IndexedAt; - type Uri = Set; - type Value = St::Value; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData St>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { type Author = St::Author; - type Cid = St::Cid; - type IndexedAt = St::IndexedAt; - type Uri = St::Uri; - type Value = Set; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `author` field - pub struct author(()); - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -1442,11 +1446,11 @@ where impl ViewRecordBuilder where St: view_record_state::State, - St::Author: view_record_state::IsSet, - St::Cid: view_record_state::IsSet, - St::IndexedAt: view_record_state::IsSet, St::Uri: view_record_state::IsSet, St::Value: view_record_state::IsSet, + St::Cid: view_record_state::IsSet, + St::Author: view_record_state::IsSet, + St::IndexedAt: view_record_state::IsSet, { /// Build the final struct. pub fn build(self) -> ViewRecord { diff --git a/services/types/src/app_bsky/embed/record_with_media.rs b/services/types/src/app_bsky/embed/record_with_media.rs index 626b45d..81fe49d 100644 --- a/services/types/src/app_bsky/embed/record_with_media.rs +++ b/services/types/src/app_bsky/embed/record_with_media.rs @@ -24,10 +24,12 @@ use jacquard_lexicon::schema::LexiconSchema; use jacquard_lexicon::validation::{ConstraintError, ValidationPath}; use serde::{Serialize, Deserialize}; use crate::app_bsky::embed::external::ExternalRecord; +use crate::app_bsky::embed::gallery::Gallery; use crate::app_bsky::embed::images::Images; use crate::app_bsky::embed::record::Record; use crate::app_bsky::embed::video::Video; use crate::app_bsky::embed::external; +use crate::app_bsky::embed::gallery; use crate::app_bsky::embed::images; use crate::app_bsky::embed::record; use crate::app_bsky::embed::video; @@ -50,6 +52,8 @@ pub enum RecordWithMediaMedia { Images(Box>), #[serde(rename = "app.bsky.embed.video")] Video(Box>), + #[serde(rename = "app.bsky.embed.gallery")] + Gallery(Box>), #[serde(rename = "app.bsky.embed.external")] External(Box>), } @@ -73,6 +77,8 @@ pub enum ViewMedia { ImagesView(Box>), #[serde(rename = "app.bsky.embed.video#view")] VideoView(Box>), + #[serde(rename = "app.bsky.embed.gallery#view")] + GalleryView(Box>), #[serde(rename = "app.bsky.embed.external#view")] ExternalView(Box>), } @@ -117,37 +123,37 @@ pub mod record_with_media_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Media; type Record; + type Media; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Media = Unset; type Record = Unset; - } - ///State transition - sets the `media` field to Set - pub struct SetMedia(PhantomData St>); - impl sealed::Sealed for SetMedia {} - impl State for SetMedia { - type Media = Set; - type Record = St::Record; + type Media = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData St>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Media = St::Media; type Record = Set; + type Media = St::Media; + } + ///State transition - sets the `media` field to Set + pub struct SetMedia(PhantomData St>); + impl sealed::Sealed for SetMedia {} + impl State for SetMedia { + type Record = St::Record; + type Media = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `media` field - pub struct media(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); } } @@ -217,8 +223,8 @@ where impl RecordWithMediaBuilder where St: record_with_media_state::State, - St::Media: record_with_media_state::IsSet, St::Record: record_with_media_state::IsSet, + St::Media: record_with_media_state::IsSet, { /// Build the final struct. pub fn build(self) -> RecordWithMedia { @@ -266,6 +272,7 @@ fn lexicon_doc_app_bsky_embed_recordWithMedia() -> LexiconDoc<'static> { refs: vec![ CowStr::new_static("app.bsky.embed.images"), CowStr::new_static("app.bsky.embed.video"), + CowStr::new_static("app.bsky.embed.gallery"), CowStr::new_static("app.bsky.embed.external") ], ..Default::default() @@ -298,6 +305,7 @@ fn lexicon_doc_app_bsky_embed_recordWithMedia() -> LexiconDoc<'static> { refs: vec![ CowStr::new_static("app.bsky.embed.images#view"), CowStr::new_static("app.bsky.embed.video#view"), + CowStr::new_static("app.bsky.embed.gallery#view"), CowStr::new_static("app.bsky.embed.external#view") ], ..Default::default() @@ -331,37 +339,37 @@ pub mod view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Media; type Record; + type Media; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Media = Unset; type Record = Unset; - } - ///State transition - sets the `media` field to Set - pub struct SetMedia(PhantomData St>); - impl sealed::Sealed for SetMedia {} - impl State for SetMedia { - type Media = Set; - type Record = St::Record; + type Media = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData St>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Media = St::Media; type Record = Set; + type Media = St::Media; + } + ///State transition - sets the `media` field to Set + pub struct SetMedia(PhantomData St>); + impl sealed::Sealed for SetMedia {} + impl State for SetMedia { + type Record = St::Record; + type Media = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `media` field - pub struct media(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); } } @@ -431,8 +439,8 @@ where impl ViewBuilder where St: view_state::State, - St::Media: view_state::IsSet, St::Record: view_state::IsSet, + St::Media: view_state::IsSet, { /// Build the final struct. pub fn build(self) -> View { diff --git a/services/types/src/app_bsky/embed/video.rs b/services/types/src/app_bsky/embed/video.rs index 5045ee5..ff4a74c 100644 --- a/services/types/src/app_bsky/embed/video.rs +++ b/services/types/src/app_bsky/embed/video.rs @@ -48,12 +48,94 @@ pub struct Video { pub aspect_ratio: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub captions: Option>>, + ///A hint to the client about how to present the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub presentation: Option>, ///The mp4 video file. May be up to 100mb, formerly limited to 50mb. pub video: BlobRef, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } +/// A hint to the client about how to present the video. + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum VideoPresentation { + Default, + Gif, + Other(S), +} + +impl VideoPresentation { + pub fn as_str(&self) -> &str { + match self { + Self::Default => "default", + Self::Gif => "gif", + Self::Other(s) => s.as_ref(), + } + } + /// Construct from a string-like value, matching known values. + pub fn from_value(s: S) -> Self { + match s.as_ref() { + "default" => Self::Default, + "gif" => Self::Gif, + _ => Self::Other(s), + } + } +} + +impl core::fmt::Display for VideoPresentation { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl AsRef for VideoPresentation { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl Serialize for VideoPresentation { + fn serialize(&self, serializer: Ser) -> Result + where + Ser: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for VideoPresentation { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = S::deserialize(deserializer)?; + Ok(Self::from_value(s)) + } +} + +impl Default for VideoPresentation { + fn default() -> Self { + Self::Other(Default::default()) + } +} + +impl jacquard_common::IntoStatic for VideoPresentation +where + S: BosStr + jacquard_common::IntoStatic, + S::Output: BosStr, +{ + type Output = VideoPresentation; + fn into_static(self) -> Self::Output { + match self { + VideoPresentation::Default => VideoPresentation::Default, + VideoPresentation::Gif => VideoPresentation::Gif, + VideoPresentation::Other(v) => VideoPresentation::Other(v.into_static()), + } + } +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -64,12 +146,94 @@ pub struct View { pub aspect_ratio: Option>, pub cid: Cid, pub playlist: UriValue, + ///A hint to the client about how to present the video. + #[serde(skip_serializing_if = "Option::is_none")] + pub presentation: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub thumbnail: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } +/// A hint to the client about how to present the video. + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ViewPresentation { + Default, + Gif, + Other(S), +} + +impl ViewPresentation { + pub fn as_str(&self) -> &str { + match self { + Self::Default => "default", + Self::Gif => "gif", + Self::Other(s) => s.as_ref(), + } + } + /// Construct from a string-like value, matching known values. + pub fn from_value(s: S) -> Self { + match s.as_ref() { + "default" => Self::Default, + "gif" => Self::Gif, + _ => Self::Other(s), + } + } +} + +impl core::fmt::Display for ViewPresentation { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl AsRef for ViewPresentation { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl Serialize for ViewPresentation { + fn serialize(&self, serializer: Ser) -> Result + where + Ser: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ViewPresentation { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = S::deserialize(deserializer)?; + Ok(Self::from_value(s)) + } +} + +impl Default for ViewPresentation { + fn default() -> Self { + Self::Other(Default::default()) + } +} + +impl jacquard_common::IntoStatic for ViewPresentation +where + S: BosStr + jacquard_common::IntoStatic, + S::Output: BosStr, +{ + type Output = ViewPresentation; + fn into_static(self) -> Self::Output { + match self { + ViewPresentation::Default => ViewPresentation::Default, + ViewPresentation::Gif => ViewPresentation::Gif, + ViewPresentation::Other(v) => ViewPresentation::Other(v.into_static()), + } + } +} + impl LexiconSchema for Caption { fn nsid() -> &'static str { "app.bsky.embed.video" @@ -259,37 +423,37 @@ pub mod caption_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type File; type Lang; + type File; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type File = Unset; type Lang = Unset; - } - ///State transition - sets the `file` field to Set - pub struct SetFile(PhantomData St>); - impl sealed::Sealed for SetFile {} - impl State for SetFile { - type File = Set; - type Lang = St::Lang; + type File = Unset; } ///State transition - sets the `lang` field to Set pub struct SetLang(PhantomData St>); impl sealed::Sealed for SetLang {} impl State for SetLang { - type File = St::File; type Lang = Set; + type File = St::File; + } + ///State transition - sets the `file` field to Set + pub struct SetFile(PhantomData St>); + impl sealed::Sealed for SetFile {} + impl State for SetFile { + type Lang = St::Lang; + type File = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `file` field - pub struct file(()); ///Marker type for the `lang` field pub struct lang(()); + ///Marker type for the `file` field + pub struct file(()); } } @@ -359,8 +523,8 @@ where impl CaptionBuilder where St: caption_state::State, - St::File: caption_state::IsSet, St::Lang: caption_state::IsSet, + St::File: caption_state::IsSet, { /// Build the final struct. pub fn build(self) -> Caption { @@ -455,6 +619,17 @@ fn lexicon_doc_app_bsky_embed_video() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("presentation"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "A hint to the client about how to present the video.", + ), + ), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("video"), LexObjectProperty::Blob(LexBlob { ..Default::default() }), @@ -504,6 +679,17 @@ fn lexicon_doc_app_bsky_embed_video() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("presentation"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "A hint to the client about how to present the video.", + ), + ), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("thumbnail"), LexObjectProperty::String(LexString { @@ -561,6 +747,7 @@ pub struct VideoBuilder { Option, Option>, Option>>, + Option>, Option>, ), _type: PhantomData S>, @@ -578,7 +765,7 @@ impl VideoBuilder { pub fn new() -> Self { VideoBuilder { _state: PhantomData, - _fields: (None, None, None, None), + _fields: (None, None, None, None, None), _type: PhantomData, } } @@ -623,6 +810,22 @@ impl VideoBuilder { } } +impl VideoBuilder { + /// Set the `presentation` field (optional) + pub fn presentation( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `presentation` field to an Option value (optional) + pub fn maybe_presentation(mut self, value: Option>) -> Self { + self._fields.3 = value; + self + } +} + impl VideoBuilder where St: video_state::State, @@ -633,7 +836,7 @@ where mut self, value: impl Into>, ) -> VideoBuilder> { - self._fields.3 = Option::Some(value.into()); + self._fields.4 = Option::Some(value.into()); VideoBuilder { _state: PhantomData, _fields: self._fields, @@ -653,7 +856,8 @@ where alt: self._fields.0, aspect_ratio: self._fields.1, captions: self._fields.2, - video: self._fields.3.unwrap(), + presentation: self._fields.3, + video: self._fields.4.unwrap(), extra_data: Default::default(), } } @@ -663,7 +867,8 @@ where alt: self._fields.0, aspect_ratio: self._fields.1, captions: self._fields.2, - video: self._fields.3.unwrap(), + presentation: self._fields.3, + video: self._fields.4.unwrap(), extra_data: Some(extra_data), } } @@ -721,6 +926,7 @@ pub struct ViewBuilder { Option>, Option>, Option>, + Option>, Option>, ), _type: PhantomData S>, @@ -738,7 +944,7 @@ impl ViewBuilder { pub fn new() -> Self { ViewBuilder { _state: PhantomData, - _fields: (None, None, None, None, None), + _fields: (None, None, None, None, None, None), _type: PhantomData, } } @@ -808,15 +1014,31 @@ where } } +impl ViewBuilder { + /// Set the `presentation` field (optional) + pub fn presentation( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.4 = value.into(); + self + } + /// Set the `presentation` field to an Option value (optional) + pub fn maybe_presentation(mut self, value: Option>) -> Self { + self._fields.4 = value; + self + } +} + impl ViewBuilder { /// Set the `thumbnail` field (optional) pub fn thumbnail(mut self, value: impl Into>>) -> Self { - self._fields.4 = value.into(); + self._fields.5 = value.into(); self } /// Set the `thumbnail` field to an Option value (optional) pub fn maybe_thumbnail(mut self, value: Option>) -> Self { - self._fields.4 = value; + self._fields.5 = value; self } } @@ -834,7 +1056,8 @@ where aspect_ratio: self._fields.1, cid: self._fields.2.unwrap(), playlist: self._fields.3.unwrap(), - thumbnail: self._fields.4, + presentation: self._fields.4, + thumbnail: self._fields.5, extra_data: Default::default(), } } @@ -845,7 +1068,8 @@ where aspect_ratio: self._fields.1, cid: self._fields.2.unwrap(), playlist: self._fields.3.unwrap(), - thumbnail: self._fields.4, + presentation: self._fields.4, + thumbnail: self._fields.5, extra_data: Some(extra_data), } } diff --git a/services/types/src/app_bsky/feed.rs b/services/types/src/app_bsky/feed.rs index bc33881..99ef049 100644 --- a/services/types/src/app_bsky/feed.rs +++ b/services/types/src/app_bsky/feed.rs @@ -27,6 +27,7 @@ pub mod post; pub mod postgate; pub mod repost; pub mod search_posts; +pub mod search_posts_v2; pub mod send_interactions; pub mod threadgate; @@ -57,6 +58,7 @@ use crate::app_bsky::richtext::facet::Facet; use crate::com_atproto::label::Label; use crate::app_bsky::actor; use crate::app_bsky::embed::external; +use crate::app_bsky::embed::gallery; use crate::app_bsky::embed::images; use crate::app_bsky::embed::record; use crate::app_bsky::embed::record_with_media; @@ -512,7 +514,12 @@ pub struct NotFoundPost { #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct PostView { pub author: ProfileViewBasic, + #[serde(skip_serializing_if = "Option::is_none")] + pub bookmark_count: Option, pub cid: Cid, + ///Debug information for internal development + #[serde(skip_serializing_if = "Option::is_none")] + pub debug: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub embed: Option>, pub indexed_at: Datetime, @@ -545,6 +552,8 @@ pub enum PostViewEmbed { ImagesView(Box>), #[serde(rename = "app.bsky.embed.video#view")] VideoView(Box>), + #[serde(rename = "app.bsky.embed.gallery#view")] + GalleryView(Box>), #[serde(rename = "app.bsky.embed.external#view")] ExternalView(Box>), #[serde(rename = "app.bsky.embed.record#view")] @@ -749,6 +758,8 @@ pub struct ThreadgateView { #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct ViewerState { + #[serde(skip_serializing_if = "Option::is_none")] + pub bookmarked: Option, #[serde(skip_serializing_if = "Option::is_none")] pub embedding_disabled: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -1646,6 +1657,12 @@ fn lexicon_doc_app_bsky_feed_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("bookmarkCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); map.insert( SmolStr::new_static("cid"), LexObjectProperty::String(LexString { @@ -1653,12 +1670,19 @@ fn lexicon_doc_app_bsky_feed_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("debug"), + LexObjectProperty::Unknown(LexUnknown { + ..Default::default() + }), + ); map.insert( SmolStr::new_static("embed"), LexObjectProperty::Union(LexRefUnion { refs: vec![ CowStr::new_static("app.bsky.embed.images#view"), CowStr::new_static("app.bsky.embed.video#view"), + CowStr::new_static("app.bsky.embed.gallery#view"), CowStr::new_static("app.bsky.embed.external#view"), CowStr::new_static("app.bsky.embed.record#view"), CowStr::new_static("app.bsky.embed.recordWithMedia#view") @@ -2046,6 +2070,12 @@ fn lexicon_doc_app_bsky_feed_defs() -> LexiconDoc<'static> { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("bookmarked"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); map.insert( SmolStr::new_static("embeddingDisabled"), LexObjectProperty::Boolean(LexBoolean { @@ -2105,51 +2135,51 @@ pub mod blocked_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Author; - type Blocked; type Uri; + type Blocked; + type Author; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Author = Unset; - type Blocked = Unset; type Uri = Unset; + type Blocked = Unset; + type Author = Unset; } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData St>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { - type Author = Set; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type Blocked = St::Blocked; - type Uri = St::Uri; + type Author = St::Author; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData St>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { - type Author = St::Author; - type Blocked = Set; type Uri = St::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + type Blocked = Set; type Author = St::Author; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData St>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type Uri = St::Uri; type Blocked = St::Blocked; - type Uri = Set; + type Author = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `author` field - pub struct author(()); - ///Marker type for the `blocked` field - pub struct blocked(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `blocked` field + pub struct blocked(()); + ///Marker type for the `author` field + pub struct author(()); } } @@ -2238,9 +2268,9 @@ where impl BlockedPostBuilder where St: blocked_post_state::State, - St::Author: blocked_post_state::IsSet, - St::Blocked: blocked_post_state::IsSet, St::Uri: blocked_post_state::IsSet, + St::Blocked: blocked_post_state::IsSet, + St::Author: blocked_post_state::IsSet, { /// Build the final struct. pub fn build(self) -> BlockedPost { @@ -2441,105 +2471,105 @@ pub mod generator_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Creator; + type Uri; + type Cid; + type IndexedAt; type Did; type DisplayName; - type IndexedAt; - type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Creator = Unset; + type Uri = Unset; + type Cid = Unset; + type IndexedAt = Unset; type Did = Unset; type DisplayName = Unset; - type IndexedAt = Unset; - type Uri = Unset; + } + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData St>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Creator = Set; + type Uri = St::Uri; + type Cid = St::Cid; + type IndexedAt = St::IndexedAt; + type Did = St::Did; + type DisplayName = St::DisplayName; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Creator = St::Creator; + type Uri = Set; + type Cid = St::Cid; + type IndexedAt = St::IndexedAt; + type Did = St::Did; + type DisplayName = St::DisplayName; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Cid = Set; type Creator = St::Creator; + type Uri = St::Uri; + type Cid = Set; + type IndexedAt = St::IndexedAt; type Did = St::Did; type DisplayName = St::DisplayName; - type IndexedAt = St::IndexedAt; - type Uri = St::Uri; } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData St>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData St>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Creator = St::Creator; + type Uri = St::Uri; type Cid = St::Cid; - type Creator = Set; + type IndexedAt = Set; type Did = St::Did; type DisplayName = St::DisplayName; - type IndexedAt = St::IndexedAt; - type Uri = St::Uri; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Cid = St::Cid; type Creator = St::Creator; + type Uri = St::Uri; + type Cid = St::Cid; + type IndexedAt = St::IndexedAt; type Did = Set; type DisplayName = St::DisplayName; - type IndexedAt = St::IndexedAt; - type Uri = St::Uri; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData St>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Cid = St::Cid; type Creator = St::Creator; - type Did = St::Did; - type DisplayName = Set; - type IndexedAt = St::IndexedAt; type Uri = St::Uri; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData St>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { type Cid = St::Cid; - type Creator = St::Creator; - type Did = St::Did; - type DisplayName = St::DisplayName; - type IndexedAt = Set; - type Uri = St::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Cid = St::Cid; - type Creator = St::Creator; - type Did = St::Did; - type DisplayName = St::DisplayName; type IndexedAt = St::IndexedAt; - type Uri = Set; + type Did = St::Did; + type DisplayName = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `creator` field pub struct creator(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); - ///Marker type for the `uri` field - pub struct uri(()); } } @@ -2831,12 +2861,12 @@ impl GeneratorViewBuilder { impl GeneratorViewBuilder where St: generator_view_state::State, - St::Cid: generator_view_state::IsSet, St::Creator: generator_view_state::IsSet, + St::Uri: generator_view_state::IsSet, + St::Cid: generator_view_state::IsSet, + St::IndexedAt: generator_view_state::IsSet, St::Did: generator_view_state::IsSet, St::DisplayName: generator_view_state::IsSet, - St::IndexedAt: generator_view_state::IsSet, - St::Uri: generator_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> GeneratorView { @@ -3028,84 +3058,84 @@ pub mod post_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Author; - type Cid; - type IndexedAt; type Record; + type IndexedAt; type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Author = Unset; - type Cid = Unset; - type IndexedAt = Unset; type Record = Unset; + type IndexedAt = Unset; type Uri = Unset; + type Cid = Unset; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData St>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { type Author = Set; - type Cid = St::Cid; - type IndexedAt = St::IndexedAt; type Record = St::Record; + type IndexedAt = St::IndexedAt; type Uri = St::Uri; + type Cid = St::Cid; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData St>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { type Author = St::Author; - type Cid = Set; + type Record = Set; type IndexedAt = St::IndexedAt; - type Record = St::Record; type Uri = St::Uri; + type Cid = St::Cid; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Author = St::Author; - type Cid = St::Cid; - type IndexedAt = Set; type Record = St::Record; + type IndexedAt = Set; type Uri = St::Uri; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData St>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Author = St::Author; type Cid = St::Cid; - type IndexedAt = St::IndexedAt; - type Record = Set; - type Uri = St::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Author = St::Author; - type Cid = St::Cid; - type IndexedAt = St::IndexedAt; type Record = St::Record; + type IndexedAt = St::IndexedAt; type Uri = Set; + type Cid = St::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Author = St::Author; + type Record = St::Record; + type IndexedAt = St::IndexedAt; + type Uri = St::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `author` field pub struct author(()); - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -3114,7 +3144,9 @@ pub struct PostViewBuilder { _state: PhantomData St>, _fields: ( Option>, + Option, Option>, + Option>, Option>, Option, Option>>, @@ -3156,6 +3188,8 @@ impl PostViewBuilder { None, None, None, + None, + None, ), _type: PhantomData, } @@ -3181,6 +3215,19 @@ where } } +impl PostViewBuilder { + /// Set the `bookmarkCount` field (optional) + pub fn bookmark_count(mut self, value: impl Into>) -> Self { + self._fields.1 = value.into(); + self + } + /// Set the `bookmarkCount` field to an Option value (optional) + pub fn maybe_bookmark_count(mut self, value: Option) -> Self { + self._fields.1 = value; + self + } +} + impl PostViewBuilder where St: post_view_state::State, @@ -3191,7 +3238,7 @@ where mut self, value: impl Into>, ) -> PostViewBuilder> { - self._fields.1 = Option::Some(value.into()); + self._fields.2 = Option::Some(value.into()); PostViewBuilder { _state: PhantomData, _fields: self._fields, @@ -3200,15 +3247,28 @@ where } } +impl PostViewBuilder { + /// Set the `debug` field (optional) + pub fn debug(mut self, value: impl Into>>) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `debug` field to an Option value (optional) + pub fn maybe_debug(mut self, value: Option>) -> Self { + self._fields.3 = value; + self + } +} + impl PostViewBuilder { /// Set the `embed` field (optional) pub fn embed(mut self, value: impl Into>>) -> Self { - self._fields.2 = value.into(); + self._fields.4 = value.into(); self } /// Set the `embed` field to an Option value (optional) pub fn maybe_embed(mut self, value: Option>) -> Self { - self._fields.2 = value; + self._fields.4 = value; self } } @@ -3223,7 +3283,7 @@ where mut self, value: impl Into, ) -> PostViewBuilder> { - self._fields.3 = Option::Some(value.into()); + self._fields.5 = Option::Some(value.into()); PostViewBuilder { _state: PhantomData, _fields: self._fields, @@ -3235,12 +3295,12 @@ where impl PostViewBuilder { /// Set the `labels` field (optional) pub fn labels(mut self, value: impl Into>>>) -> Self { - self._fields.4 = value.into(); + self._fields.6 = value.into(); self } /// Set the `labels` field to an Option value (optional) pub fn maybe_labels(mut self, value: Option>>) -> Self { - self._fields.4 = value; + self._fields.6 = value; self } } @@ -3248,12 +3308,12 @@ impl PostViewBuilder { impl PostViewBuilder { /// Set the `likeCount` field (optional) pub fn like_count(mut self, value: impl Into>) -> Self { - self._fields.5 = value.into(); + self._fields.7 = value.into(); self } /// Set the `likeCount` field to an Option value (optional) pub fn maybe_like_count(mut self, value: Option) -> Self { - self._fields.5 = value; + self._fields.7 = value; self } } @@ -3261,12 +3321,12 @@ impl PostViewBuilder { impl PostViewBuilder { /// Set the `quoteCount` field (optional) pub fn quote_count(mut self, value: impl Into>) -> Self { - self._fields.6 = value.into(); + self._fields.8 = value.into(); self } /// Set the `quoteCount` field to an Option value (optional) pub fn maybe_quote_count(mut self, value: Option) -> Self { - self._fields.6 = value; + self._fields.8 = value; self } } @@ -3281,7 +3341,7 @@ where mut self, value: impl Into>, ) -> PostViewBuilder> { - self._fields.7 = Option::Some(value.into()); + self._fields.9 = Option::Some(value.into()); PostViewBuilder { _state: PhantomData, _fields: self._fields, @@ -3293,12 +3353,12 @@ where impl PostViewBuilder { /// Set the `replyCount` field (optional) pub fn reply_count(mut self, value: impl Into>) -> Self { - self._fields.8 = value.into(); + self._fields.10 = value.into(); self } /// Set the `replyCount` field to an Option value (optional) pub fn maybe_reply_count(mut self, value: Option) -> Self { - self._fields.8 = value; + self._fields.10 = value; self } } @@ -3306,12 +3366,12 @@ impl PostViewBuilder { impl PostViewBuilder { /// Set the `repostCount` field (optional) pub fn repost_count(mut self, value: impl Into>) -> Self { - self._fields.9 = value.into(); + self._fields.11 = value.into(); self } /// Set the `repostCount` field to an Option value (optional) pub fn maybe_repost_count(mut self, value: Option) -> Self { - self._fields.9 = value; + self._fields.11 = value; self } } @@ -3322,12 +3382,12 @@ impl PostViewBuilder { mut self, value: impl Into>>, ) -> Self { - self._fields.10 = value.into(); + self._fields.12 = value.into(); self } /// Set the `threadgate` field to an Option value (optional) pub fn maybe_threadgate(mut self, value: Option>) -> Self { - self._fields.10 = value; + self._fields.12 = value; self } } @@ -3342,7 +3402,7 @@ where mut self, value: impl Into>, ) -> PostViewBuilder> { - self._fields.11 = Option::Some(value.into()); + self._fields.13 = Option::Some(value.into()); PostViewBuilder { _state: PhantomData, _fields: self._fields, @@ -3354,12 +3414,12 @@ where impl PostViewBuilder { /// Set the `viewer` field (optional) pub fn viewer(mut self, value: impl Into>>) -> Self { - self._fields.12 = value.into(); + self._fields.14 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer(mut self, value: Option>) -> Self { - self._fields.12 = value; + self._fields.14 = value; self } } @@ -3368,27 +3428,29 @@ impl PostViewBuilder where St: post_view_state::State, St::Author: post_view_state::IsSet, - St::Cid: post_view_state::IsSet, - St::IndexedAt: post_view_state::IsSet, St::Record: post_view_state::IsSet, + St::IndexedAt: post_view_state::IsSet, St::Uri: post_view_state::IsSet, + St::Cid: post_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> PostView { PostView { author: self._fields.0.unwrap(), - cid: self._fields.1.unwrap(), - embed: self._fields.2, - indexed_at: self._fields.3.unwrap(), - labels: self._fields.4, - like_count: self._fields.5, - quote_count: self._fields.6, - record: self._fields.7.unwrap(), - reply_count: self._fields.8, - repost_count: self._fields.9, - threadgate: self._fields.10, - uri: self._fields.11.unwrap(), - viewer: self._fields.12, + bookmark_count: self._fields.1, + cid: self._fields.2.unwrap(), + debug: self._fields.3, + embed: self._fields.4, + indexed_at: self._fields.5.unwrap(), + labels: self._fields.6, + like_count: self._fields.7, + quote_count: self._fields.8, + record: self._fields.9.unwrap(), + reply_count: self._fields.10, + repost_count: self._fields.11, + threadgate: self._fields.12, + uri: self._fields.13.unwrap(), + viewer: self._fields.14, extra_data: Default::default(), } } @@ -3396,18 +3458,20 @@ where pub fn build_with_data(self, extra_data: BTreeMap>) -> PostView { PostView { author: self._fields.0.unwrap(), - cid: self._fields.1.unwrap(), - embed: self._fields.2, - indexed_at: self._fields.3.unwrap(), - labels: self._fields.4, - like_count: self._fields.5, - quote_count: self._fields.6, - record: self._fields.7.unwrap(), - reply_count: self._fields.8, - repost_count: self._fields.9, - threadgate: self._fields.10, - uri: self._fields.11.unwrap(), - viewer: self._fields.12, + bookmark_count: self._fields.1, + cid: self._fields.2.unwrap(), + debug: self._fields.3, + embed: self._fields.4, + indexed_at: self._fields.5.unwrap(), + labels: self._fields.6, + like_count: self._fields.7, + quote_count: self._fields.8, + record: self._fields.9.unwrap(), + reply_count: self._fields.10, + repost_count: self._fields.11, + threadgate: self._fields.12, + uri: self._fields.13.unwrap(), + viewer: self._fields.14, extra_data: Some(extra_data), } } @@ -3423,37 +3487,37 @@ pub mod reason_repost_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type By; type IndexedAt; + type By; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type By = Unset; type IndexedAt = Unset; - } - ///State transition - sets the `by` field to Set - pub struct SetBy(PhantomData St>); - impl sealed::Sealed for SetBy {} - impl State for SetBy { - type By = Set; - type IndexedAt = St::IndexedAt; + type By = Unset; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type By = St::By; type IndexedAt = Set; + type By = St::By; + } + ///State transition - sets the `by` field to Set + pub struct SetBy(PhantomData St>); + impl sealed::Sealed for SetBy {} + impl State for SetBy { + type IndexedAt = St::IndexedAt; + type By = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `by` field - pub struct by(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `by` field + pub struct by(()); } } @@ -3554,8 +3618,8 @@ impl ReasonRepostBuilder { impl ReasonRepostBuilder where St: reason_repost_state::State, - St::By: reason_repost_state::IsSet, St::IndexedAt: reason_repost_state::IsSet, + St::By: reason_repost_state::IsSet, { /// Build the final struct. pub fn build(self) -> ReasonRepost { @@ -3592,37 +3656,37 @@ pub mod reply_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Parent; type Root; + type Parent; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Parent = Unset; type Root = Unset; - } - ///State transition - sets the `parent` field to Set - pub struct SetParent(PhantomData St>); - impl sealed::Sealed for SetParent {} - impl State for SetParent { - type Parent = Set; - type Root = St::Root; + type Parent = Unset; } ///State transition - sets the `root` field to Set pub struct SetRoot(PhantomData St>); impl sealed::Sealed for SetRoot {} impl State for SetRoot { - type Parent = St::Parent; type Root = Set; + type Parent = St::Parent; + } + ///State transition - sets the `parent` field to Set + pub struct SetParent(PhantomData St>); + impl sealed::Sealed for SetParent {} + impl State for SetParent { + type Root = St::Root; + type Parent = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `parent` field - pub struct parent(()); ///Marker type for the `root` field pub struct root(()); + ///Marker type for the `parent` field + pub struct parent(()); } } @@ -3715,8 +3779,8 @@ where impl ReplyRefBuilder where St: reply_ref_state::State, - St::Parent: reply_ref_state::IsSet, St::Root: reply_ref_state::IsSet, + St::Parent: reply_ref_state::IsSet, { /// Build the final struct. pub fn build(self) -> ReplyRef { diff --git a/services/types/src/app_bsky/feed/generator.rs b/services/types/src/app_bsky/feed/generator.rs index 31d1adb..b1328b3 100644 --- a/services/types/src/app_bsky/feed/generator.rs +++ b/services/types/src/app_bsky/feed/generator.rs @@ -300,51 +300,51 @@ pub mod generator_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Did; type DisplayName; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Did = Unset; type DisplayName = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Did = St::Did; - type DisplayName = St::DisplayName; + type CreatedAt = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type CreatedAt = St::CreatedAt; type Did = Set; type DisplayName = St::DisplayName; + type CreatedAt = St::CreatedAt; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData St>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type CreatedAt = St::CreatedAt; type Did = St::Did; type DisplayName = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Did = St::Did; + type DisplayName = St::DisplayName; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `display_name` field pub struct display_name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -527,9 +527,9 @@ impl GeneratorBuilder { impl GeneratorBuilder where St: generator_state::State, - St::CreatedAt: generator_state::IsSet, St::Did: generator_state::IsSet, St::DisplayName: generator_state::IsSet, + St::CreatedAt: generator_state::IsSet, { /// Build the final struct. pub fn build(self) -> Generator { diff --git a/services/types/src/app_bsky/feed/get_likes.rs b/services/types/src/app_bsky/feed/get_likes.rs index 0829b91..95471c8 100644 --- a/services/types/src/app_bsky/feed/get_likes.rs +++ b/services/types/src/app_bsky/feed/get_likes.rs @@ -116,50 +116,50 @@ pub mod like_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Actor; - type CreatedAt; type IndexedAt; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Actor = Unset; - type CreatedAt = Unset; type IndexedAt = Unset; + type CreatedAt = Unset; } ///State transition - sets the `actor` field to Set pub struct SetActor(PhantomData St>); impl sealed::Sealed for SetActor {} impl State for SetActor { type Actor = Set; - type CreatedAt = St::CreatedAt; - type IndexedAt = St::IndexedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Actor = St::Actor; - type CreatedAt = Set; type IndexedAt = St::IndexedAt; + type CreatedAt = St::CreatedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Actor = St::Actor; - type CreatedAt = St::CreatedAt; type IndexedAt = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Actor = St::Actor; + type IndexedAt = St::IndexedAt; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `actor` field pub struct actor(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -249,8 +249,8 @@ impl LikeBuilder where St: like_state::State, St::Actor: like_state::IsSet, - St::CreatedAt: like_state::IsSet, St::IndexedAt: like_state::IsSet, + St::CreatedAt: like_state::IsSet, { /// Build the final struct. pub fn build(self) -> Like { diff --git a/services/types/src/app_bsky/feed/like.rs b/services/types/src/app_bsky/feed/like.rs index 2e5dde1..9d03459 100644 --- a/services/types/src/app_bsky/feed/like.rs +++ b/services/types/src/app_bsky/feed/like.rs @@ -115,37 +115,37 @@ pub mod like_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = St::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = St::CreatedAt; type Subject = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = St::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -228,8 +228,8 @@ impl LikeBuilder { impl LikeBuilder where St: like_state::State, - St::CreatedAt: like_state::IsSet, St::Subject: like_state::IsSet, + St::CreatedAt: like_state::IsSet, { /// Build the final struct. pub fn build(self) -> Like { diff --git a/services/types/src/app_bsky/feed/post.rs b/services/types/src/app_bsky/feed/post.rs index 498347c..3be61a9 100644 --- a/services/types/src/app_bsky/feed/post.rs +++ b/services/types/src/app_bsky/feed/post.rs @@ -28,6 +28,7 @@ use jacquard_lexicon::schema::LexiconSchema; use jacquard_lexicon::validation::{ConstraintError, ValidationPath}; use serde::{Serialize, Deserialize}; use crate::app_bsky::embed::external::ExternalRecord; +use crate::app_bsky::embed::gallery::Gallery; use crate::app_bsky::embed::images::Images; use crate::app_bsky::embed::record::Record; use crate::app_bsky::embed::record_with_media::RecordWithMedia; @@ -95,6 +96,8 @@ pub enum PostEmbed { Images(Box>), #[serde(rename = "app.bsky.embed.video")] Video(Box>), + #[serde(rename = "app.bsky.embed.gallery")] + Gallery(Box>), #[serde(rename = "app.bsky.embed.external")] External(Box>), #[serde(rename = "app.bsky.embed.record")] @@ -302,51 +305,51 @@ pub mod entity_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Value; type Index; type Type; - type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Value = Unset; type Index = Unset; type Type = Unset; - type Value = Unset; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData St>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Value = Set; + type Index = St::Index; + type Type = St::Type; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData St>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { + type Value = St::Value; type Index = Set; type Type = St::Type; - type Value = St::Value; } ///State transition - sets the `type` field to Set pub struct SetType(PhantomData St>); impl sealed::Sealed for SetType {} impl State for SetType { - type Index = St::Index; - type Type = Set; type Value = St::Value; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData St>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { type Index = St::Index; - type Type = St::Type; - type Value = Set; + type Type = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `index` field pub struct index(()); ///Marker type for the `type` field pub struct r#type(()); - ///Marker type for the `value` field - pub struct value(()); } } @@ -435,9 +438,9 @@ where impl EntityBuilder where St: entity_state::State, + St::Value: entity_state::IsSet, St::Index: entity_state::IsSet, St::Type: entity_state::IsSet, - St::Value: entity_state::IsSet, { /// Build the final struct. pub fn build(self) -> Entity { @@ -546,6 +549,7 @@ fn lexicon_doc_app_bsky_feed_post() -> LexiconDoc<'static> { refs: vec![ CowStr::new_static("app.bsky.embed.images"), CowStr::new_static("app.bsky.embed.video"), + CowStr::new_static("app.bsky.embed.gallery"), CowStr::new_static("app.bsky.embed.external"), CowStr::new_static("app.bsky.embed.record"), CowStr::new_static("app.bsky.embed.recordWithMedia") @@ -734,37 +738,37 @@ pub mod post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Text; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Text = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Text = St::Text; + type CreatedAt = Unset; } ///State transition - sets the `text` field to Set pub struct SetText(PhantomData St>); impl sealed::Sealed for SetText {} impl State for SetText { - type CreatedAt = St::CreatedAt; type Text = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Text = St::Text; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `text` field pub struct text(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -935,8 +939,8 @@ where impl PostBuilder where St: post_state::State, - St::CreatedAt: post_state::IsSet, St::Text: post_state::IsSet, + St::CreatedAt: post_state::IsSet, { /// Build the final struct. pub fn build(self) -> Post { diff --git a/services/types/src/app_bsky/feed/repost.rs b/services/types/src/app_bsky/feed/repost.rs index 7811c9d..0d2abe7 100644 --- a/services/types/src/app_bsky/feed/repost.rs +++ b/services/types/src/app_bsky/feed/repost.rs @@ -115,37 +115,37 @@ pub mod repost_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = St::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = St::CreatedAt; type Subject = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = St::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -228,8 +228,8 @@ impl RepostBuilder { impl RepostBuilder where St: repost_state::State, - St::CreatedAt: repost_state::IsSet, St::Subject: repost_state::IsSet, + St::CreatedAt: repost_state::IsSet, { /// Build the final struct. pub fn build(self) -> Repost { diff --git a/services/types/src/app_bsky/feed/send_interactions.rs b/services/types/src/app_bsky/feed/send_interactions.rs index 7dfc213..4a771f4 100644 --- a/services/types/src/app_bsky/feed/send_interactions.rs +++ b/services/types/src/app_bsky/feed/send_interactions.rs @@ -12,6 +12,7 @@ use alloc::collections::BTreeMap; use core::marker::PhantomData; use jacquard_common::{BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; +use jacquard_common::types::string::AtUri; use jacquard_common::types::value::Data; use jacquard_derive::IntoStatic; use serde::{Serialize, Deserialize}; @@ -20,6 +21,8 @@ use crate::app_bsky::feed::Interaction; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct SendInteractions { + #[serde(skip_serializing_if = "Option::is_none")] + pub feed: Option>, pub interactions: Vec>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, @@ -96,7 +99,7 @@ pub mod send_interactions_state { /// Builder for constructing an instance of this type. pub struct SendInteractionsBuilder { _state: PhantomData St>, - _fields: (Option>>,), + _fields: (Option>, Option>>), _type: PhantomData S>, } @@ -112,12 +115,25 @@ impl SendInteractionsBuilder { pub fn new() -> Self { SendInteractionsBuilder { _state: PhantomData, - _fields: (None,), + _fields: (None, None), _type: PhantomData, } } } +impl SendInteractionsBuilder { + /// Set the `feed` field (optional) + pub fn feed(mut self, value: impl Into>>) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `feed` field to an Option value (optional) + pub fn maybe_feed(mut self, value: Option>) -> Self { + self._fields.0 = value; + self + } +} + impl SendInteractionsBuilder where St: send_interactions_state::State, @@ -128,7 +144,7 @@ where mut self, value: impl Into>>, ) -> SendInteractionsBuilder> { - self._fields.0 = Option::Some(value.into()); + self._fields.1 = Option::Some(value.into()); SendInteractionsBuilder { _state: PhantomData, _fields: self._fields, @@ -145,7 +161,8 @@ where /// Build the final struct. pub fn build(self) -> SendInteractions { SendInteractions { - interactions: self._fields.0.unwrap(), + feed: self._fields.0, + interactions: self._fields.1.unwrap(), extra_data: Default::default(), } } @@ -155,7 +172,8 @@ where extra_data: BTreeMap>, ) -> SendInteractions { SendInteractions { - interactions: self._fields.0.unwrap(), + feed: self._fields.0, + interactions: self._fields.1.unwrap(), extra_data: Some(extra_data), } } diff --git a/services/types/src/app_bsky/feed/threadgate.rs b/services/types/src/app_bsky/feed/threadgate.rs index d2f33fb..618236d 100644 --- a/services/types/src/app_bsky/feed/threadgate.rs +++ b/services/types/src/app_bsky/feed/threadgate.rs @@ -215,10 +215,10 @@ impl LexiconSchema for Threadgate { } if let Some(ref value) = self.hidden_replies { #[allow(unused_comparisons)] - if value.len() > 50usize { + if value.len() > 300usize { return Err(ConstraintError::MaxLength { path: ValidationPath::from_field("hidden_replies"), - max: 50usize, + max: 300usize, actual: value.len(), }); } @@ -359,7 +359,7 @@ fn lexicon_doc_app_bsky_feed_threadgate() -> LexiconDoc<'static> { format: Some(LexStringFormat::AtUri), ..Default::default() }), - max_length: Some(50usize), + max_length: Some(300usize), ..Default::default() }), ); diff --git a/services/types/src/app_bsky/graph.rs b/services/types/src/app_bsky/graph.rs index b083c0e..5dd3c65 100644 --- a/services/types/src/app_bsky/graph.rs +++ b/services/types/src/app_bsky/graph.rs @@ -16,10 +16,12 @@ pub mod get_list; pub mod get_list_blocks; pub mod get_list_mutes; pub mod get_lists; +pub mod get_lists_with_membership; pub mod get_mutes; pub mod get_relationships; pub mod get_starter_pack; pub mod get_starter_packs; +pub mod get_starter_packs_with_membership; pub mod get_suggested_follows_by_actor; pub mod list; pub mod listblock; @@ -257,6 +259,18 @@ impl core::fmt::Display for Referencelist { #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct Relationship { + ///if the actor is blocked by this DID, contains the AT-URI of the block record + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked_by: Option>, + ///if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record + #[serde(skip_serializing_if = "Option::is_none")] + pub blocked_by_list: Option>, + ///if the actor blocks this DID, this is the AT-URI of the block record + #[serde(skip_serializing_if = "Option::is_none")] + pub blocking: Option>, + ///if the actor blocks this DID via a block list, this is the AT-URI of the listblock record + #[serde(skip_serializing_if = "Option::is_none")] + pub blocking_by_list: Option>, pub did: Did, ///if the actor is followed by this DID, contains the AT-URI of the follow record #[serde(skip_serializing_if = "Option::is_none")] @@ -593,37 +607,37 @@ pub mod list_item_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type Uri; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type Uri = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData St>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type Uri = St::Uri; + type Subject = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Subject = St::Subject; type Uri = Set; + type Subject = St::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData St>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Uri = St::Uri; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -693,8 +707,8 @@ where impl ListItemViewBuilder where St: list_item_view_state::State, - St::Subject: list_item_view_state::IsSet, St::Uri: list_item_view_state::IsSet, + St::Subject: list_item_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> ListItemView { @@ -1040,6 +1054,54 @@ fn lexicon_doc_app_bsky_graph_defs() -> LexiconDoc<'static> { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("blockedBy"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "if the actor is blocked by this DID, contains the AT-URI of the block record", + ), + ), + format: Some(LexStringFormat::AtUri), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("blockedByList"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "if the actor is blocked by this DID via a block list, contains the AT-URI of the listblock record", + ), + ), + format: Some(LexStringFormat::AtUri), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("blocking"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "if the actor blocks this DID, this is the AT-URI of the block record", + ), + ), + format: Some(LexStringFormat::AtUri), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("blockingByList"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "if the actor blocks this DID via a block list, this is the AT-URI of the listblock record", + ), + ), + format: Some(LexStringFormat::AtUri), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("did"), LexObjectProperty::String(LexString { @@ -1288,105 +1350,105 @@ pub mod list_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Uri; + type Purpose; type Cid; - type Creator; - type IndexedAt; type Name; - type Purpose; - type Uri; + type IndexedAt; + type Creator; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Uri = Unset; + type Purpose = Unset; type Cid = Unset; - type Creator = Unset; - type IndexedAt = Unset; type Name = Unset; - type Purpose = Unset; - type Uri = Unset; + type IndexedAt = Unset; + type Creator = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type Purpose = St::Purpose; + type Cid = St::Cid; + type Name = St::Name; + type IndexedAt = St::IndexedAt; + type Creator = St::Creator; + } + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData St>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Uri = St::Uri; + type Purpose = Set; + type Cid = St::Cid; + type Name = St::Name; + type IndexedAt = St::IndexedAt; + type Creator = St::Creator; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { + type Uri = St::Uri; + type Purpose = St::Purpose; type Cid = Set; - type Creator = St::Creator; - type IndexedAt = St::IndexedAt; type Name = St::Name; - type Purpose = St::Purpose; - type Uri = St::Uri; - } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData St>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { - type Cid = St::Cid; - type Creator = Set; type IndexedAt = St::IndexedAt; - type Name = St::Name; - type Purpose = St::Purpose; - type Uri = St::Uri; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData St>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Cid = St::Cid; type Creator = St::Creator; - type IndexedAt = Set; - type Name = St::Name; - type Purpose = St::Purpose; - type Uri = St::Uri; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { + type Uri = St::Uri; + type Purpose = St::Purpose; type Cid = St::Cid; - type Creator = St::Creator; - type IndexedAt = St::IndexedAt; type Name = Set; - type Purpose = St::Purpose; - type Uri = St::Uri; + type IndexedAt = St::IndexedAt; + type Creator = St::Creator; } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData St>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData St>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Uri = St::Uri; + type Purpose = St::Purpose; type Cid = St::Cid; - type Creator = St::Creator; - type IndexedAt = St::IndexedAt; type Name = St::Name; - type Purpose = Set; - type Uri = St::Uri; + type IndexedAt = Set; + type Creator = St::Creator; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData St>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Uri = St::Uri; + type Purpose = St::Purpose; type Cid = St::Cid; - type Creator = St::Creator; - type IndexedAt = St::IndexedAt; type Name = St::Name; - type Purpose = St::Purpose; - type Uri = Set; + type IndexedAt = St::IndexedAt; + type Creator = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `purpose` field + pub struct purpose(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `creator` field - pub struct creator(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `name` field pub struct name(()); - ///Marker type for the `purpose` field - pub struct purpose(()); - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `creator` field + pub struct creator(()); } } @@ -1642,12 +1704,12 @@ impl ListViewBuilder { impl ListViewBuilder where St: list_view_state::State, + St::Uri: list_view_state::IsSet, + St::Purpose: list_view_state::IsSet, St::Cid: list_view_state::IsSet, - St::Creator: list_view_state::IsSet, - St::IndexedAt: list_view_state::IsSet, St::Name: list_view_state::IsSet, - St::Purpose: list_view_state::IsSet, - St::Uri: list_view_state::IsSet, + St::IndexedAt: list_view_state::IsSet, + St::Creator: list_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> ListView { @@ -1697,67 +1759,67 @@ pub mod list_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Name; - type Purpose; type Uri; + type Purpose; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Name = Unset; - type Purpose = Unset; type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Name = St::Name; - type Purpose = St::Purpose; - type Uri = St::Uri; + type Purpose = Unset; + type Cid = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { - type Cid = St::Cid; type Name = Set; - type Purpose = St::Purpose; type Uri = St::Uri; + type Purpose = St::Purpose; + type Cid = St::Cid; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Name = St::Name; + type Uri = Set; + type Purpose = St::Purpose; + type Cid = St::Cid; } ///State transition - sets the `purpose` field to Set pub struct SetPurpose(PhantomData St>); impl sealed::Sealed for SetPurpose {} impl State for SetPurpose { - type Cid = St::Cid; type Name = St::Name; - type Purpose = Set; type Uri = St::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + type Purpose = Set; type Cid = St::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type Name = St::Name; + type Uri = St::Uri; type Purpose = St::Purpose; - type Uri = Set; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `name` field pub struct name(()); - ///Marker type for the `purpose` field - pub struct purpose(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `purpose` field + pub struct purpose(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -1943,10 +2005,10 @@ impl ListViewBasicBuilder { impl ListViewBasicBuilder where St: list_view_basic_state::State, - St::Cid: list_view_basic_state::IsSet, St::Name: list_view_basic_state::IsSet, - St::Purpose: list_view_basic_state::IsSet, St::Uri: list_view_basic_state::IsSet, + St::Purpose: list_view_basic_state::IsSet, + St::Cid: list_view_basic_state::IsSet, { /// Build the final struct. pub fn build(self) -> ListViewBasic { @@ -2152,7 +2214,15 @@ pub mod relationship_state { /// Builder for constructing an instance of this type. pub struct RelationshipBuilder { _state: PhantomData St>, - _fields: (Option>, Option>, Option>), + _fields: ( + Option>, + Option>, + Option>, + Option>, + Option>, + Option>, + Option>, + ), _type: PhantomData S>, } @@ -2168,12 +2238,64 @@ impl RelationshipBuilder { pub fn new() -> Self { RelationshipBuilder { _state: PhantomData, - _fields: (None, None, None), + _fields: (None, None, None, None, None, None, None), _type: PhantomData, } } } +impl RelationshipBuilder { + /// Set the `blockedBy` field (optional) + pub fn blocked_by(mut self, value: impl Into>>) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `blockedBy` field to an Option value (optional) + pub fn maybe_blocked_by(mut self, value: Option>) -> Self { + self._fields.0 = value; + self + } +} + +impl RelationshipBuilder { + /// Set the `blockedByList` field (optional) + pub fn blocked_by_list(mut self, value: impl Into>>) -> Self { + self._fields.1 = value.into(); + self + } + /// Set the `blockedByList` field to an Option value (optional) + pub fn maybe_blocked_by_list(mut self, value: Option>) -> Self { + self._fields.1 = value; + self + } +} + +impl RelationshipBuilder { + /// Set the `blocking` field (optional) + pub fn blocking(mut self, value: impl Into>>) -> Self { + self._fields.2 = value.into(); + self + } + /// Set the `blocking` field to an Option value (optional) + pub fn maybe_blocking(mut self, value: Option>) -> Self { + self._fields.2 = value; + self + } +} + +impl RelationshipBuilder { + /// Set the `blockingByList` field (optional) + pub fn blocking_by_list(mut self, value: impl Into>>) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `blockingByList` field to an Option value (optional) + pub fn maybe_blocking_by_list(mut self, value: Option>) -> Self { + self._fields.3 = value; + self + } +} + impl RelationshipBuilder where St: relationship_state::State, @@ -2184,7 +2306,7 @@ where mut self, value: impl Into>, ) -> RelationshipBuilder> { - self._fields.0 = Option::Some(value.into()); + self._fields.4 = Option::Some(value.into()); RelationshipBuilder { _state: PhantomData, _fields: self._fields, @@ -2196,12 +2318,12 @@ where impl RelationshipBuilder { /// Set the `followedBy` field (optional) pub fn followed_by(mut self, value: impl Into>>) -> Self { - self._fields.1 = value.into(); + self._fields.5 = value.into(); self } /// Set the `followedBy` field to an Option value (optional) pub fn maybe_followed_by(mut self, value: Option>) -> Self { - self._fields.1 = value; + self._fields.5 = value; self } } @@ -2209,12 +2331,12 @@ impl RelationshipBuilder { impl RelationshipBuilder { /// Set the `following` field (optional) pub fn following(mut self, value: impl Into>>) -> Self { - self._fields.2 = value.into(); + self._fields.6 = value.into(); self } /// Set the `following` field to an Option value (optional) pub fn maybe_following(mut self, value: Option>) -> Self { - self._fields.2 = value; + self._fields.6 = value; self } } @@ -2227,9 +2349,13 @@ where /// Build the final struct. pub fn build(self) -> Relationship { Relationship { - did: self._fields.0.unwrap(), - followed_by: self._fields.1, - following: self._fields.2, + blocked_by: self._fields.0, + blocked_by_list: self._fields.1, + blocking: self._fields.2, + blocking_by_list: self._fields.3, + did: self._fields.4.unwrap(), + followed_by: self._fields.5, + following: self._fields.6, extra_data: Default::default(), } } @@ -2239,9 +2365,13 @@ where extra_data: BTreeMap>, ) -> Relationship { Relationship { - did: self._fields.0.unwrap(), - followed_by: self._fields.1, - following: self._fields.2, + blocked_by: self._fields.0, + blocked_by_list: self._fields.1, + blocking: self._fields.2, + blocking_by_list: self._fields.3, + did: self._fields.4.unwrap(), + followed_by: self._fields.5, + following: self._fields.6, extra_data: Some(extra_data), } } @@ -2257,83 +2387,83 @@ pub mod starter_pack_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; - type Creator; type IndexedAt; type Record; + type Creator; + type Cid; type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; - type Creator = Unset; type IndexedAt = Unset; type Record = Unset; + type Creator = Unset; + type Cid = Unset; type Uri = Unset; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Creator = St::Creator; - type IndexedAt = St::IndexedAt; - type Record = St::Record; - type Uri = St::Uri; - } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData St>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { - type Cid = St::Cid; - type Creator = Set; - type IndexedAt = St::IndexedAt; - type Record = St::Record; - type Uri = St::Uri; - } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Cid = St::Cid; - type Creator = St::Creator; type IndexedAt = Set; type Record = St::Record; + type Creator = St::Creator; + type Cid = St::Cid; type Uri = St::Uri; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData St>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Cid = St::Cid; - type Creator = St::Creator; type IndexedAt = St::IndexedAt; type Record = Set; + type Creator = St::Creator; + type Cid = St::Cid; + type Uri = St::Uri; + } + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData St>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type IndexedAt = St::IndexedAt; + type Record = St::Record; + type Creator = Set; + type Cid = St::Cid; + type Uri = St::Uri; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type IndexedAt = St::IndexedAt; + type Record = St::Record; + type Creator = St::Creator; + type Cid = Set; type Uri = St::Uri; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = St::Cid; - type Creator = St::Creator; type IndexedAt = St::IndexedAt; type Record = St::Record; + type Creator = St::Creator; + type Cid = St::Cid; type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `creator` field - pub struct creator(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); } @@ -2558,10 +2688,10 @@ where impl StarterPackViewBuilder where St: starter_pack_view_state::State, - St::Cid: starter_pack_view_state::IsSet, - St::Creator: starter_pack_view_state::IsSet, St::IndexedAt: starter_pack_view_state::IsSet, St::Record: starter_pack_view_state::IsSet, + St::Creator: starter_pack_view_state::IsSet, + St::Cid: starter_pack_view_state::IsSet, St::Uri: starter_pack_view_state::IsSet, { /// Build the final struct. @@ -2613,85 +2743,85 @@ pub mod starter_pack_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Uri; + type Record; type Cid; - type Creator; type IndexedAt; - type Record; - type Uri; + type Creator; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Uri = Unset; + type Record = Unset; type Cid = Unset; - type Creator = Unset; type IndexedAt = Unset; - type Record = Unset; - type Uri = Unset; + type Creator = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type Record = St::Record; + type Cid = St::Cid; + type IndexedAt = St::IndexedAt; + type Creator = St::Creator; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData St>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Uri = St::Uri; + type Record = Set; + type Cid = St::Cid; + type IndexedAt = St::IndexedAt; + type Creator = St::Creator; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Cid = Set; - type Creator = St::Creator; - type IndexedAt = St::IndexedAt; - type Record = St::Record; type Uri = St::Uri; - } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData St>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { - type Cid = St::Cid; - type Creator = Set; - type IndexedAt = St::IndexedAt; type Record = St::Record; - type Uri = St::Uri; + type Cid = Set; + type IndexedAt = St::IndexedAt; + type Creator = St::Creator; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Cid = St::Cid; - type Creator = St::Creator; - type IndexedAt = Set; - type Record = St::Record; type Uri = St::Uri; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData St>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { + type Record = St::Record; type Cid = St::Cid; + type IndexedAt = Set; type Creator = St::Creator; - type IndexedAt = St::IndexedAt; - type Record = Set; - type Uri = St::Uri; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData St>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Uri = St::Uri; + type Record = St::Record; type Cid = St::Cid; - type Creator = St::Creator; type IndexedAt = St::IndexedAt; - type Record = St::Record; - type Uri = Set; + type Creator = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `record` field + pub struct record(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `creator` field - pub struct creator(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `creator` field + pub struct creator(()); } } @@ -2901,11 +3031,11 @@ where impl StarterPackViewBasicBuilder where St: starter_pack_view_basic_state::State, + St::Uri: starter_pack_view_basic_state::IsSet, + St::Record: starter_pack_view_basic_state::IsSet, St::Cid: starter_pack_view_basic_state::IsSet, - St::Creator: starter_pack_view_basic_state::IsSet, St::IndexedAt: starter_pack_view_basic_state::IsSet, - St::Record: starter_pack_view_basic_state::IsSet, - St::Uri: starter_pack_view_basic_state::IsSet, + St::Creator: starter_pack_view_basic_state::IsSet, { /// Build the final struct. pub fn build(self) -> StarterPackViewBasic { diff --git a/services/types/src/app_bsky/graph/follow.rs b/services/types/src/app_bsky/graph/follow.rs index b3f0d83..f5eb90a 100644 --- a/services/types/src/app_bsky/graph/follow.rs +++ b/services/types/src/app_bsky/graph/follow.rs @@ -27,6 +27,7 @@ use jacquard_lexicon::schema::LexiconSchema; #[allow(unused_imports)] use jacquard_lexicon::validation::{ConstraintError, ValidationPath}; use serde::{Serialize, Deserialize}; +use crate::com_atproto::repo::strong_ref::StrongRef; /// Record declaring a social 'follow' relationship of another account. Duplicate follows will be ignored by the AppView. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] @@ -39,6 +40,8 @@ use serde::{Serialize, Deserialize}; pub struct Follow { pub created_at: Datetime, pub subject: Did, + #[serde(skip_serializing_if = "Option::is_none")] + pub via: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } @@ -149,7 +152,7 @@ pub mod follow_state { /// Builder for constructing an instance of this type. pub struct FollowBuilder { _state: PhantomData St>, - _fields: (Option, Option>), + _fields: (Option, Option>, Option>), _type: PhantomData S>, } @@ -165,7 +168,7 @@ impl FollowBuilder { pub fn new() -> Self { FollowBuilder { _state: PhantomData, - _fields: (None, None), + _fields: (None, None, None), _type: PhantomData, } } @@ -209,6 +212,19 @@ where } } +impl FollowBuilder { + /// Set the `via` field (optional) + pub fn via(mut self, value: impl Into>>) -> Self { + self._fields.2 = value.into(); + self + } + /// Set the `via` field to an Option value (optional) + pub fn maybe_via(mut self, value: Option>) -> Self { + self._fields.2 = value; + self + } +} + impl FollowBuilder where St: follow_state::State, @@ -220,6 +236,7 @@ where Follow { created_at: self._fields.0.unwrap(), subject: self._fields.1.unwrap(), + via: self._fields.2, extra_data: Default::default(), } } @@ -228,6 +245,7 @@ where Follow { created_at: self._fields.0.unwrap(), subject: self._fields.1.unwrap(), + via: self._fields.2, extra_data: Some(extra_data), } } @@ -276,6 +294,13 @@ fn lexicon_doc_app_bsky_graph_follow() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("via"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("com.atproto.repo.strongRef"), + ..Default::default() + }), + ); map }, ..Default::default() diff --git a/services/types/src/app_bsky/graph/get_lists.rs b/services/types/src/app_bsky/graph/get_lists.rs index c9f6c7b..64e46fb 100644 --- a/services/types/src/app_bsky/graph/get_lists.rs +++ b/services/types/src/app_bsky/graph/get_lists.rs @@ -28,6 +28,8 @@ pub struct GetLists { #[serde(default = "_default_limit")] #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub purposes: Option>, } @@ -104,7 +106,7 @@ pub mod get_lists_state { /// Builder for constructing an instance of this type. pub struct GetListsBuilder { _state: PhantomData St>, - _fields: (Option>, Option, Option), + _fields: (Option>, Option, Option, Option>), _type: PhantomData S>, } @@ -120,7 +122,7 @@ impl GetListsBuilder { pub fn new() -> Self { GetListsBuilder { _state: PhantomData, - _fields: (None, None, None), + _fields: (None, None, None, None), _type: PhantomData, } } @@ -171,6 +173,19 @@ impl GetListsBuilder { } } +impl GetListsBuilder { + /// Set the `purposes` field (optional) + pub fn purposes(mut self, value: impl Into>>) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `purposes` field to an Option value (optional) + pub fn maybe_purposes(mut self, value: Option>) -> Self { + self._fields.3 = value; + self + } +} + impl GetListsBuilder where St: get_lists_state::State, @@ -182,6 +197,7 @@ where actor: self._fields.0.unwrap(), cursor: self._fields.1, limit: self._fields.2, + purposes: self._fields.3, } } } \ No newline at end of file diff --git a/services/types/src/app_bsky/graph/get_suggested_follows_by_actor.rs b/services/types/src/app_bsky/graph/get_suggested_follows_by_actor.rs index 7343ca8..ecbcb3a 100644 --- a/services/types/src/app_bsky/graph/get_suggested_follows_by_actor.rs +++ b/services/types/src/app_bsky/graph/get_suggested_follows_by_actor.rs @@ -10,7 +10,7 @@ use alloc::collections::BTreeMap; #[allow(unused_imports)] use core::marker::PhantomData; -use jacquard_common::{BosStr, DefaultStr, FromStaticStr}; +use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::ident::AtIdentifier; use jacquard_common::types::value::Data; @@ -28,13 +28,16 @@ pub struct GetSuggestedFollowsByActor { #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct GetSuggestedFollowsByActorOutput { - ///If true, response has fallen-back to generic results, and is not scoped using relativeToDid Defaults to `false`. + ///DEPRECATED, unused. Previously: if true, response has fallen-back to generic results, and is not scoped using relativeToDid Defaults to `false`. #[serde(skip_serializing_if = "Option::is_none")] #[serde(default = "_default_get_suggested_follows_by_actor_output_is_fallback")] pub is_fallback: Option, - ///Snowflake for this recommendation, use when submitting recommendation events. + ///DEPRECATED: use recIdStr instead. #[serde(skip_serializing_if = "Option::is_none")] pub rec_id: Option, + ///Snowflake for this recommendation, use when submitting recommendation events. + #[serde(skip_serializing_if = "Option::is_none")] + pub rec_id_str: Option, pub suggestions: Vec>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, diff --git a/services/types/src/app_bsky/graph/list.rs b/services/types/src/app_bsky/graph/list.rs index 1e19d18..6225675 100644 --- a/services/types/src/app_bsky/graph/list.rs +++ b/services/types/src/app_bsky/graph/list.rs @@ -211,51 +211,51 @@ pub mod list_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Purpose; type CreatedAt; type Name; - type Purpose; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Purpose = Unset; type CreatedAt = Unset; type Name = Unset; - type Purpose = Unset; + } + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData St>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Purpose = Set; + type CreatedAt = St::CreatedAt; + type Name = St::Name; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData St>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { + type Purpose = St::Purpose; type CreatedAt = Set; type Name = St::Name; - type Purpose = St::Purpose; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { - type CreatedAt = St::CreatedAt; - type Name = Set; type Purpose = St::Purpose; - } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData St>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { type CreatedAt = St::CreatedAt; - type Name = St::Name; - type Purpose = Set; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `purpose` field + pub struct purpose(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `name` field pub struct name(()); - ///Marker type for the `purpose` field - pub struct purpose(()); } } @@ -407,9 +407,9 @@ where impl ListBuilder where St: list_state::State, + St::Purpose: list_state::IsSet, St::CreatedAt: list_state::IsSet, St::Name: list_state::IsSet, - St::Purpose: list_state::IsSet, { /// Build the final struct. pub fn build(self) -> List { diff --git a/services/types/src/app_bsky/graph/listblock.rs b/services/types/src/app_bsky/graph/listblock.rs index ec45199..321d110 100644 --- a/services/types/src/app_bsky/graph/listblock.rs +++ b/services/types/src/app_bsky/graph/listblock.rs @@ -113,37 +113,37 @@ pub mod listblock_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = St::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = St::CreatedAt; type Subject = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = St::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -213,8 +213,8 @@ where impl ListblockBuilder where St: listblock_state::State, - St::CreatedAt: listblock_state::IsSet, St::Subject: listblock_state::IsSet, + St::CreatedAt: listblock_state::IsSet, { /// Build the final struct. pub fn build(self) -> Listblock { diff --git a/services/types/src/app_bsky/graph/listitem.rs b/services/types/src/app_bsky/graph/listitem.rs index 2193d01..e3b6bb6 100644 --- a/services/types/src/app_bsky/graph/listitem.rs +++ b/services/types/src/app_bsky/graph/listitem.rs @@ -115,51 +115,51 @@ pub mod listitem_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type List; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type List = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type List = St::List; - type Subject = St::Subject; + type CreatedAt = Unset; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData St>); impl sealed::Sealed for SetList {} impl State for SetList { - type CreatedAt = St::CreatedAt; type List = Set; type Subject = St::Subject; + type CreatedAt = St::CreatedAt; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = St::CreatedAt; type List = St::List; type Subject = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type List = St::List; + type Subject = St::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `list` field pub struct list(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -248,9 +248,9 @@ where impl ListitemBuilder where St: listitem_state::State, - St::CreatedAt: listitem_state::IsSet, St::List: listitem_state::IsSet, St::Subject: listitem_state::IsSet, + St::CreatedAt: listitem_state::IsSet, { /// Build the final struct. pub fn build(self) -> Listitem { diff --git a/services/types/src/app_bsky/graph/starterpack.rs b/services/types/src/app_bsky/graph/starterpack.rs index 8f26df3..1b20076 100644 --- a/services/types/src/app_bsky/graph/starterpack.rs +++ b/services/types/src/app_bsky/graph/starterpack.rs @@ -432,51 +432,51 @@ pub mod starterpack_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; - type List; type Name; + type List; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; - type List = Unset; type Name = Unset; + type List = Unset; + type CreatedAt = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData St>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Name = Set; type List = St::List; - type Name = St::Name; + type CreatedAt = St::CreatedAt; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData St>); impl sealed::Sealed for SetList {} impl State for SetList { - type CreatedAt = St::CreatedAt; - type List = Set; type Name = St::Name; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData St>); - impl sealed::Sealed for SetName {} - impl State for SetName { + type List = Set; type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Name = St::Name; type List = St::List; - type Name = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `list` field - pub struct list(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `list` field + pub struct list(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -617,9 +617,9 @@ where impl StarterpackBuilder where St: starterpack_state::State, - St::CreatedAt: starterpack_state::IsSet, - St::List: starterpack_state::IsSet, St::Name: starterpack_state::IsSet, + St::List: starterpack_state::IsSet, + St::CreatedAt: starterpack_state::IsSet, { /// Build the final struct. pub fn build(self) -> Starterpack { diff --git a/services/types/src/app_bsky/graph/verification.rs b/services/types/src/app_bsky/graph/verification.rs index 13e0551..a3f54b0 100644 --- a/services/types/src/app_bsky/graph/verification.rs +++ b/services/types/src/app_bsky/graph/verification.rs @@ -118,67 +118,67 @@ pub mod verification_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; - type DisplayName; - type Handle; type Subject; + type Handle; + type DisplayName; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; - type DisplayName = Unset; - type Handle = Unset; type Subject = Unset; + type Handle = Unset; + type DisplayName = Unset; + type CreatedAt = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type DisplayName = St::DisplayName; + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData St>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Subject = Set; type Handle = St::Handle; - type Subject = St::Subject; - } - ///State transition - sets the `display_name` field to Set - pub struct SetDisplayName(PhantomData St>); - impl sealed::Sealed for SetDisplayName {} - impl State for SetDisplayName { + type DisplayName = St::DisplayName; type CreatedAt = St::CreatedAt; - type DisplayName = Set; - type Handle = St::Handle; - type Subject = St::Subject; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData St>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type CreatedAt = St::CreatedAt; - type DisplayName = St::DisplayName; - type Handle = Set; type Subject = St::Subject; + type Handle = Set; + type DisplayName = St::DisplayName; + type CreatedAt = St::CreatedAt; } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData St>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData St>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { + type Subject = St::Subject; + type Handle = St::Handle; + type DisplayName = Set; type CreatedAt = St::CreatedAt; - type DisplayName = St::DisplayName; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = St::Subject; type Handle = St::Handle; - type Subject = Set; + type DisplayName = St::DisplayName; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `display_name` field - pub struct display_name(()); - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `handle` field + pub struct handle(()); + ///Marker type for the `display_name` field + pub struct display_name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -286,10 +286,10 @@ where impl VerificationBuilder where St: verification_state::State, - St::CreatedAt: verification_state::IsSet, - St::DisplayName: verification_state::IsSet, - St::Handle: verification_state::IsSet, St::Subject: verification_state::IsSet, + St::Handle: verification_state::IsSet, + St::DisplayName: verification_state::IsSet, + St::CreatedAt: verification_state::IsSet, { /// Build the final struct. pub fn build(self) -> Verification { diff --git a/services/types/src/app_bsky/labeler.rs b/services/types/src/app_bsky/labeler.rs index b35b82c..c12e020 100644 --- a/services/types/src/app_bsky/labeler.rs +++ b/services/types/src/app_bsky/labeler.rs @@ -596,67 +596,67 @@ pub mod labeler_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; - type Creator; type IndexedAt; + type Cid; type Uri; + type Creator; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; - type Creator = Unset; type IndexedAt = Unset; + type Cid = Unset; type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Creator = St::Creator; - type IndexedAt = St::IndexedAt; - type Uri = St::Uri; - } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData St>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { - type Cid = St::Cid; - type Creator = Set; - type IndexedAt = St::IndexedAt; - type Uri = St::Uri; + type Creator = Unset; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { + type IndexedAt = Set; type Cid = St::Cid; + type Uri = St::Uri; type Creator = St::Creator; - type IndexedAt = Set; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type IndexedAt = St::IndexedAt; + type Cid = Set; type Uri = St::Uri; + type Creator = St::Creator; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { + type IndexedAt = St::IndexedAt; type Cid = St::Cid; + type Uri = Set; type Creator = St::Creator; + } + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData St>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { type IndexedAt = St::IndexedAt; - type Uri = Set; + type Cid = St::Cid; + type Uri = St::Uri; + type Creator = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `creator` field - pub struct creator(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `creator` field + pub struct creator(()); } } @@ -817,10 +817,10 @@ impl LabelerViewBuilder { impl LabelerViewBuilder where St: labeler_view_state::State, - St::Cid: labeler_view_state::IsSet, - St::Creator: labeler_view_state::IsSet, St::IndexedAt: labeler_view_state::IsSet, + St::Cid: labeler_view_state::IsSet, St::Uri: labeler_view_state::IsSet, + St::Creator: labeler_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> LabelerView { @@ -863,85 +863,85 @@ pub mod labeler_view_detailed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Creator; - type IndexedAt; - type Policies; type Uri; + type Policies; + type Cid; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Creator = Unset; - type IndexedAt = Unset; - type Policies = Unset; type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Creator = St::Creator; - type IndexedAt = St::IndexedAt; - type Policies = St::Policies; - type Uri = St::Uri; + type Policies = Unset; + type Cid = Unset; + type IndexedAt = Unset; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData St>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { - type Cid = St::Cid; type Creator = Set; - type IndexedAt = St::IndexedAt; - type Policies = St::Policies; type Uri = St::Uri; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData St>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { + type Policies = St::Policies; type Cid = St::Cid; + type IndexedAt = St::IndexedAt; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Creator = St::Creator; - type IndexedAt = Set; + type Uri = Set; type Policies = St::Policies; - type Uri = St::Uri; + type Cid = St::Cid; + type IndexedAt = St::IndexedAt; } ///State transition - sets the `policies` field to Set pub struct SetPolicies(PhantomData St>); impl sealed::Sealed for SetPolicies {} impl State for SetPolicies { - type Cid = St::Cid; type Creator = St::Creator; - type IndexedAt = St::IndexedAt; - type Policies = Set; type Uri = St::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + type Policies = Set; type Cid = St::Cid; + type IndexedAt = St::IndexedAt; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type Creator = St::Creator; + type Uri = St::Uri; + type Policies = St::Policies; + type Cid = Set; type IndexedAt = St::IndexedAt; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData St>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Creator = St::Creator; + type Uri = St::Uri; type Policies = St::Policies; - type Uri = Set; + type Cid = St::Cid; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `creator` field pub struct creator(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); - ///Marker type for the `policies` field - pub struct policies(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `policies` field + pub struct policies(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -1191,11 +1191,11 @@ impl< impl LabelerViewDetailedBuilder where St: labeler_view_detailed_state::State, - St::Cid: labeler_view_detailed_state::IsSet, St::Creator: labeler_view_detailed_state::IsSet, - St::IndexedAt: labeler_view_detailed_state::IsSet, - St::Policies: labeler_view_detailed_state::IsSet, St::Uri: labeler_view_detailed_state::IsSet, + St::Policies: labeler_view_detailed_state::IsSet, + St::Cid: labeler_view_detailed_state::IsSet, + St::IndexedAt: labeler_view_detailed_state::IsSet, { /// Build the final struct. pub fn build(self) -> LabelerViewDetailed { diff --git a/services/types/src/app_bsky/labeler/service.rs b/services/types/src/app_bsky/labeler/service.rs index 933966e..3f5e94c 100644 --- a/services/types/src/app_bsky/labeler/service.rs +++ b/services/types/src/app_bsky/labeler/service.rs @@ -127,37 +127,37 @@ pub mod service_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Policies; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Policies = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Policies = St::Policies; + type CreatedAt = Unset; } ///State transition - sets the `policies` field to Set pub struct SetPolicies(PhantomData St>); impl sealed::Sealed for SetPolicies {} impl State for SetPolicies { - type CreatedAt = St::CreatedAt; type Policies = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Policies = St::Policies; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `policies` field pub struct policies(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -292,8 +292,8 @@ impl ServiceBuilder { impl ServiceBuilder where St: service_state::State, - St::CreatedAt: service_state::IsSet, St::Policies: service_state::IsSet, + St::CreatedAt: service_state::IsSet, { /// Build the final struct. pub fn build(self) -> Service { diff --git a/services/types/src/app_bsky/notification.rs b/services/types/src/app_bsky/notification.rs index 0cfa589..a5ae9f0 100644 --- a/services/types/src/app_bsky/notification.rs +++ b/services/types/src/app_bsky/notification.rs @@ -48,6 +48,7 @@ pub struct ActivitySubscription { pub extra_data: Option>>, } +/// Deprecated: use chat.bsky.notification preferences instead. This will only return a default value. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -244,6 +245,7 @@ pub struct Preference { #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct Preferences { + ///Deprecated: use chat.bsky.notification preferences instead. This will only return a default value. pub chat: notification::ChatPreference, pub follow: notification::FilterablePreference, pub like: notification::FilterablePreference, @@ -561,6 +563,11 @@ fn lexicon_doc_app_bsky_notification_defs() -> LexiconDoc<'static> { map.insert( SmolStr::new_static("chatPreference"), LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Deprecated: use chat.bsky.notification preferences instead. This will only return a default value.", + ), + ), required: Some( vec![SmolStr::new_static("include"), SmolStr::new_static("push")], ), @@ -820,37 +827,37 @@ pub mod chat_preference_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Include; type Push; + type Include; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Include = Unset; type Push = Unset; - } - ///State transition - sets the `include` field to Set - pub struct SetInclude(PhantomData St>); - impl sealed::Sealed for SetInclude {} - impl State for SetInclude { - type Include = Set; - type Push = St::Push; + type Include = Unset; } ///State transition - sets the `push` field to Set pub struct SetPush(PhantomData St>); impl sealed::Sealed for SetPush {} impl State for SetPush { - type Include = St::Include; type Push = Set; + type Include = St::Include; + } + ///State transition - sets the `include` field to Set + pub struct SetInclude(PhantomData St>); + impl sealed::Sealed for SetInclude {} + impl State for SetInclude { + type Push = St::Push; + type Include = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `include` field - pub struct include(()); ///Marker type for the `push` field pub struct push(()); + ///Marker type for the `include` field + pub struct include(()); } } @@ -920,8 +927,8 @@ where impl ChatPreferenceBuilder where St: chat_preference_state::State, - St::Include: chat_preference_state::IsSet, St::Push: chat_preference_state::IsSet, + St::Include: chat_preference_state::IsSet, { /// Build the final struct. pub fn build(self) -> ChatPreference { @@ -954,49 +961,49 @@ pub mod filterable_preference_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Include; type List; + type Include; type Push; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Include = Unset; type List = Unset; + type Include = Unset; type Push = Unset; } - ///State transition - sets the `include` field to Set - pub struct SetInclude(PhantomData St>); - impl sealed::Sealed for SetInclude {} - impl State for SetInclude { - type Include = Set; - type List = St::List; - type Push = St::Push; - } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData St>); impl sealed::Sealed for SetList {} impl State for SetList { - type Include = St::Include; type List = Set; + type Include = St::Include; + type Push = St::Push; + } + ///State transition - sets the `include` field to Set + pub struct SetInclude(PhantomData St>); + impl sealed::Sealed for SetInclude {} + impl State for SetInclude { + type List = St::List; + type Include = Set; type Push = St::Push; } ///State transition - sets the `push` field to Set pub struct SetPush(PhantomData St>); impl sealed::Sealed for SetPush {} impl State for SetPush { - type Include = St::Include; type List = St::List; + type Include = St::Include; type Push = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `include` field - pub struct include(()); ///Marker type for the `list` field pub struct list(()); + ///Marker type for the `include` field + pub struct include(()); ///Marker type for the `push` field pub struct push(()); } @@ -1090,8 +1097,8 @@ where impl FilterablePreferenceBuilder where St: filterable_preference_state::State, - St::Include: filterable_preference_state::IsSet, St::List: filterable_preference_state::IsSet, + St::Include: filterable_preference_state::IsSet, St::Push: filterable_preference_state::IsSet, { /// Build the final struct. @@ -1261,299 +1268,299 @@ pub mod preferences_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Chat; - type Follow; type Like; - type LikeViaRepost; type Mention; - type Quote; type Reply; - type Repost; + type Quote; type RepostViaRepost; - type StarterpackJoined; type SubscribedPost; + type Follow; + type Chat; + type Repost; + type StarterpackJoined; type Unverified; + type LikeViaRepost; type Verified; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Chat = Unset; - type Follow = Unset; type Like = Unset; - type LikeViaRepost = Unset; type Mention = Unset; - type Quote = Unset; type Reply = Unset; - type Repost = Unset; + type Quote = Unset; type RepostViaRepost = Unset; - type StarterpackJoined = Unset; type SubscribedPost = Unset; + type Follow = Unset; + type Chat = Unset; + type Repost = Unset; + type StarterpackJoined = Unset; type Unverified = Unset; + type LikeViaRepost = Unset; type Verified = Unset; } - ///State transition - sets the `chat` field to Set - pub struct SetChat(PhantomData St>); - impl sealed::Sealed for SetChat {} - impl State for SetChat { - type Chat = Set; - type Follow = St::Follow; - type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; + ///State transition - sets the `like` field to Set + pub struct SetLike(PhantomData St>); + impl sealed::Sealed for SetLike {} + impl State for SetLike { + type Like = Set; type Mention = St::Mention; - type Quote = St::Quote; type Reply = St::Reply; - type Repost = St::Repost; + type Quote = St::Quote; type RepostViaRepost = St::RepostViaRepost; - type StarterpackJoined = St::StarterpackJoined; type SubscribedPost = St::SubscribedPost; + type Follow = St::Follow; + type Chat = St::Chat; + type Repost = St::Repost; + type StarterpackJoined = St::StarterpackJoined; type Unverified = St::Unverified; + type LikeViaRepost = St::LikeViaRepost; type Verified = St::Verified; } - ///State transition - sets the `follow` field to Set - pub struct SetFollow(PhantomData St>); - impl sealed::Sealed for SetFollow {} - impl State for SetFollow { - type Chat = St::Chat; - type Follow = Set; + ///State transition - sets the `mention` field to Set + pub struct SetMention(PhantomData St>); + impl sealed::Sealed for SetMention {} + impl State for SetMention { type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; - type Mention = St::Mention; - type Quote = St::Quote; + type Mention = Set; type Reply = St::Reply; - type Repost = St::Repost; + type Quote = St::Quote; type RepostViaRepost = St::RepostViaRepost; - type StarterpackJoined = St::StarterpackJoined; type SubscribedPost = St::SubscribedPost; + type Follow = St::Follow; + type Chat = St::Chat; + type Repost = St::Repost; + type StarterpackJoined = St::StarterpackJoined; type Unverified = St::Unverified; + type LikeViaRepost = St::LikeViaRepost; type Verified = St::Verified; } - ///State transition - sets the `like` field to Set - pub struct SetLike(PhantomData St>); - impl sealed::Sealed for SetLike {} - impl State for SetLike { - type Chat = St::Chat; + ///State transition - sets the `reply` field to Set + pub struct SetReply(PhantomData St>); + impl sealed::Sealed for SetReply {} + impl State for SetReply { + type Like = St::Like; + type Mention = St::Mention; + type Reply = Set; + type Quote = St::Quote; + type RepostViaRepost = St::RepostViaRepost; + type SubscribedPost = St::SubscribedPost; type Follow = St::Follow; - type Like = Set; + type Chat = St::Chat; + type Repost = St::Repost; + type StarterpackJoined = St::StarterpackJoined; + type Unverified = St::Unverified; type LikeViaRepost = St::LikeViaRepost; + type Verified = St::Verified; + } + ///State transition - sets the `quote` field to Set + pub struct SetQuote(PhantomData St>); + impl sealed::Sealed for SetQuote {} + impl State for SetQuote { + type Like = St::Like; type Mention = St::Mention; - type Quote = St::Quote; type Reply = St::Reply; - type Repost = St::Repost; + type Quote = Set; type RepostViaRepost = St::RepostViaRepost; - type StarterpackJoined = St::StarterpackJoined; type SubscribedPost = St::SubscribedPost; + type Follow = St::Follow; + type Chat = St::Chat; + type Repost = St::Repost; + type StarterpackJoined = St::StarterpackJoined; type Unverified = St::Unverified; + type LikeViaRepost = St::LikeViaRepost; type Verified = St::Verified; } - ///State transition - sets the `like_via_repost` field to Set - pub struct SetLikeViaRepost(PhantomData St>); - impl sealed::Sealed for SetLikeViaRepost {} - impl State for SetLikeViaRepost { - type Chat = St::Chat; - type Follow = St::Follow; + ///State transition - sets the `repost_via_repost` field to Set + pub struct SetRepostViaRepost(PhantomData St>); + impl sealed::Sealed for SetRepostViaRepost {} + impl State for SetRepostViaRepost { type Like = St::Like; - type LikeViaRepost = Set; type Mention = St::Mention; - type Quote = St::Quote; type Reply = St::Reply; + type Quote = St::Quote; + type RepostViaRepost = Set; + type SubscribedPost = St::SubscribedPost; + type Follow = St::Follow; + type Chat = St::Chat; type Repost = St::Repost; - type RepostViaRepost = St::RepostViaRepost; type StarterpackJoined = St::StarterpackJoined; - type SubscribedPost = St::SubscribedPost; type Unverified = St::Unverified; + type LikeViaRepost = St::LikeViaRepost; type Verified = St::Verified; } - ///State transition - sets the `mention` field to Set - pub struct SetMention(PhantomData St>); - impl sealed::Sealed for SetMention {} - impl State for SetMention { - type Chat = St::Chat; - type Follow = St::Follow; + ///State transition - sets the `subscribed_post` field to Set + pub struct SetSubscribedPost(PhantomData St>); + impl sealed::Sealed for SetSubscribedPost {} + impl State for SetSubscribedPost { type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; - type Mention = Set; - type Quote = St::Quote; + type Mention = St::Mention; type Reply = St::Reply; - type Repost = St::Repost; + type Quote = St::Quote; type RepostViaRepost = St::RepostViaRepost; + type SubscribedPost = Set; + type Follow = St::Follow; + type Chat = St::Chat; + type Repost = St::Repost; type StarterpackJoined = St::StarterpackJoined; - type SubscribedPost = St::SubscribedPost; type Unverified = St::Unverified; + type LikeViaRepost = St::LikeViaRepost; type Verified = St::Verified; } - ///State transition - sets the `quote` field to Set - pub struct SetQuote(PhantomData St>); - impl sealed::Sealed for SetQuote {} - impl State for SetQuote { - type Chat = St::Chat; - type Follow = St::Follow; + ///State transition - sets the `follow` field to Set + pub struct SetFollow(PhantomData St>); + impl sealed::Sealed for SetFollow {} + impl State for SetFollow { type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; type Mention = St::Mention; - type Quote = Set; type Reply = St::Reply; - type Repost = St::Repost; + type Quote = St::Quote; type RepostViaRepost = St::RepostViaRepost; - type StarterpackJoined = St::StarterpackJoined; type SubscribedPost = St::SubscribedPost; + type Follow = Set; + type Chat = St::Chat; + type Repost = St::Repost; + type StarterpackJoined = St::StarterpackJoined; type Unverified = St::Unverified; + type LikeViaRepost = St::LikeViaRepost; type Verified = St::Verified; } - ///State transition - sets the `reply` field to Set - pub struct SetReply(PhantomData St>); - impl sealed::Sealed for SetReply {} - impl State for SetReply { - type Chat = St::Chat; - type Follow = St::Follow; + ///State transition - sets the `chat` field to Set + pub struct SetChat(PhantomData St>); + impl sealed::Sealed for SetChat {} + impl State for SetChat { type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; type Mention = St::Mention; + type Reply = St::Reply; type Quote = St::Quote; - type Reply = Set; - type Repost = St::Repost; type RepostViaRepost = St::RepostViaRepost; - type StarterpackJoined = St::StarterpackJoined; type SubscribedPost = St::SubscribedPost; + type Follow = St::Follow; + type Chat = Set; + type Repost = St::Repost; + type StarterpackJoined = St::StarterpackJoined; type Unverified = St::Unverified; + type LikeViaRepost = St::LikeViaRepost; type Verified = St::Verified; } ///State transition - sets the `repost` field to Set pub struct SetRepost(PhantomData St>); impl sealed::Sealed for SetRepost {} impl State for SetRepost { - type Chat = St::Chat; - type Follow = St::Follow; type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; type Mention = St::Mention; - type Quote = St::Quote; type Reply = St::Reply; - type Repost = Set; + type Quote = St::Quote; type RepostViaRepost = St::RepostViaRepost; - type StarterpackJoined = St::StarterpackJoined; type SubscribedPost = St::SubscribedPost; - type Unverified = St::Unverified; - type Verified = St::Verified; - } - ///State transition - sets the `repost_via_repost` field to Set - pub struct SetRepostViaRepost(PhantomData St>); - impl sealed::Sealed for SetRepostViaRepost {} - impl State for SetRepostViaRepost { - type Chat = St::Chat; type Follow = St::Follow; - type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; - type Mention = St::Mention; - type Quote = St::Quote; - type Reply = St::Reply; - type Repost = St::Repost; - type RepostViaRepost = Set; + type Chat = St::Chat; + type Repost = Set; type StarterpackJoined = St::StarterpackJoined; - type SubscribedPost = St::SubscribedPost; type Unverified = St::Unverified; + type LikeViaRepost = St::LikeViaRepost; type Verified = St::Verified; } ///State transition - sets the `starterpack_joined` field to Set pub struct SetStarterpackJoined(PhantomData St>); impl sealed::Sealed for SetStarterpackJoined {} impl State for SetStarterpackJoined { - type Chat = St::Chat; - type Follow = St::Follow; type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; type Mention = St::Mention; - type Quote = St::Quote; type Reply = St::Reply; - type Repost = St::Repost; + type Quote = St::Quote; type RepostViaRepost = St::RepostViaRepost; - type StarterpackJoined = Set; type SubscribedPost = St::SubscribedPost; - type Unverified = St::Unverified; - type Verified = St::Verified; - } - ///State transition - sets the `subscribed_post` field to Set - pub struct SetSubscribedPost(PhantomData St>); - impl sealed::Sealed for SetSubscribedPost {} - impl State for SetSubscribedPost { - type Chat = St::Chat; type Follow = St::Follow; - type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; - type Mention = St::Mention; - type Quote = St::Quote; - type Reply = St::Reply; + type Chat = St::Chat; type Repost = St::Repost; - type RepostViaRepost = St::RepostViaRepost; - type StarterpackJoined = St::StarterpackJoined; - type SubscribedPost = Set; + type StarterpackJoined = Set; type Unverified = St::Unverified; + type LikeViaRepost = St::LikeViaRepost; type Verified = St::Verified; } ///State transition - sets the `unverified` field to Set pub struct SetUnverified(PhantomData St>); impl sealed::Sealed for SetUnverified {} impl State for SetUnverified { - type Chat = St::Chat; - type Follow = St::Follow; type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; type Mention = St::Mention; - type Quote = St::Quote; type Reply = St::Reply; - type Repost = St::Repost; + type Quote = St::Quote; type RepostViaRepost = St::RepostViaRepost; - type StarterpackJoined = St::StarterpackJoined; type SubscribedPost = St::SubscribedPost; + type Follow = St::Follow; + type Chat = St::Chat; + type Repost = St::Repost; + type StarterpackJoined = St::StarterpackJoined; type Unverified = Set; + type LikeViaRepost = St::LikeViaRepost; + type Verified = St::Verified; + } + ///State transition - sets the `like_via_repost` field to Set + pub struct SetLikeViaRepost(PhantomData St>); + impl sealed::Sealed for SetLikeViaRepost {} + impl State for SetLikeViaRepost { + type Like = St::Like; + type Mention = St::Mention; + type Reply = St::Reply; + type Quote = St::Quote; + type RepostViaRepost = St::RepostViaRepost; + type SubscribedPost = St::SubscribedPost; + type Follow = St::Follow; + type Chat = St::Chat; + type Repost = St::Repost; + type StarterpackJoined = St::StarterpackJoined; + type Unverified = St::Unverified; + type LikeViaRepost = Set; type Verified = St::Verified; } ///State transition - sets the `verified` field to Set pub struct SetVerified(PhantomData St>); impl sealed::Sealed for SetVerified {} impl State for SetVerified { - type Chat = St::Chat; - type Follow = St::Follow; type Like = St::Like; - type LikeViaRepost = St::LikeViaRepost; type Mention = St::Mention; - type Quote = St::Quote; type Reply = St::Reply; - type Repost = St::Repost; + type Quote = St::Quote; type RepostViaRepost = St::RepostViaRepost; - type StarterpackJoined = St::StarterpackJoined; type SubscribedPost = St::SubscribedPost; + type Follow = St::Follow; + type Chat = St::Chat; + type Repost = St::Repost; + type StarterpackJoined = St::StarterpackJoined; type Unverified = St::Unverified; + type LikeViaRepost = St::LikeViaRepost; type Verified = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `chat` field - pub struct chat(()); - ///Marker type for the `follow` field - pub struct follow(()); ///Marker type for the `like` field pub struct like(()); - ///Marker type for the `like_via_repost` field - pub struct like_via_repost(()); ///Marker type for the `mention` field pub struct mention(()); - ///Marker type for the `quote` field - pub struct quote(()); ///Marker type for the `reply` field pub struct reply(()); - ///Marker type for the `repost` field - pub struct repost(()); + ///Marker type for the `quote` field + pub struct quote(()); ///Marker type for the `repost_via_repost` field pub struct repost_via_repost(()); - ///Marker type for the `starterpack_joined` field - pub struct starterpack_joined(()); ///Marker type for the `subscribed_post` field pub struct subscribed_post(()); + ///Marker type for the `follow` field + pub struct follow(()); + ///Marker type for the `chat` field + pub struct chat(()); + ///Marker type for the `repost` field + pub struct repost(()); + ///Marker type for the `starterpack_joined` field + pub struct starterpack_joined(()); ///Marker type for the `unverified` field pub struct unverified(()); + ///Marker type for the `like_via_repost` field + pub struct like_via_repost(()); ///Marker type for the `verified` field pub struct verified(()); } @@ -1862,18 +1869,18 @@ where impl PreferencesBuilder where St: preferences_state::State, - St::Chat: preferences_state::IsSet, - St::Follow: preferences_state::IsSet, St::Like: preferences_state::IsSet, - St::LikeViaRepost: preferences_state::IsSet, St::Mention: preferences_state::IsSet, - St::Quote: preferences_state::IsSet, St::Reply: preferences_state::IsSet, - St::Repost: preferences_state::IsSet, + St::Quote: preferences_state::IsSet, St::RepostViaRepost: preferences_state::IsSet, - St::StarterpackJoined: preferences_state::IsSet, St::SubscribedPost: preferences_state::IsSet, + St::Follow: preferences_state::IsSet, + St::Chat: preferences_state::IsSet, + St::Repost: preferences_state::IsSet, + St::StarterpackJoined: preferences_state::IsSet, St::Unverified: preferences_state::IsSet, + St::LikeViaRepost: preferences_state::IsSet, St::Verified: preferences_state::IsSet, { /// Build the final struct. diff --git a/services/types/src/app_bsky/notification/list_notifications.rs b/services/types/src/app_bsky/notification/list_notifications.rs index 67e9c13..35bc5b0 100644 --- a/services/types/src/app_bsky/notification/list_notifications.rs +++ b/services/types/src/app_bsky/notification/list_notifications.rs @@ -96,6 +96,7 @@ pub enum NotificationReason { LikeViaRepost, RepostViaRepost, SubscribedPost, + ContactMatch, Other(S), } @@ -114,6 +115,7 @@ impl NotificationReason { Self::LikeViaRepost => "like-via-repost", Self::RepostViaRepost => "repost-via-repost", Self::SubscribedPost => "subscribed-post", + Self::ContactMatch => "contact-match", Self::Other(s) => s.as_ref(), } } @@ -132,6 +134,7 @@ impl NotificationReason { "like-via-repost" => Self::LikeViaRepost, "repost-via-repost" => Self::RepostViaRepost, "subscribed-post" => Self::SubscribedPost, + "contact-match" => Self::ContactMatch, _ => Self::Other(s), } } @@ -196,6 +199,7 @@ where NotificationReason::LikeViaRepost => NotificationReason::LikeViaRepost, NotificationReason::RepostViaRepost => NotificationReason::RepostViaRepost, NotificationReason::SubscribedPost => NotificationReason::SubscribedPost, + NotificationReason::ContactMatch => NotificationReason::ContactMatch, NotificationReason::Other(v) => NotificationReason::Other(v.into_static()), } } @@ -379,127 +383,127 @@ pub mod notification_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Author; - type Cid; - type IndexedAt; - type IsRead; type Reason; type Record; + type Author; type Uri; + type Cid; + type IsRead; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Author = Unset; - type Cid = Unset; - type IndexedAt = Unset; - type IsRead = Unset; type Reason = Unset; type Record = Unset; + type Author = Unset; type Uri = Unset; + type Cid = Unset; + type IsRead = Unset; + type IndexedAt = Unset; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData St>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Reason = Set; + type Record = St::Record; + type Author = St::Author; + type Uri = St::Uri; + type Cid = St::Cid; + type IsRead = St::IsRead; + type IndexedAt = St::IndexedAt; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData St>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Reason = St::Reason; + type Record = Set; + type Author = St::Author; + type Uri = St::Uri; + type Cid = St::Cid; + type IsRead = St::IsRead; + type IndexedAt = St::IndexedAt; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData St>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { + type Reason = St::Reason; + type Record = St::Record; type Author = Set; + type Uri = St::Uri; type Cid = St::Cid; - type IndexedAt = St::IndexedAt; type IsRead = St::IsRead; + type IndexedAt = St::IndexedAt; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Reason = St::Reason; type Record = St::Record; - type Uri = St::Uri; + type Author = St::Author; + type Uri = Set; + type Cid = St::Cid; + type IsRead = St::IsRead; + type IndexedAt = St::IndexedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData St>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Author = St::Author; - type Cid = Set; - type IndexedAt = St::IndexedAt; - type IsRead = St::IsRead; type Reason = St::Reason; type Record = St::Record; - type Uri = St::Uri; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData St>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { type Author = St::Author; - type Cid = St::Cid; - type IndexedAt = Set; - type IsRead = St::IsRead; - type Reason = St::Reason; - type Record = St::Record; type Uri = St::Uri; + type Cid = Set; + type IsRead = St::IsRead; + type IndexedAt = St::IndexedAt; } ///State transition - sets the `is_read` field to Set pub struct SetIsRead(PhantomData St>); impl sealed::Sealed for SetIsRead {} impl State for SetIsRead { - type Author = St::Author; - type Cid = St::Cid; - type IndexedAt = St::IndexedAt; - type IsRead = Set; type Reason = St::Reason; type Record = St::Record; - type Uri = St::Uri; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData St>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { type Author = St::Author; - type Cid = St::Cid; - type IndexedAt = St::IndexedAt; - type IsRead = St::IsRead; - type Reason = Set; - type Record = St::Record; type Uri = St::Uri; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData St>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Author = St::Author; type Cid = St::Cid; + type IsRead = Set; type IndexedAt = St::IndexedAt; - type IsRead = St::IsRead; - type Reason = St::Reason; - type Record = Set; - type Uri = St::Uri; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData St>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Reason = St::Reason; + type Record = St::Record; type Author = St::Author; + type Uri = St::Uri; type Cid = St::Cid; - type IndexedAt = St::IndexedAt; type IsRead = St::IsRead; - type Reason = St::Reason; - type Record = St::Record; - type Uri = Set; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `author` field - pub struct author(()); - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); - ///Marker type for the `is_read` field - pub struct is_read(()); ///Marker type for the `reason` field pub struct reason(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `author` field + pub struct author(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `is_read` field + pub struct is_read(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -700,13 +704,13 @@ where impl NotificationBuilder where St: notification_state::State, - St::Author: notification_state::IsSet, - St::Cid: notification_state::IsSet, - St::IndexedAt: notification_state::IsSet, - St::IsRead: notification_state::IsSet, St::Reason: notification_state::IsSet, St::Record: notification_state::IsSet, + St::Author: notification_state::IsSet, St::Uri: notification_state::IsSet, + St::Cid: notification_state::IsSet, + St::IsRead: notification_state::IsSet, + St::IndexedAt: notification_state::IsSet, { /// Build the final struct. pub fn build(self) -> Notification { diff --git a/services/types/src/app_bsky/notification/put_preferences_v2.rs b/services/types/src/app_bsky/notification/put_preferences_v2.rs index cdf6393..c5bcb55 100644 --- a/services/types/src/app_bsky/notification/put_preferences_v2.rs +++ b/services/types/src/app_bsky/notification/put_preferences_v2.rs @@ -23,6 +23,7 @@ use crate::app_bsky::notification::Preferences; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct PutPreferencesV2 { + ///Deprecated: use chat.bsky.notification preferences instead. Setting this won't stick and the default values will be returned. #[serde(skip_serializing_if = "Option::is_none")] pub chat: Option>, #[serde(skip_serializing_if = "Option::is_none")] diff --git a/services/types/src/app_bsky/notification/register_push.rs b/services/types/src/app_bsky/notification/register_push.rs index 5da721d..d0a60d7 100644 --- a/services/types/src/app_bsky/notification/register_push.rs +++ b/services/types/src/app_bsky/notification/register_push.rs @@ -153,67 +153,67 @@ pub mod register_push_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AppId; type Platform; - type ServiceDid; type Token; + type AppId; + type ServiceDid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AppId = Unset; type Platform = Unset; - type ServiceDid = Unset; type Token = Unset; - } - ///State transition - sets the `app_id` field to Set - pub struct SetAppId(PhantomData St>); - impl sealed::Sealed for SetAppId {} - impl State for SetAppId { - type AppId = Set; - type Platform = St::Platform; - type ServiceDid = St::ServiceDid; - type Token = St::Token; + type AppId = Unset; + type ServiceDid = Unset; } ///State transition - sets the `platform` field to Set pub struct SetPlatform(PhantomData St>); impl sealed::Sealed for SetPlatform {} impl State for SetPlatform { - type AppId = St::AppId; type Platform = Set; - type ServiceDid = St::ServiceDid; type Token = St::Token; - } - ///State transition - sets the `service_did` field to Set - pub struct SetServiceDid(PhantomData St>); - impl sealed::Sealed for SetServiceDid {} - impl State for SetServiceDid { type AppId = St::AppId; - type Platform = St::Platform; - type ServiceDid = Set; - type Token = St::Token; + type ServiceDid = St::ServiceDid; } ///State transition - sets the `token` field to Set pub struct SetToken(PhantomData St>); impl sealed::Sealed for SetToken {} impl State for SetToken { + type Platform = St::Platform; + type Token = Set; type AppId = St::AppId; + type ServiceDid = St::ServiceDid; + } + ///State transition - sets the `app_id` field to Set + pub struct SetAppId(PhantomData St>); + impl sealed::Sealed for SetAppId {} + impl State for SetAppId { type Platform = St::Platform; + type Token = St::Token; + type AppId = Set; type ServiceDid = St::ServiceDid; - type Token = Set; + } + ///State transition - sets the `service_did` field to Set + pub struct SetServiceDid(PhantomData St>); + impl sealed::Sealed for SetServiceDid {} + impl State for SetServiceDid { + type Platform = St::Platform; + type Token = St::Token; + type AppId = St::AppId; + type ServiceDid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `app_id` field - pub struct app_id(()); ///Marker type for the `platform` field pub struct platform(()); - ///Marker type for the `service_did` field - pub struct service_did(()); ///Marker type for the `token` field pub struct token(()); + ///Marker type for the `app_id` field + pub struct app_id(()); + ///Marker type for the `service_did` field + pub struct service_did(()); } } @@ -340,10 +340,10 @@ where impl RegisterPushBuilder where St: register_push_state::State, - St::AppId: register_push_state::IsSet, St::Platform: register_push_state::IsSet, - St::ServiceDid: register_push_state::IsSet, St::Token: register_push_state::IsSet, + St::AppId: register_push_state::IsSet, + St::ServiceDid: register_push_state::IsSet, { /// Build the final struct. pub fn build(self) -> RegisterPush { diff --git a/services/types/src/app_bsky/notification/unregister_push.rs b/services/types/src/app_bsky/notification/unregister_push.rs index 812d02e..87b3193 100644 --- a/services/types/src/app_bsky/notification/unregister_push.rs +++ b/services/types/src/app_bsky/notification/unregister_push.rs @@ -150,67 +150,67 @@ pub mod unregister_push_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AppId; type Platform; type ServiceDid; type Token; + type AppId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AppId = Unset; type Platform = Unset; type ServiceDid = Unset; type Token = Unset; - } - ///State transition - sets the `app_id` field to Set - pub struct SetAppId(PhantomData St>); - impl sealed::Sealed for SetAppId {} - impl State for SetAppId { - type AppId = Set; - type Platform = St::Platform; - type ServiceDid = St::ServiceDid; - type Token = St::Token; + type AppId = Unset; } ///State transition - sets the `platform` field to Set pub struct SetPlatform(PhantomData St>); impl sealed::Sealed for SetPlatform {} impl State for SetPlatform { - type AppId = St::AppId; type Platform = Set; type ServiceDid = St::ServiceDid; type Token = St::Token; + type AppId = St::AppId; } ///State transition - sets the `service_did` field to Set pub struct SetServiceDid(PhantomData St>); impl sealed::Sealed for SetServiceDid {} impl State for SetServiceDid { - type AppId = St::AppId; type Platform = St::Platform; type ServiceDid = Set; type Token = St::Token; + type AppId = St::AppId; } ///State transition - sets the `token` field to Set pub struct SetToken(PhantomData St>); impl sealed::Sealed for SetToken {} impl State for SetToken { - type AppId = St::AppId; type Platform = St::Platform; type ServiceDid = St::ServiceDid; type Token = Set; + type AppId = St::AppId; + } + ///State transition - sets the `app_id` field to Set + pub struct SetAppId(PhantomData St>); + impl sealed::Sealed for SetAppId {} + impl State for SetAppId { + type Platform = St::Platform; + type ServiceDid = St::ServiceDid; + type Token = St::Token; + type AppId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `app_id` field - pub struct app_id(()); ///Marker type for the `platform` field pub struct platform(()); ///Marker type for the `service_did` field pub struct service_did(()); ///Marker type for the `token` field pub struct token(()); + ///Marker type for the `app_id` field + pub struct app_id(()); } } @@ -318,10 +318,10 @@ where impl UnregisterPushBuilder where St: unregister_push_state::State, - St::AppId: unregister_push_state::IsSet, St::Platform: unregister_push_state::IsSet, St::ServiceDid: unregister_push_state::IsSet, St::Token: unregister_push_state::IsSet, + St::AppId: unregister_push_state::IsSet, { /// Build the final struct. pub fn build(self) -> UnregisterPush { diff --git a/services/types/src/app_bsky/richtext/facet.rs b/services/types/src/app_bsky/richtext/facet.rs index a51d63f..fe3a717 100644 --- a/services/types/src/app_bsky/richtext/facet.rs +++ b/services/types/src/app_bsky/richtext/facet.rs @@ -219,37 +219,37 @@ pub mod byte_slice_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ByteEnd; type ByteStart; + type ByteEnd; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ByteEnd = Unset; type ByteStart = Unset; - } - ///State transition - sets the `byte_end` field to Set - pub struct SetByteEnd(PhantomData St>); - impl sealed::Sealed for SetByteEnd {} - impl State for SetByteEnd { - type ByteEnd = Set; - type ByteStart = St::ByteStart; + type ByteEnd = Unset; } ///State transition - sets the `byte_start` field to Set pub struct SetByteStart(PhantomData St>); impl sealed::Sealed for SetByteStart {} impl State for SetByteStart { - type ByteEnd = St::ByteEnd; type ByteStart = Set; + type ByteEnd = St::ByteEnd; + } + ///State transition - sets the `byte_end` field to Set + pub struct SetByteEnd(PhantomData St>); + impl sealed::Sealed for SetByteEnd {} + impl State for SetByteEnd { + type ByteStart = St::ByteStart; + type ByteEnd = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `byte_end` field - pub struct byte_end(()); ///Marker type for the `byte_start` field pub struct byte_start(()); + ///Marker type for the `byte_end` field + pub struct byte_end(()); } } @@ -319,8 +319,8 @@ where impl ByteSliceBuilder where St: byte_slice_state::State, - St::ByteEnd: byte_slice_state::IsSet, St::ByteStart: byte_slice_state::IsSet, + St::ByteEnd: byte_slice_state::IsSet, { /// Build the final struct. pub fn build(self) -> ByteSlice { diff --git a/services/types/src/app_bsky/unspecced.rs b/services/types/src/app_bsky/unspecced.rs index d884feb..0cc117b 100644 --- a/services/types/src/app_bsky/unspecced.rs +++ b/services/types/src/app_bsky/unspecced.rs @@ -5,17 +5,26 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. -pub mod check_handle_availability; pub mod get_age_assurance_state; pub mod get_config; +pub mod get_onboarding_suggested_starter_packs; +pub mod get_onboarding_suggested_starter_packs_skeleton; +pub mod get_onboarding_suggested_users_skeleton; pub mod get_popular_feed_generators; pub mod get_post_thread_other_v2; pub mod get_post_thread_v2; pub mod get_suggested_feeds; pub mod get_suggested_feeds_skeleton; +pub mod get_suggested_onboarding_users; pub mod get_suggested_starter_packs; pub mod get_suggested_starter_packs_skeleton; pub mod get_suggested_users; +pub mod get_suggested_users_for_discover; +pub mod get_suggested_users_for_discover_skeleton; +pub mod get_suggested_users_for_explore; +pub mod get_suggested_users_for_explore_skeleton; +pub mod get_suggested_users_for_see_more; +pub mod get_suggested_users_for_see_more_skeleton; pub mod get_suggested_users_skeleton; pub mod get_suggestions_skeleton; pub mod get_tagged_suggestions; @@ -727,51 +736,51 @@ pub mod age_assurance_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Status; type AttemptId; type CreatedAt; - type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Status = Unset; type AttemptId = Unset; type CreatedAt = Unset; - type Status = Unset; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData St>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type Status = Set; + type AttemptId = St::AttemptId; + type CreatedAt = St::CreatedAt; } ///State transition - sets the `attempt_id` field to Set pub struct SetAttemptId(PhantomData St>); impl sealed::Sealed for SetAttemptId {} impl State for SetAttemptId { + type Status = St::Status; type AttemptId = Set; type CreatedAt = St::CreatedAt; - type Status = St::Status; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData St>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type AttemptId = St::AttemptId; - type CreatedAt = Set; type Status = St::Status; - } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData St>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { type AttemptId = St::AttemptId; - type CreatedAt = St::CreatedAt; - type Status = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `status` field + pub struct status(()); ///Marker type for the `attempt_id` field pub struct attempt_id(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `status` field - pub struct status(()); } } @@ -934,9 +943,9 @@ where impl AgeAssuranceEventBuilder where St: age_assurance_event_state::State, + St::Status: age_assurance_event_state::IsSet, St::AttemptId: age_assurance_event_state::IsSet, St::CreatedAt: age_assurance_event_state::IsSet, - St::Status: age_assurance_event_state::IsSet, { /// Build the final struct. pub fn build(self) -> AgeAssuranceEvent { @@ -1778,103 +1787,103 @@ pub mod skeleton_trend_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Link; + type StartedAt; type Dids; type DisplayName; - type Link; type PostCount; - type StartedAt; type Topic; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Link = Unset; + type StartedAt = Unset; type Dids = Unset; type DisplayName = Unset; - type Link = Unset; type PostCount = Unset; - type StartedAt = Unset; type Topic = Unset; } + ///State transition - sets the `link` field to Set + pub struct SetLink(PhantomData St>); + impl sealed::Sealed for SetLink {} + impl State for SetLink { + type Link = Set; + type StartedAt = St::StartedAt; + type Dids = St::Dids; + type DisplayName = St::DisplayName; + type PostCount = St::PostCount; + type Topic = St::Topic; + } + ///State transition - sets the `started_at` field to Set + pub struct SetStartedAt(PhantomData St>); + impl sealed::Sealed for SetStartedAt {} + impl State for SetStartedAt { + type Link = St::Link; + type StartedAt = Set; + type Dids = St::Dids; + type DisplayName = St::DisplayName; + type PostCount = St::PostCount; + type Topic = St::Topic; + } ///State transition - sets the `dids` field to Set pub struct SetDids(PhantomData St>); impl sealed::Sealed for SetDids {} impl State for SetDids { + type Link = St::Link; + type StartedAt = St::StartedAt; type Dids = Set; type DisplayName = St::DisplayName; - type Link = St::Link; type PostCount = St::PostCount; - type StartedAt = St::StartedAt; type Topic = St::Topic; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData St>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Dids = St::Dids; - type DisplayName = Set; type Link = St::Link; - type PostCount = St::PostCount; type StartedAt = St::StartedAt; - type Topic = St::Topic; - } - ///State transition - sets the `link` field to Set - pub struct SetLink(PhantomData St>); - impl sealed::Sealed for SetLink {} - impl State for SetLink { type Dids = St::Dids; - type DisplayName = St::DisplayName; - type Link = Set; + type DisplayName = Set; type PostCount = St::PostCount; - type StartedAt = St::StartedAt; type Topic = St::Topic; } ///State transition - sets the `post_count` field to Set pub struct SetPostCount(PhantomData St>); impl sealed::Sealed for SetPostCount {} impl State for SetPostCount { - type Dids = St::Dids; - type DisplayName = St::DisplayName; type Link = St::Link; - type PostCount = Set; type StartedAt = St::StartedAt; - type Topic = St::Topic; - } - ///State transition - sets the `started_at` field to Set - pub struct SetStartedAt(PhantomData St>); - impl sealed::Sealed for SetStartedAt {} - impl State for SetStartedAt { type Dids = St::Dids; type DisplayName = St::DisplayName; - type Link = St::Link; - type PostCount = St::PostCount; - type StartedAt = Set; + type PostCount = Set; type Topic = St::Topic; } ///State transition - sets the `topic` field to Set pub struct SetTopic(PhantomData St>); impl sealed::Sealed for SetTopic {} impl State for SetTopic { + type Link = St::Link; + type StartedAt = St::StartedAt; type Dids = St::Dids; type DisplayName = St::DisplayName; - type Link = St::Link; type PostCount = St::PostCount; - type StartedAt = St::StartedAt; type Topic = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `link` field + pub struct link(()); + ///Marker type for the `started_at` field + pub struct started_at(()); ///Marker type for the `dids` field pub struct dids(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `link` field - pub struct link(()); ///Marker type for the `post_count` field pub struct post_count(()); - ///Marker type for the `started_at` field - pub struct started_at(()); ///Marker type for the `topic` field pub struct topic(()); } @@ -2057,11 +2066,11 @@ where impl SkeletonTrendBuilder where St: skeleton_trend_state::State, + St::Link: skeleton_trend_state::IsSet, + St::StartedAt: skeleton_trend_state::IsSet, St::Dids: skeleton_trend_state::IsSet, St::DisplayName: skeleton_trend_state::IsSet, - St::Link: skeleton_trend_state::IsSet, St::PostCount: skeleton_trend_state::IsSet, - St::StartedAt: skeleton_trend_state::IsSet, St::Topic: skeleton_trend_state::IsSet, { /// Build the final struct. @@ -2207,105 +2216,105 @@ pub mod thread_item_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type HiddenByThreadgate; type MoreParents; - type MoreReplies; - type MutedByViewer; type OpThread; + type MoreReplies; type Post; + type HiddenByThreadgate; + type MutedByViewer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type HiddenByThreadgate = Unset; type MoreParents = Unset; - type MoreReplies = Unset; - type MutedByViewer = Unset; type OpThread = Unset; + type MoreReplies = Unset; type Post = Unset; - } - ///State transition - sets the `hidden_by_threadgate` field to Set - pub struct SetHiddenByThreadgate(PhantomData St>); - impl sealed::Sealed for SetHiddenByThreadgate {} - impl State for SetHiddenByThreadgate { - type HiddenByThreadgate = Set; - type MoreParents = St::MoreParents; - type MoreReplies = St::MoreReplies; - type MutedByViewer = St::MutedByViewer; - type OpThread = St::OpThread; - type Post = St::Post; + type HiddenByThreadgate = Unset; + type MutedByViewer = Unset; } ///State transition - sets the `more_parents` field to Set pub struct SetMoreParents(PhantomData St>); impl sealed::Sealed for SetMoreParents {} impl State for SetMoreParents { - type HiddenByThreadgate = St::HiddenByThreadgate; type MoreParents = Set; - type MoreReplies = St::MoreReplies; - type MutedByViewer = St::MutedByViewer; type OpThread = St::OpThread; + type MoreReplies = St::MoreReplies; type Post = St::Post; - } - ///State transition - sets the `more_replies` field to Set - pub struct SetMoreReplies(PhantomData St>); - impl sealed::Sealed for SetMoreReplies {} - impl State for SetMoreReplies { type HiddenByThreadgate = St::HiddenByThreadgate; - type MoreParents = St::MoreParents; - type MoreReplies = Set; type MutedByViewer = St::MutedByViewer; - type OpThread = St::OpThread; - type Post = St::Post; - } - ///State transition - sets the `muted_by_viewer` field to Set - pub struct SetMutedByViewer(PhantomData St>); - impl sealed::Sealed for SetMutedByViewer {} - impl State for SetMutedByViewer { - type HiddenByThreadgate = St::HiddenByThreadgate; - type MoreParents = St::MoreParents; - type MoreReplies = St::MoreReplies; - type MutedByViewer = Set; - type OpThread = St::OpThread; - type Post = St::Post; } ///State transition - sets the `op_thread` field to Set pub struct SetOpThread(PhantomData St>); impl sealed::Sealed for SetOpThread {} impl State for SetOpThread { - type HiddenByThreadgate = St::HiddenByThreadgate; type MoreParents = St::MoreParents; + type OpThread = Set; type MoreReplies = St::MoreReplies; + type Post = St::Post; + type HiddenByThreadgate = St::HiddenByThreadgate; type MutedByViewer = St::MutedByViewer; - type OpThread = Set; + } + ///State transition - sets the `more_replies` field to Set + pub struct SetMoreReplies(PhantomData St>); + impl sealed::Sealed for SetMoreReplies {} + impl State for SetMoreReplies { + type MoreParents = St::MoreParents; + type OpThread = St::OpThread; + type MoreReplies = Set; type Post = St::Post; + type HiddenByThreadgate = St::HiddenByThreadgate; + type MutedByViewer = St::MutedByViewer; } ///State transition - sets the `post` field to Set pub struct SetPost(PhantomData St>); impl sealed::Sealed for SetPost {} impl State for SetPost { + type MoreParents = St::MoreParents; + type OpThread = St::OpThread; + type MoreReplies = St::MoreReplies; + type Post = Set; type HiddenByThreadgate = St::HiddenByThreadgate; + type MutedByViewer = St::MutedByViewer; + } + ///State transition - sets the `hidden_by_threadgate` field to Set + pub struct SetHiddenByThreadgate(PhantomData St>); + impl sealed::Sealed for SetHiddenByThreadgate {} + impl State for SetHiddenByThreadgate { type MoreParents = St::MoreParents; + type OpThread = St::OpThread; type MoreReplies = St::MoreReplies; + type Post = St::Post; + type HiddenByThreadgate = Set; type MutedByViewer = St::MutedByViewer; + } + ///State transition - sets the `muted_by_viewer` field to Set + pub struct SetMutedByViewer(PhantomData St>); + impl sealed::Sealed for SetMutedByViewer {} + impl State for SetMutedByViewer { + type MoreParents = St::MoreParents; type OpThread = St::OpThread; - type Post = Set; + type MoreReplies = St::MoreReplies; + type Post = St::Post; + type HiddenByThreadgate = St::HiddenByThreadgate; + type MutedByViewer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `hidden_by_threadgate` field - pub struct hidden_by_threadgate(()); ///Marker type for the `more_parents` field pub struct more_parents(()); - ///Marker type for the `more_replies` field - pub struct more_replies(()); - ///Marker type for the `muted_by_viewer` field - pub struct muted_by_viewer(()); ///Marker type for the `op_thread` field pub struct op_thread(()); + ///Marker type for the `more_replies` field + pub struct more_replies(()); ///Marker type for the `post` field pub struct post(()); + ///Marker type for the `hidden_by_threadgate` field + pub struct hidden_by_threadgate(()); + ///Marker type for the `muted_by_viewer` field + pub struct muted_by_viewer(()); } } @@ -2458,12 +2467,12 @@ where impl ThreadItemPostBuilder where St: thread_item_post_state::State, - St::HiddenByThreadgate: thread_item_post_state::IsSet, St::MoreParents: thread_item_post_state::IsSet, - St::MoreReplies: thread_item_post_state::IsSet, - St::MutedByViewer: thread_item_post_state::IsSet, St::OpThread: thread_item_post_state::IsSet, + St::MoreReplies: thread_item_post_state::IsSet, St::Post: thread_item_post_state::IsSet, + St::HiddenByThreadgate: thread_item_post_state::IsSet, + St::MutedByViewer: thread_item_post_state::IsSet, { /// Build the final struct. pub fn build(self) -> ThreadItemPost { @@ -2504,105 +2513,105 @@ pub mod trend_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Actors; - type DisplayName; - type Link; type PostCount; - type StartedAt; + type Link; type Topic; + type DisplayName; + type StartedAt; + type Actors; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Actors = Unset; - type DisplayName = Unset; - type Link = Unset; type PostCount = Unset; - type StartedAt = Unset; + type Link = Unset; type Topic = Unset; + type DisplayName = Unset; + type StartedAt = Unset; + type Actors = Unset; } - ///State transition - sets the `actors` field to Set - pub struct SetActors(PhantomData St>); - impl sealed::Sealed for SetActors {} - impl State for SetActors { - type Actors = Set; - type DisplayName = St::DisplayName; + ///State transition - sets the `post_count` field to Set + pub struct SetPostCount(PhantomData St>); + impl sealed::Sealed for SetPostCount {} + impl State for SetPostCount { + type PostCount = Set; type Link = St::Link; - type PostCount = St::PostCount; - type StartedAt = St::StartedAt; type Topic = St::Topic; - } - ///State transition - sets the `display_name` field to Set - pub struct SetDisplayName(PhantomData St>); - impl sealed::Sealed for SetDisplayName {} - impl State for SetDisplayName { - type Actors = St::Actors; - type DisplayName = Set; - type Link = St::Link; - type PostCount = St::PostCount; + type DisplayName = St::DisplayName; type StartedAt = St::StartedAt; - type Topic = St::Topic; + type Actors = St::Actors; } ///State transition - sets the `link` field to Set pub struct SetLink(PhantomData St>); impl sealed::Sealed for SetLink {} impl State for SetLink { - type Actors = St::Actors; - type DisplayName = St::DisplayName; - type Link = Set; type PostCount = St::PostCount; - type StartedAt = St::StartedAt; + type Link = Set; type Topic = St::Topic; - } - ///State transition - sets the `post_count` field to Set - pub struct SetPostCount(PhantomData St>); - impl sealed::Sealed for SetPostCount {} - impl State for SetPostCount { - type Actors = St::Actors; type DisplayName = St::DisplayName; + type StartedAt = St::StartedAt; + type Actors = St::Actors; + } + ///State transition - sets the `topic` field to Set + pub struct SetTopic(PhantomData St>); + impl sealed::Sealed for SetTopic {} + impl State for SetTopic { + type PostCount = St::PostCount; type Link = St::Link; - type PostCount = Set; + type Topic = Set; + type DisplayName = St::DisplayName; type StartedAt = St::StartedAt; + type Actors = St::Actors; + } + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData St>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { + type PostCount = St::PostCount; + type Link = St::Link; type Topic = St::Topic; + type DisplayName = Set; + type StartedAt = St::StartedAt; + type Actors = St::Actors; } ///State transition - sets the `started_at` field to Set pub struct SetStartedAt(PhantomData St>); impl sealed::Sealed for SetStartedAt {} impl State for SetStartedAt { - type Actors = St::Actors; - type DisplayName = St::DisplayName; - type Link = St::Link; type PostCount = St::PostCount; - type StartedAt = Set; + type Link = St::Link; type Topic = St::Topic; - } - ///State transition - sets the `topic` field to Set - pub struct SetTopic(PhantomData St>); - impl sealed::Sealed for SetTopic {} - impl State for SetTopic { - type Actors = St::Actors; type DisplayName = St::DisplayName; - type Link = St::Link; + type StartedAt = Set; + type Actors = St::Actors; + } + ///State transition - sets the `actors` field to Set + pub struct SetActors(PhantomData St>); + impl sealed::Sealed for SetActors {} + impl State for SetActors { type PostCount = St::PostCount; + type Link = St::Link; + type Topic = St::Topic; + type DisplayName = St::DisplayName; type StartedAt = St::StartedAt; - type Topic = Set; + type Actors = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `actors` field - pub struct actors(()); - ///Marker type for the `display_name` field - pub struct display_name(()); - ///Marker type for the `link` field - pub struct link(()); ///Marker type for the `post_count` field pub struct post_count(()); - ///Marker type for the `started_at` field - pub struct started_at(()); + ///Marker type for the `link` field + pub struct link(()); ///Marker type for the `topic` field pub struct topic(()); + ///Marker type for the `display_name` field + pub struct display_name(()); + ///Marker type for the `started_at` field + pub struct started_at(()); + ///Marker type for the `actors` field + pub struct actors(()); } } @@ -2783,12 +2792,12 @@ where impl TrendViewBuilder where St: trend_view_state::State, - St::Actors: trend_view_state::IsSet, - St::DisplayName: trend_view_state::IsSet, - St::Link: trend_view_state::IsSet, St::PostCount: trend_view_state::IsSet, - St::StartedAt: trend_view_state::IsSet, + St::Link: trend_view_state::IsSet, St::Topic: trend_view_state::IsSet, + St::DisplayName: trend_view_state::IsSet, + St::StartedAt: trend_view_state::IsSet, + St::Actors: trend_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> TrendView { diff --git a/services/types/src/app_bsky/unspecced/get_post_thread_other_v2.rs b/services/types/src/app_bsky/unspecced/get_post_thread_other_v2.rs index 5f83811..94cf329 100644 --- a/services/types/src/app_bsky/unspecced/get_post_thread_other_v2.rs +++ b/services/types/src/app_bsky/unspecced/get_post_thread_other_v2.rs @@ -31,10 +31,6 @@ use crate::app_bsky::unspecced::get_post_thread_other_v2; #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct GetPostThreadOtherV2 { pub anchor: AtUri, - /// Defaults to `false`. - #[serde(default = "_default_prioritize_followed_users")] - #[serde(skip_serializing_if = "Option::is_none")] - pub prioritize_followed_users: Option, } @@ -98,10 +94,6 @@ impl LexiconSchema for ThreadItem { } } -fn _default_prioritize_followed_users() -> Option { - Some(false) -} - pub mod get_post_thread_other_v2_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; @@ -140,7 +132,7 @@ pub struct GetPostThreadOtherV2Builder< St: get_post_thread_other_v2_state::State, > { _state: PhantomData St>, - _fields: (Option>, Option), + _fields: (Option>,), _type: PhantomData S>, } @@ -159,7 +151,7 @@ impl GetPostThreadOtherV2Builder Self { GetPostThreadOtherV2Builder { _state: PhantomData, - _fields: (None, None), + _fields: (None,), _type: PhantomData, } } @@ -184,22 +176,6 @@ where } } -impl< - S: BosStr, - St: get_post_thread_other_v2_state::State, -> GetPostThreadOtherV2Builder { - /// Set the `prioritizeFollowedUsers` field (optional) - pub fn prioritize_followed_users(mut self, value: impl Into>) -> Self { - self._fields.1 = value.into(); - self - } - /// Set the `prioritizeFollowedUsers` field to an Option value (optional) - pub fn maybe_prioritize_followed_users(mut self, value: Option) -> Self { - self._fields.1 = value; - self - } -} - impl GetPostThreadOtherV2Builder where St: get_post_thread_other_v2_state::State, @@ -209,7 +185,6 @@ where pub fn build(self) -> GetPostThreadOtherV2 { GetPostThreadOtherV2 { anchor: self._fields.0.unwrap(), - prioritize_followed_users: self._fields.1, } } } @@ -224,51 +199,51 @@ pub mod thread_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Value; type Depth; type Uri; - type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Value = Unset; type Depth = Unset; type Uri = Unset; - type Value = Unset; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData St>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Value = Set; + type Depth = St::Depth; + type Uri = St::Uri; } ///State transition - sets the `depth` field to Set pub struct SetDepth(PhantomData St>); impl sealed::Sealed for SetDepth {} impl State for SetDepth { + type Value = St::Value; type Depth = Set; type Uri = St::Uri; - type Value = St::Value; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Depth = St::Depth; - type Uri = Set; type Value = St::Value; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData St>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { type Depth = St::Depth; - type Uri = St::Uri; - type Value = Set; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `depth` field pub struct depth(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `value` field - pub struct value(()); } } @@ -357,9 +332,9 @@ where impl ThreadItemBuilder where St: thread_item_state::State, + St::Value: thread_item_state::IsSet, St::Depth: thread_item_state::IsSet, St::Uri: thread_item_state::IsSet, - St::Value: thread_item_state::IsSet, { /// Build the final struct. pub fn build(self) -> ThreadItem { @@ -415,12 +390,6 @@ fn lexicon_doc_app_bsky_unspecced_getPostThreadOtherV2() -> LexiconDoc<'static> ..Default::default() }), ); - map.insert( - SmolStr::new_static("prioritizeFollowedUsers"), - LexXrpcParametersProperty::Boolean(LexBoolean { - ..Default::default() - }), - ); map }, ..Default::default() diff --git a/services/types/src/app_bsky/unspecced/get_post_thread_v2.rs b/services/types/src/app_bsky/unspecced/get_post_thread_v2.rs index af2398a..ae79803 100644 --- a/services/types/src/app_bsky/unspecced/get_post_thread_v2.rs +++ b/services/types/src/app_bsky/unspecced/get_post_thread_v2.rs @@ -47,10 +47,6 @@ pub struct GetPostThreadV2 { #[serde(default = "_default_branching_factor")] #[serde(skip_serializing_if = "Option::is_none")] pub branching_factor: Option, - /// Defaults to `false`. - #[serde(default = "_default_prioritize_followed_users")] - #[serde(skip_serializing_if = "Option::is_none")] - pub prioritize_followed_users: Option, ///Defaults to `"oldest"`. #[serde(default = "_default_sort")] #[serde(skip_serializing_if = "Option::is_none")] @@ -149,10 +145,6 @@ fn _default_branching_factor() -> Option { Some(10i64) } -fn _default_prioritize_followed_users() -> Option { - Some(false) -} - fn _default_sort() -> Option { Some(S::from_static("oldest")) } @@ -192,14 +184,7 @@ pub mod get_post_thread_v2_state { /// Builder for constructing an instance of this type. pub struct GetPostThreadV2Builder { _state: PhantomData St>, - _fields: ( - Option, - Option>, - Option, - Option, - Option, - Option, - ), + _fields: (Option, Option>, Option, Option, Option), _type: PhantomData S>, } @@ -215,7 +200,7 @@ impl GetPostThreadV2Builder { pub fn new() -> Self { GetPostThreadV2Builder { _state: PhantomData, - _fields: (None, None, None, None, None, None), + _fields: (None, None, None, None, None), _type: PhantomData, } } @@ -279,28 +264,15 @@ impl GetPostThreadV2Builder GetPostThreadV2Builder { - /// Set the `prioritizeFollowedUsers` field (optional) - pub fn prioritize_followed_users(mut self, value: impl Into>) -> Self { - self._fields.4 = value.into(); - self - } - /// Set the `prioritizeFollowedUsers` field to an Option value (optional) - pub fn maybe_prioritize_followed_users(mut self, value: Option) -> Self { - self._fields.4 = value; - self - } -} - impl GetPostThreadV2Builder { /// Set the `sort` field (optional) pub fn sort(mut self, value: impl Into>) -> Self { - self._fields.5 = value.into(); + self._fields.4 = value.into(); self } /// Set the `sort` field to an Option value (optional) pub fn maybe_sort(mut self, value: Option) -> Self { - self._fields.5 = value; + self._fields.4 = value; self } } @@ -317,8 +289,7 @@ where anchor: self._fields.1.unwrap(), below: self._fields.2, branching_factor: self._fields.3, - prioritize_followed_users: self._fields.4, - sort: self._fields.5, + sort: self._fields.4, } } } @@ -333,51 +304,51 @@ pub mod thread_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Depth; - type Uri; type Value; + type Uri; + type Depth; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Depth = Unset; - type Uri = Unset; type Value = Unset; + type Uri = Unset; + type Depth = Unset; } - ///State transition - sets the `depth` field to Set - pub struct SetDepth(PhantomData St>); - impl sealed::Sealed for SetDepth {} - impl State for SetDepth { - type Depth = Set; + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData St>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Value = Set; type Uri = St::Uri; - type Value = St::Value; + type Depth = St::Depth; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Depth = St::Depth; - type Uri = Set; type Value = St::Value; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData St>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { + type Uri = Set; type Depth = St::Depth; + } + ///State transition - sets the `depth` field to Set + pub struct SetDepth(PhantomData St>); + impl sealed::Sealed for SetDepth {} + impl State for SetDepth { + type Value = St::Value; type Uri = St::Uri; - type Value = Set; + type Depth = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `depth` field - pub struct depth(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `depth` field + pub struct depth(()); } } @@ -466,9 +437,9 @@ where impl ThreadItemBuilder where St: thread_item_state::State, - St::Depth: thread_item_state::IsSet, - St::Uri: thread_item_state::IsSet, St::Value: thread_item_state::IsSet, + St::Uri: thread_item_state::IsSet, + St::Depth: thread_item_state::IsSet, { /// Build the final struct. pub fn build(self) -> ThreadItem { @@ -542,12 +513,6 @@ fn lexicon_doc_app_bsky_unspecced_getPostThreadV2() -> LexiconDoc<'static> { ..Default::default() }), ); - map.insert( - SmolStr::new_static("prioritizeFollowedUsers"), - LexXrpcParametersProperty::Boolean(LexBoolean { - ..Default::default() - }), - ); map.insert( SmolStr::new_static("sort"), LexXrpcParametersProperty::String(LexString { diff --git a/services/types/src/app_bsky/unspecced/get_suggested_users.rs b/services/types/src/app_bsky/unspecced/get_suggested_users.rs index f66b02a..60dded3 100644 --- a/services/types/src/app_bsky/unspecced/get_suggested_users.rs +++ b/services/types/src/app_bsky/unspecced/get_suggested_users.rs @@ -33,6 +33,12 @@ pub struct GetSuggestedUsers { #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct GetSuggestedUsersOutput { pub actors: Vec>, + ///DEPRECATED: use recIdStr instead. + #[serde(skip_serializing_if = "Option::is_none")] + pub rec_id: Option, + ///Snowflake for this recommendation, use when submitting recommendation events. + #[serde(skip_serializing_if = "Option::is_none")] + pub rec_id_str: Option, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } diff --git a/services/types/src/app_bsky/unspecced/get_suggested_users_skeleton.rs b/services/types/src/app_bsky/unspecced/get_suggested_users_skeleton.rs index 2f880ed..be8350d 100644 --- a/services/types/src/app_bsky/unspecced/get_suggested_users_skeleton.rs +++ b/services/types/src/app_bsky/unspecced/get_suggested_users_skeleton.rs @@ -35,6 +35,12 @@ pub struct GetSuggestedUsersSkeleton { #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct GetSuggestedUsersSkeletonOutput { pub dids: Vec>, + ///DEPRECATED: use recIdStr instead. + #[serde(skip_serializing_if = "Option::is_none")] + pub rec_id: Option, + ///Snowflake for this recommendation, use when submitting recommendation events. + #[serde(skip_serializing_if = "Option::is_none")] + pub rec_id_str: Option, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } diff --git a/services/types/src/app_bsky/unspecced/get_suggestions_skeleton.rs b/services/types/src/app_bsky/unspecced/get_suggestions_skeleton.rs index 7f83f80..c489110 100644 --- a/services/types/src/app_bsky/unspecced/get_suggestions_skeleton.rs +++ b/services/types/src/app_bsky/unspecced/get_suggestions_skeleton.rs @@ -40,9 +40,12 @@ pub struct GetSuggestionsSkeletonOutput { pub actors: Vec>, #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, - ///Snowflake for this recommendation, use when submitting recommendation events. + ///DEPRECATED: use recIdStr instead. #[serde(skip_serializing_if = "Option::is_none")] pub rec_id: Option, + ///Snowflake for this recommendation, use when submitting recommendation events. + #[serde(skip_serializing_if = "Option::is_none")] + pub rec_id_str: Option, ///DID of the account these suggestions are relative to. If this is returned undefined, suggestions are based on the viewer. #[serde(skip_serializing_if = "Option::is_none")] pub relative_to_did: Option>, diff --git a/services/types/src/app_bsky/unspecced/get_tagged_suggestions.rs b/services/types/src/app_bsky/unspecced/get_tagged_suggestions.rs index 5a8c232..0ec71d6 100644 --- a/services/types/src/app_bsky/unspecced/get_tagged_suggestions.rs +++ b/services/types/src/app_bsky/unspecced/get_tagged_suggestions.rs @@ -178,51 +178,51 @@ pub mod suggestion_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type SubjectType; type Tag; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type SubjectType = Unset; type Tag = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData St>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type SubjectType = St::SubjectType; - type Tag = St::Tag; + type Subject = Unset; } ///State transition - sets the `subject_type` field to Set pub struct SetSubjectType(PhantomData St>); impl sealed::Sealed for SetSubjectType {} impl State for SetSubjectType { - type Subject = St::Subject; type SubjectType = Set; type Tag = St::Tag; + type Subject = St::Subject; } ///State transition - sets the `tag` field to Set pub struct SetTag(PhantomData St>); impl sealed::Sealed for SetTag {} impl State for SetTag { - type Subject = St::Subject; type SubjectType = St::SubjectType; type Tag = Set; + type Subject = St::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData St>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type SubjectType = St::SubjectType; + type Tag = St::Tag; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `subject_type` field pub struct subject_type(()); ///Marker type for the `tag` field pub struct tag(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -311,9 +311,9 @@ where impl SuggestionBuilder where St: suggestion_state::State, - St::Subject: suggestion_state::IsSet, St::SubjectType: suggestion_state::IsSet, St::Tag: suggestion_state::IsSet, + St::Subject: suggestion_state::IsSet, { /// Build the final struct. pub fn build(self) -> Suggestion { diff --git a/services/types/src/app_bsky/video.rs b/services/types/src/app_bsky/video.rs index 96d1363..7c87c26 100644 --- a/services/types/src/app_bsky/video.rs +++ b/services/types/src/app_bsky/video.rs @@ -173,51 +173,51 @@ pub mod job_status_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type JobId; type State; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type JobId = Unset; type State = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type JobId = St::JobId; - type State = St::State; + type Did = Unset; } ///State transition - sets the `job_id` field to Set pub struct SetJobId(PhantomData St>); impl sealed::Sealed for SetJobId {} impl State for SetJobId { - type Did = St::Did; type JobId = Set; type State = St::State; + type Did = St::Did; } ///State transition - sets the `state` field to Set pub struct SetState(PhantomData St>); impl sealed::Sealed for SetState {} impl State for SetState { - type Did = St::Did; type JobId = St::JobId; type State = Set; + type Did = St::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type JobId = St::JobId; + type State = St::State; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `job_id` field pub struct job_id(()); ///Marker type for the `state` field pub struct state(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -366,9 +366,9 @@ where impl JobStatusBuilder where St: job_status_state::State, - St::Did: job_status_state::IsSet, St::JobId: job_status_state::IsSet, St::State: job_status_state::IsSet, + St::Did: job_status_state::IsSet, { /// Build the final struct. pub fn build(self) -> JobStatus { diff --git a/services/types/src/chat_bsky.rs b/services/types/src/chat_bsky.rs index a47a07d..77d4501 100644 --- a/services/types/src/chat_bsky.rs +++ b/services/types/src/chat_bsky.rs @@ -4,5 +4,9 @@ // Any manual changes will be overwritten on the next regeneration. pub mod actor; +pub mod auth_full_chat_client; pub mod convo; -pub mod moderation; \ No newline at end of file +pub mod embed; +pub mod group; +pub mod moderation; +pub mod notification; \ No newline at end of file diff --git a/services/types/src/chat_bsky/actor.rs b/services/types/src/chat_bsky/actor.rs index c6f9fc3..4cdac0e 100644 --- a/services/types/src/chat_bsky/actor.rs +++ b/services/types/src/chat_bsky/actor.rs @@ -8,6 +8,7 @@ pub mod declaration; pub mod delete_account; pub mod export_account_data; +pub mod get_status; #[allow(unused_imports)] @@ -20,9 +21,9 @@ use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; #[allow(unused_imports)] use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation; use jacquard_common::deps::smol_str::SmolStr; -use jacquard_common::types::string::{Did, Handle, UriValue}; +use jacquard_common::types::string::{Did, Handle, Datetime, UriValue}; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use jacquard_lexicon::lexicon::LexiconDoc; use jacquard_lexicon::schema::LexiconSchema; @@ -33,6 +34,110 @@ use crate::app_bsky::actor::ProfileAssociated; use crate::app_bsky::actor::VerificationState; use crate::app_bsky::actor::ViewerState; use crate::com_atproto::label::Label; +use crate::chat_bsky::actor; + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct DirectConvoMember { + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// A current group convo member. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct GroupConvoMember { + ///Who added this member. Only present if the member was added (instead of joining via link). + #[serde(skip_serializing_if = "Option::is_none")] + pub added_by: Option>, + ///The member's role within this conversation. Only present in group conversation member lists. + pub role: actor::MemberRole, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum MemberRole { + Owner, + Standard, + Other(S), +} + +impl MemberRole { + pub fn as_str(&self) -> &str { + match self { + Self::Owner => "owner", + Self::Standard => "standard", + Self::Other(s) => s.as_ref(), + } + } + /// Construct from a string-like value, matching known values. + pub fn from_value(s: S) -> Self { + match s.as_ref() { + "owner" => Self::Owner, + "standard" => Self::Standard, + _ => Self::Other(s), + } + } +} + +impl AsRef for MemberRole { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl core::fmt::Display for MemberRole { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl Serialize for MemberRole { + fn serialize(&self, serializer: Ser) -> Result + where + Ser: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for MemberRole { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = S::deserialize(deserializer)?; + Ok(Self::from_value(s)) + } +} + +impl jacquard_common::IntoStatic for MemberRole +where + S: BosStr + jacquard_common::IntoStatic, + S::Output: BosStr, +{ + type Output = MemberRole; + fn into_static(self) -> Self::Output { + match self { + MemberRole::Owner => MemberRole::Owner, + MemberRole::Standard => MemberRole::Standard, + MemberRole::Other(v) => MemberRole::Other(v.into_static()), + } + } +} + +/// A past group convo member. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct PastGroupConvoMember { + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -44,10 +149,15 @@ pub struct ProfileViewBasic { ///Set to true when the actor cannot actively participate in conversations #[serde(skip_serializing_if = "Option::is_none")] pub chat_disabled: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub created_at: Option, pub did: Did, #[serde(skip_serializing_if = "Option::is_none")] pub display_name: Option, pub handle: Handle, + ///Union field that has data specific to different kinds of convos. + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option>, #[serde(skip_serializing_if = "Option::is_none")] pub labels: Option>>, #[serde(skip_serializing_if = "Option::is_none")] @@ -58,6 +168,64 @@ pub struct ProfileViewBasic { pub extra_data: Option>>, } + +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum ProfileViewBasicKind { + #[serde(rename = "chat.bsky.actor.defs#directConvoMember")] + DirectConvoMember(Box>), + #[serde(rename = "chat.bsky.actor.defs#groupConvoMember")] + GroupConvoMember(Box>), + #[serde(rename = "chat.bsky.actor.defs#pastGroupConvoMember")] + PastGroupConvoMember(Box>), +} + +impl LexiconSchema for DirectConvoMember { + fn nsid() -> &'static str { + "chat.bsky.actor.defs" + } + fn def_name() -> &'static str { + "directConvoMember" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_actor_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for GroupConvoMember { + fn nsid() -> &'static str { + "chat.bsky.actor.defs" + } + fn def_name() -> &'static str { + "groupConvoMember" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_actor_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for PastGroupConvoMember { + fn nsid() -> &'static str { + "chat.bsky.actor.defs" + } + fn def_name() -> &'static str { + "pastGroupConvoMember" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_actor_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + impl LexiconSchema for ProfileViewBasic { fn nsid() -> &'static str { "chat.bsky.actor.defs" @@ -95,6 +263,306 @@ impl LexiconSchema for ProfileViewBasic { } } +fn lexicon_doc_chat_bsky_actor_defs() -> LexiconDoc<'static> { + #[allow(unused_imports)] + use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType}; + use jacquard_lexicon::lexicon::*; + use alloc::collections::BTreeMap; + LexiconDoc { + lexicon: Lexicon::Lexicon1, + id: CowStr::new_static("chat.bsky.actor.defs"), + defs: { + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("directConvoMember"), + LexUserType::Object(LexObject { + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("groupConvoMember"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static("A current group convo member."), + ), + required: Some(vec![SmolStr::new_static("role")]), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("addedBy"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#profileViewBasic"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("role"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#memberRole"), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("memberRole"), + LexUserType::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("pastGroupConvoMember"), + LexUserType::Object(LexObject { + description: Some(CowStr::new_static("A past group convo member.")), + required: Some(vec![]), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("profileViewBasic"), + LexUserType::Object(LexObject { + required: Some( + vec![SmolStr::new_static("did"), SmolStr::new_static("handle")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("associated"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "app.bsky.actor.defs#profileAssociated", + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("avatar"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Uri), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("chatDisabled"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("createdAt"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("did"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Did), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("displayName"), + LexObjectProperty::String(LexString { + max_length: Some(640usize), + max_graphemes: Some(64usize), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("handle"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Handle), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("kind"), + LexObjectProperty::Union(LexRefUnion { + description: Some( + CowStr::new_static( + "Union field that has data specific to different kinds of convos.", + ), + ), + refs: vec![ + CowStr::new_static("#directConvoMember"), + CowStr::new_static("#groupConvoMember"), + CowStr::new_static("#pastGroupConvoMember") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("labels"), + LexObjectProperty::Array(LexArray { + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static("com.atproto.label.defs#label"), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("verification"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "app.bsky.actor.defs#verificationState", + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("viewer"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "app.bsky.actor.defs#viewerState", + ), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map + }, + ..Default::default() + } +} + +pub mod group_convo_member_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Role; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Role = Unset; + } + ///State transition - sets the `role` field to Set + pub struct SetRole(PhantomData St>); + impl sealed::Sealed for SetRole {} + impl State for SetRole { + type Role = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `role` field + pub struct role(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct GroupConvoMemberBuilder { + _state: PhantomData St>, + _fields: (Option>, Option>), + _type: PhantomData S>, +} + +impl GroupConvoMember { + /// Create a new builder for this type. + pub fn new() -> GroupConvoMemberBuilder { + GroupConvoMemberBuilder::new() + } +} + +impl GroupConvoMemberBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + GroupConvoMemberBuilder { + _state: PhantomData, + _fields: (None, None), + _type: PhantomData, + } + } +} + +impl GroupConvoMemberBuilder { + /// Set the `addedBy` field (optional) + pub fn added_by( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `addedBy` field to an Option value (optional) + pub fn maybe_added_by(mut self, value: Option>) -> Self { + self._fields.0 = value; + self + } +} + +impl GroupConvoMemberBuilder +where + St: group_convo_member_state::State, + St::Role: group_convo_member_state::IsUnset, +{ + /// Set the `role` field (required) + pub fn role( + mut self, + value: impl Into>, + ) -> GroupConvoMemberBuilder> { + self._fields.1 = Option::Some(value.into()); + GroupConvoMemberBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoMemberBuilder +where + St: group_convo_member_state::State, + St::Role: group_convo_member_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> GroupConvoMember { + GroupConvoMember { + added_by: self._fields.0, + role: self._fields.1.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> GroupConvoMember { + GroupConvoMember { + added_by: self._fields.0, + role: self._fields.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + pub mod profile_view_basic_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; @@ -146,9 +614,11 @@ pub struct ProfileViewBasicBuilder>, Option>, Option, + Option, Option>, Option, Option>, + Option>, Option>>, Option>, Option>, @@ -168,7 +638,7 @@ impl ProfileViewBasicBuilder { pub fn new() -> Self { ProfileViewBasicBuilder { _state: PhantomData, - _fields: (None, None, None, None, None, None, None, None, None), + _fields: (None, None, None, None, None, None, None, None, None, None, None), _type: PhantomData, } } @@ -213,6 +683,19 @@ impl ProfileViewBasicBuilder ProfileViewBasicBuilder { + /// Set the `createdAt` field (optional) + pub fn created_at(mut self, value: impl Into>) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `createdAt` field to an Option value (optional) + pub fn maybe_created_at(mut self, value: Option) -> Self { + self._fields.3 = value; + self + } +} + impl ProfileViewBasicBuilder where St: profile_view_basic_state::State, @@ -223,7 +706,7 @@ where mut self, value: impl Into>, ) -> ProfileViewBasicBuilder> { - self._fields.3 = Option::Some(value.into()); + self._fields.4 = Option::Some(value.into()); ProfileViewBasicBuilder { _state: PhantomData, _fields: self._fields, @@ -235,12 +718,12 @@ where impl ProfileViewBasicBuilder { /// Set the `displayName` field (optional) pub fn display_name(mut self, value: impl Into>) -> Self { - self._fields.4 = value.into(); + self._fields.5 = value.into(); self } /// Set the `displayName` field to an Option value (optional) pub fn maybe_display_name(mut self, value: Option) -> Self { - self._fields.4 = value; + self._fields.5 = value; self } } @@ -255,7 +738,7 @@ where mut self, value: impl Into>, ) -> ProfileViewBasicBuilder> { - self._fields.5 = Option::Some(value.into()); + self._fields.6 = Option::Some(value.into()); ProfileViewBasicBuilder { _state: PhantomData, _fields: self._fields, @@ -264,15 +747,28 @@ where } } +impl ProfileViewBasicBuilder { + /// Set the `kind` field (optional) + pub fn kind(mut self, value: impl Into>>) -> Self { + self._fields.7 = value.into(); + self + } + /// Set the `kind` field to an Option value (optional) + pub fn maybe_kind(mut self, value: Option>) -> Self { + self._fields.7 = value; + self + } +} + impl ProfileViewBasicBuilder { /// Set the `labels` field (optional) pub fn labels(mut self, value: impl Into>>>) -> Self { - self._fields.6 = value.into(); + self._fields.8 = value.into(); self } /// Set the `labels` field to an Option value (optional) pub fn maybe_labels(mut self, value: Option>>) -> Self { - self._fields.6 = value; + self._fields.8 = value; self } } @@ -283,12 +779,12 @@ impl ProfileViewBasicBuilder>>, ) -> Self { - self._fields.7 = value.into(); + self._fields.9 = value.into(); self } /// Set the `verification` field to an Option value (optional) pub fn maybe_verification(mut self, value: Option>) -> Self { - self._fields.7 = value; + self._fields.9 = value; self } } @@ -296,12 +792,12 @@ impl ProfileViewBasicBuilder ProfileViewBasicBuilder { /// Set the `viewer` field (optional) pub fn viewer(mut self, value: impl Into>>) -> Self { - self._fields.8 = value.into(); + self._fields.10 = value.into(); self } /// Set the `viewer` field to an Option value (optional) pub fn maybe_viewer(mut self, value: Option>) -> Self { - self._fields.8 = value; + self._fields.10 = value; self } } @@ -318,12 +814,14 @@ where associated: self._fields.0, avatar: self._fields.1, chat_disabled: self._fields.2, - did: self._fields.3.unwrap(), - display_name: self._fields.4, - handle: self._fields.5.unwrap(), - labels: self._fields.6, - verification: self._fields.7, - viewer: self._fields.8, + created_at: self._fields.3, + did: self._fields.4.unwrap(), + display_name: self._fields.5, + handle: self._fields.6.unwrap(), + kind: self._fields.7, + labels: self._fields.8, + verification: self._fields.9, + viewer: self._fields.10, extra_data: Default::default(), } } @@ -336,115 +834,15 @@ where associated: self._fields.0, avatar: self._fields.1, chat_disabled: self._fields.2, - did: self._fields.3.unwrap(), - display_name: self._fields.4, - handle: self._fields.5.unwrap(), - labels: self._fields.6, - verification: self._fields.7, - viewer: self._fields.8, + created_at: self._fields.3, + did: self._fields.4.unwrap(), + display_name: self._fields.5, + handle: self._fields.6.unwrap(), + kind: self._fields.7, + labels: self._fields.8, + verification: self._fields.9, + viewer: self._fields.10, extra_data: Some(extra_data), } } -} - -fn lexicon_doc_chat_bsky_actor_defs() -> LexiconDoc<'static> { - #[allow(unused_imports)] - use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType}; - use jacquard_lexicon::lexicon::*; - use alloc::collections::BTreeMap; - LexiconDoc { - lexicon: Lexicon::Lexicon1, - id: CowStr::new_static("chat.bsky.actor.defs"), - defs: { - let mut map = BTreeMap::new(); - map.insert( - SmolStr::new_static("profileViewBasic"), - LexUserType::Object(LexObject { - required: Some( - vec![SmolStr::new_static("did"), SmolStr::new_static("handle")], - ), - properties: { - #[allow(unused_mut)] - let mut map = BTreeMap::new(); - map.insert( - SmolStr::new_static("associated"), - LexObjectProperty::Ref(LexRef { - r#ref: CowStr::new_static( - "app.bsky.actor.defs#profileAssociated", - ), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("avatar"), - LexObjectProperty::String(LexString { - format: Some(LexStringFormat::Uri), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("chatDisabled"), - LexObjectProperty::Boolean(LexBoolean { - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("did"), - LexObjectProperty::String(LexString { - format: Some(LexStringFormat::Did), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("displayName"), - LexObjectProperty::String(LexString { - max_length: Some(640usize), - max_graphemes: Some(64usize), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("handle"), - LexObjectProperty::String(LexString { - format: Some(LexStringFormat::Handle), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("labels"), - LexObjectProperty::Array(LexArray { - items: LexArrayItem::Ref(LexRef { - r#ref: CowStr::new_static("com.atproto.label.defs#label"), - ..Default::default() - }), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("verification"), - LexObjectProperty::Ref(LexRef { - r#ref: CowStr::new_static( - "app.bsky.actor.defs#verificationState", - ), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("viewer"), - LexObjectProperty::Ref(LexRef { - r#ref: CowStr::new_static( - "app.bsky.actor.defs#viewerState", - ), - ..Default::default() - }), - ); - map - }, - ..Default::default() - }), - ); - map - }, - ..Default::default() - } } \ No newline at end of file diff --git a/services/types/src/chat_bsky/actor/declaration.rs b/services/types/src/chat_bsky/actor/declaration.rs index 0783c87..c4131d5 100644 --- a/services/types/src/chat_bsky/actor/declaration.rs +++ b/services/types/src/chat_bsky/actor/declaration.rs @@ -37,11 +37,102 @@ use serde::{Serialize, Deserialize}; bound(deserialize = "S: Deserialize<'de> + BosStr") )] pub struct Declaration { + ///Declaration about group chat invitation preferences for the record owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub allow_group_invites: Option>, pub allow_incoming: DeclarationAllowIncoming, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } +/// Declaration about group chat invitation preferences for the record owner. + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum DeclarationAllowGroupInvites { + All, + None, + Following, + Other(S), +} + +impl DeclarationAllowGroupInvites { + pub fn as_str(&self) -> &str { + match self { + Self::All => "all", + Self::None => "none", + Self::Following => "following", + Self::Other(s) => s.as_ref(), + } + } + /// Construct from a string-like value, matching known values. + pub fn from_value(s: S) -> Self { + match s.as_ref() { + "all" => Self::All, + "none" => Self::None, + "following" => Self::Following, + _ => Self::Other(s), + } + } +} + +impl core::fmt::Display for DeclarationAllowGroupInvites { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl AsRef for DeclarationAllowGroupInvites { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl Serialize for DeclarationAllowGroupInvites { + fn serialize(&self, serializer: Ser) -> Result + where + Ser: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> +for DeclarationAllowGroupInvites { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = S::deserialize(deserializer)?; + Ok(Self::from_value(s)) + } +} + +impl Default for DeclarationAllowGroupInvites { + fn default() -> Self { + Self::Other(Default::default()) + } +} + +impl jacquard_common::IntoStatic for DeclarationAllowGroupInvites +where + S: BosStr + jacquard_common::IntoStatic, + S::Output: BosStr, +{ + type Output = DeclarationAllowGroupInvites; + fn into_static(self) -> Self::Output { + match self { + DeclarationAllowGroupInvites::All => DeclarationAllowGroupInvites::All, + DeclarationAllowGroupInvites::None => DeclarationAllowGroupInvites::None, + DeclarationAllowGroupInvites::Following => { + DeclarationAllowGroupInvites::Following + } + DeclarationAllowGroupInvites::Other(v) => { + DeclarationAllowGroupInvites::Other(v.into_static()) + } + } + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum DeclarationAllowIncoming { @@ -221,7 +312,10 @@ pub mod declaration_state { /// Builder for constructing an instance of this type. pub struct DeclarationBuilder { _state: PhantomData St>, - _fields: (Option>,), + _fields: ( + Option>, + Option>, + ), _type: PhantomData S>, } @@ -237,12 +331,31 @@ impl DeclarationBuilder { pub fn new() -> Self { DeclarationBuilder { _state: PhantomData, - _fields: (None,), + _fields: (None, None), _type: PhantomData, } } } +impl DeclarationBuilder { + /// Set the `allowGroupInvites` field (optional) + pub fn allow_group_invites( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `allowGroupInvites` field to an Option value (optional) + pub fn maybe_allow_group_invites( + mut self, + value: Option>, + ) -> Self { + self._fields.0 = value; + self + } +} + impl DeclarationBuilder where St: declaration_state::State, @@ -253,7 +366,7 @@ where mut self, value: impl Into>, ) -> DeclarationBuilder> { - self._fields.0 = Option::Some(value.into()); + self._fields.1 = Option::Some(value.into()); DeclarationBuilder { _state: PhantomData, _fields: self._fields, @@ -270,7 +383,8 @@ where /// Build the final struct. pub fn build(self) -> Declaration { Declaration { - allow_incoming: self._fields.0.unwrap(), + allow_group_invites: self._fields.0, + allow_incoming: self._fields.1.unwrap(), extra_data: Default::default(), } } @@ -280,7 +394,8 @@ where extra_data: BTreeMap>, ) -> Declaration { Declaration { - allow_incoming: self._fields.0.unwrap(), + allow_group_invites: self._fields.0, + allow_incoming: self._fields.1.unwrap(), extra_data: Some(extra_data), } } @@ -308,6 +423,17 @@ fn lexicon_doc_chat_bsky_actor_declaration() -> LexiconDoc<'static> { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("allowGroupInvites"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Declaration about group chat invitation preferences for the record owner.", + ), + ), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("allowIncoming"), LexObjectProperty::String(LexString { diff --git a/services/types/src/chat_bsky/convo.rs b/services/types/src/chat_bsky/convo.rs index f1155f2..4faa30d 100644 --- a/services/types/src/chat_bsky/convo.rs +++ b/services/types/src/chat_bsky/convo.rs @@ -11,14 +11,19 @@ pub mod delete_message_for_self; pub mod get_convo; pub mod get_convo_availability; pub mod get_convo_for_members; +pub mod get_convo_members; pub mod get_log; pub mod get_messages; +pub mod get_unread_counts; pub mod leave_convo; +pub mod list_convo_requests; pub mod list_convos; +pub mod lock_convo; pub mod mute_convo; pub mod remove_reaction; pub mod send_message; pub mod send_message_batch; +pub mod unlock_convo; pub mod unmute_convo; pub mod update_all_read; pub mod update_read; @@ -44,49 +49,181 @@ use jacquard_lexicon::schema::LexiconSchema; use jacquard_lexicon::validation::{ConstraintError, ValidationPath}; use serde::{Serialize, Deserialize}; use crate::app_bsky::embed::record::Record; -use crate::app_bsky::embed::record::View; use crate::app_bsky::richtext::facet::Facet; +use crate::chat_bsky::actor::MemberRole; use crate::chat_bsky::actor::ProfileViewBasic; +use crate::chat_bsky::embed::join_link::JoinLink; +use crate::chat_bsky::group::JoinLinkView; +use crate::app_bsky::embed::record; use crate::chat_bsky::convo; +use crate::chat_bsky::embed::join_link; -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] -#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] -pub struct ConvoView { - pub id: S, - #[serde(skip_serializing_if = "Option::is_none")] - pub last_message: Option>, - #[serde(skip_serializing_if = "Option::is_none")] - pub last_reaction: Option>, - pub members: Vec>, - pub muted: bool, - pub rev: S, - #[serde(skip_serializing_if = "Option::is_none")] - pub status: Option>, - pub unread_count: i64, - #[serde(flatten, default, skip_serializing_if = "Option::is_none")] - pub extra_data: Option>>, +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ConvoKind { + Direct, + Group, + Other(S), +} + +impl ConvoKind { + pub fn as_str(&self) -> &str { + match self { + Self::Direct => "direct", + Self::Group => "group", + Self::Other(s) => s.as_ref(), + } + } + /// Construct from a string-like value, matching known values. + pub fn from_value(s: S) -> Self { + match s.as_ref() { + "direct" => Self::Direct, + "group" => Self::Group, + _ => Self::Other(s), + } + } +} + +impl AsRef for ConvoKind { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl core::fmt::Display for ConvoKind { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl Serialize for ConvoKind { + fn serialize(&self, serializer: Ser) -> Result + where + Ser: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ConvoKind { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = S::deserialize(deserializer)?; + Ok(Self::from_value(s)) + } +} + +impl jacquard_common::IntoStatic for ConvoKind +where + S: BosStr + jacquard_common::IntoStatic, + S::Output: BosStr, +{ + type Output = ConvoKind; + fn into_static(self) -> Self::Output { + match self { + ConvoKind::Direct => ConvoKind::Direct, + ConvoKind::Group => ConvoKind::Group, + ConvoKind::Other(v) => ConvoKind::Other(v.into_static()), + } + } +} + + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ConvoLockStatus { + Unlocked, + Locked, + LockedPermanently, + Other(S), +} + +impl ConvoLockStatus { + pub fn as_str(&self) -> &str { + match self { + Self::Unlocked => "unlocked", + Self::Locked => "locked", + Self::LockedPermanently => "locked-permanently", + Self::Other(s) => s.as_ref(), + } + } + /// Construct from a string-like value, matching known values. + pub fn from_value(s: S) -> Self { + match s.as_ref() { + "unlocked" => Self::Unlocked, + "locked" => Self::Locked, + "locked-permanently" => Self::LockedPermanently, + _ => Self::Other(s), + } + } +} + +impl AsRef for ConvoLockStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl core::fmt::Display for ConvoLockStatus { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl Serialize for ConvoLockStatus { + fn serialize(&self, serializer: Ser) -> Result + where + Ser: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ConvoLockStatus { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = S::deserialize(deserializer)?; + Ok(Self::from_value(s)) + } +} + +impl jacquard_common::IntoStatic for ConvoLockStatus +where + S: BosStr + jacquard_common::IntoStatic, + S::Output: BosStr, +{ + type Output = ConvoLockStatus; + fn into_static(self) -> Self::Output { + match self { + ConvoLockStatus::Unlocked => ConvoLockStatus::Unlocked, + ConvoLockStatus::Locked => ConvoLockStatus::Locked, + ConvoLockStatus::LockedPermanently => ConvoLockStatus::LockedPermanently, + ConvoLockStatus::Other(v) => ConvoLockStatus::Other(v.into_static()), + } + } } -#[open_union] #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] -#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] -pub enum ConvoViewLastMessage { - #[serde(rename = "chat.bsky.convo.defs#messageView")] - MessageView(Box>), - #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] - DeletedMessageView(Box>), +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ConvoRef { + pub convo_id: S, + pub did: Did, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, } #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub enum ConvoViewStatus { +pub enum ConvoStatus { Request, Accepted, Other(S), } -impl ConvoViewStatus { +impl ConvoStatus { pub fn as_str(&self) -> &str { match self { Self::Request => "request", @@ -104,19 +241,19 @@ impl ConvoViewStatus { } } -impl core::fmt::Display for ConvoViewStatus { - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(f, "{}", self.as_str()) +impl AsRef for ConvoStatus { + fn as_ref(&self) -> &str { + self.as_str() } } -impl AsRef for ConvoViewStatus { - fn as_ref(&self) -> &str { - self.as_str() +impl core::fmt::Display for ConvoStatus { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) } } -impl Serialize for ConvoViewStatus { +impl Serialize for ConvoStatus { fn serialize(&self, serializer: Ser) -> Result where Ser: serde::Serializer, @@ -125,7 +262,7 @@ impl Serialize for ConvoViewStatus { } } -impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ConvoViewStatus { +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ConvoStatus { fn deserialize(deserializer: D) -> Result where D: serde::Deserializer<'de>, @@ -135,28 +272,70 @@ impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> for ConvoViewStatus } } -impl Default for ConvoViewStatus { - fn default() -> Self { - Self::Other(Default::default()) - } -} - -impl jacquard_common::IntoStatic for ConvoViewStatus +impl jacquard_common::IntoStatic for ConvoStatus where S: BosStr + jacquard_common::IntoStatic, S::Output: BosStr, { - type Output = ConvoViewStatus; + type Output = ConvoStatus; fn into_static(self) -> Self::Output { match self { - ConvoViewStatus::Request => ConvoViewStatus::Request, - ConvoViewStatus::Accepted => ConvoViewStatus::Accepted, - ConvoViewStatus::Other(v) => ConvoViewStatus::Other(v.into_static()), + ConvoStatus::Request => ConvoStatus::Request, + ConvoStatus::Accepted => ConvoStatus::Accepted, + ConvoStatus::Other(v) => ConvoStatus::Other(v.into_static()), } } } +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ConvoView { + pub id: S, + ///Union field that has data specific to different kinds of convos. + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub last_message: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub last_reaction: Option>, + ///Members of this conversation. For direct convos, it will be an immutable list of the 2 members. For group convos, it will a list of important members (the first few members, the viewer, the member who added the viewer, the member who sent the last message, the member who sent the last reaction), but will not contain the full list of members. Use chat.bsky.convo.getConvoMembers to list all members. + pub members: Vec>, + pub muted: bool, + pub rev: S, + ///Convo status for the viewer member (not the convo itself). + #[serde(skip_serializing_if = "Option::is_none")] + pub status: Option>, + pub unread_count: i64, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum ConvoViewKind { + #[serde(rename = "chat.bsky.convo.defs#directConvo")] + DirectConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#groupConvo")] + GroupConvo(Box>), +} + + +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum ConvoViewLastMessage { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageView")] + SystemMessageView(Box>), +} + + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct DeletedMessageView { @@ -169,6 +348,42 @@ pub struct DeletedMessageView { } +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct DirectConvo { + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct GroupConvo { + pub created_at: Datetime, + #[serde(skip_serializing_if = "Option::is_none")] + pub join_link: Option>, + ///The total number of pending join requests for the group conversation. Only present for the owner. Capped at 21. + #[serde(skip_serializing_if = "Option::is_none")] + pub join_request_count: Option, + ///The lock status of the conversation. + pub lock_status: convo::ConvoLockStatus, + ///Whether the lock status is being forced by a moderation override (account inactivation or convo takedown) rather than the owner's own setting. + pub lock_status_moderation_override: bool, + ///The total number of members in the group conversation. + pub member_count: i64, + ///The maximum number of members allowed in the group conversation. + pub member_limit: i64, + ///The display name of the group conversation. + pub name: S, + ///The number of unread join requests for the group conversation. Only present for the owner. + #[serde(skip_serializing_if = "Option::is_none")] + pub unread_join_request_count: Option, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating the viewer accepted a convo, and it can be moved out of the request inbox. Can be direct or group. + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct LogAcceptConvo { @@ -178,6 +393,22 @@ pub struct LogAcceptConvo { pub extra_data: Option>>, } +/// Event indicating a member was added to a group convo. The member who was added gets a logBeginConvo (to create the convo) but also a logAddMember (to show the system message as the first message the user sees). + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogAddMember { + pub convo_id: S, + ///A system message with data of type #systemMessageDataAddMember + pub message: convo::SystemMessageView, + ///Profiles referred in the system message. + pub related_profiles: Vec>, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a reaction was added to a message. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -185,6 +416,9 @@ pub struct LogAddReaction { pub convo_id: S, pub message: LogAddReactionMessage, pub reaction: convo::ReactionView, + ///Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present. + #[serde(skip_serializing_if = "Option::is_none")] + pub related_profiles: Option>>, pub rev: S, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, @@ -201,6 +435,20 @@ pub enum LogAddReactionMessage { DeletedMessageView(Box>), } +/// Event indicating a join request was approved by the viewer. Only the owner gets this. The approved member gets a logBeginConvo. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogApproveJoinRequest { + pub convo_id: S, + ///Prospective member who requested to join. + pub member: ProfileViewBasic, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a convo containing the viewer was started. Can be direct or group. When a member is added to a group convo, they also get this event. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -211,12 +459,29 @@ pub struct LogBeginConvo { pub extra_data: Option>>, } +/// Event indicating a join link was created for a group convo. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogCreateJoinLink { + pub convo_id: S, + ///A system message with data of type #systemMessageDataCreateJoinLink + pub message: convo::SystemMessageView, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a user-originated message was created. Is not emitted for system messages. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct LogCreateMessage { pub convo_id: S, pub message: LogCreateMessageMessage, + ///Profiles referred to in the message view. This isn't required for compatibility, because it was added later, but should generally be present. + #[serde(skip_serializing_if = "Option::is_none")] + pub related_profiles: Option>>, pub rev: S, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, @@ -233,6 +498,7 @@ pub enum LogCreateMessageMessage { DeletedMessageView(Box>), } +/// Event indicating a user-originated message was deleted. Is not emitted for system messages. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -255,71 +521,296 @@ pub enum LogDeleteMessageMessage { DeletedMessageView(Box>), } +/// Event indicating a join link was disabled for a group convo. -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] -pub struct LogLeaveConvo { +pub struct LogDisableJoinLink { pub convo_id: S, + ///A system message with data of type #systemMessageDataDisableJoinLink + pub message: convo::SystemMessageView, pub rev: S, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } +/// Event indicating info about group convo was edited. -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] -pub struct LogMuteConvo { +pub struct LogEditGroup { pub convo_id: S, + ///A system message with data of type #systemMessageDataEditGroup + pub message: convo::SystemMessageView, pub rev: S, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } +/// Event indicating a settings about a join link for a group convo were edited. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] -pub struct LogReadMessage { +pub struct LogEditJoinLink { pub convo_id: S, - pub message: LogReadMessageMessage, + ///A system message with data of type #systemMessageDataEditJoinLink + pub message: convo::SystemMessageView, pub rev: S, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } +/// Event indicating a join link was enabled for a group convo. -#[open_union] #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] -#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] -pub enum LogReadMessageMessage { - #[serde(rename = "chat.bsky.convo.defs#messageView")] - MessageView(Box>), - #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] - DeletedMessageView(Box>), +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogEnableJoinLink { + pub convo_id: S, + ///A system message with data of type #systemMessageDataEnableJoinLink + pub message: convo::SystemMessageView, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, } +/// Event indicating a join request was made to a group the viewer owns. Only the owner gets this. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] -pub struct LogRemoveReaction { +pub struct LogIncomingJoinRequest { pub convo_id: S, - pub message: LogRemoveReactionMessage, - pub reaction: convo::ReactionView, + ///Prospective member who requested to join. + pub member: ProfileViewBasic, pub rev: S, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } +/// Event indicating the viewer left a convo. Can be direct or group. -#[open_union] -#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] -#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] -pub enum LogRemoveReactionMessage { - #[serde(rename = "chat.bsky.convo.defs#messageView")] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogLeaveConvo { + pub convo_id: S, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a group convo was locked. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogLockConvo { + pub convo_id: S, + ///A system message with data of type #systemMessageDataLockConvo + pub message: convo::SystemMessageView, + ///Profiles referred in the system message. + pub related_profiles: Vec>, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a group convo was locked permanently. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogLockConvoPermanently { + pub convo_id: S, + ///A system message with data of type #systemMessageDataLockConvoPermanently + pub message: convo::SystemMessageView, + ///Profiles referred in the system message. + pub related_profiles: Vec>, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a member joined a group convo via join link. The member who was added gets a logBeginConvo (to create the convo) but also a logMemberJoin (to show the system message as the first message the user sees). + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogMemberJoin { + pub convo_id: S, + ///A system message with data of type #systemMessageDataMemberJoin + pub message: convo::SystemMessageView, + ///Profiles referred in the system message. + pub related_profiles: Vec>, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a member voluntarily left a group convo. The member who was removed gets a logLeaveConvo (to leave the convo) but not a logMemberLeave (because they already left, so can't see the system message). + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogMemberLeave { + pub convo_id: S, + ///A system message with data of type #systemMessageDataMemberLeave + pub message: convo::SystemMessageView, + ///Profiles referred in the system message. + pub related_profiles: Vec>, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating the viewer muted a convo. Can be direct or group. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogMuteConvo { + pub convo_id: S, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a join request was made by the requester. Only requester actor gets this. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogOutgoingJoinRequest { + pub convo_id: S, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a convo was read up to a certain message. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogReadConvo { + pub convo_id: S, + pub message: LogReadConvoMessage, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum LogReadConvoMessage { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageView")] + SystemMessageView(Box>), +} + +/// Event indicating the group owner marked join requests as read. Only the owner gets this. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogReadJoinRequests { + pub convo_id: S, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// DEPRECATED: use logReadConvo instead. Event indicating a convo was read up to a certain message. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogReadMessage { + pub convo_id: S, + pub message: LogReadMessageMessage, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum LogReadMessageMessage { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageView")] + SystemMessageView(Box>), +} + +/// Event indicating a join request was rejected by the viewer. Only the owner gets this. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogRejectJoinRequest { + pub convo_id: S, + ///Prospective member who requested to join. + pub member: ProfileViewBasic, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a member was removed from a group convo. The member who was removed gets a logLeaveConvo (to leave the convo) but not a logRemoveMember (because they already left, so can't see the system message). + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogRemoveMember { + pub convo_id: S, + ///A system message with data of type #systemMessageDataRemoveMember + pub message: convo::SystemMessageView, + ///Profiles referred in the system message. + pub related_profiles: Vec>, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating a reaction was removed from a message. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogRemoveReaction { + pub convo_id: S, + pub message: LogRemoveReactionMessage, + pub reaction: convo::ReactionView, + ///Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present. + #[serde(skip_serializing_if = "Option::is_none")] + pub related_profiles: Option>>, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum LogRemoveReactionMessage { + #[serde(rename = "chat.bsky.convo.defs#messageView")] MessageView(Box>), #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] DeletedMessageView(Box>), } +/// Event indicating a group convo was unlocked. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogUnlockConvo { + pub convo_id: S, + ///A system message with data of type #systemMessageDataUnlockConvo + pub message: convo::SystemMessageView, + ///Profiles referred in the system message. + pub related_profiles: Vec>, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating the viewer unmuted a convo. Can be direct or group. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -330,6 +821,30 @@ pub struct LogUnmuteConvo { pub extra_data: Option>>, } +/// Event indicating a prospective member withdrew their join request. Only the owner gets this. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogWithdrawIncomingJoinRequest { + pub convo_id: S, + ///Prospective member who withdrew their join request. + pub member: ProfileViewBasic, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Event indicating the viewer withdrew their own join request. Only requester actor gets this. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct LogWithdrawOutgoingJoinRequest { + pub convo_id: S, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -340,21 +855,44 @@ pub struct MessageAndReactionView { pub extra_data: Option>>, } +/// Placeholder embedded in place of a reply's parent message when that parent was sent before the viewer joined the group convo. The viewer has no access to that history, so no message data is carried. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct MessageBeforeUserJoinedGroupView { + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct MessageInput { #[serde(skip_serializing_if = "Option::is_none")] - pub embed: Option>, + pub embed: Option>, ///Annotations of text (mentions, URLs, hashtags, etc) #[serde(skip_serializing_if = "Option::is_none")] pub facets: Option>>, + ///If set, the message this message is replying to. The referenced message must be in the same convo. + #[serde(skip_serializing_if = "Option::is_none")] + pub reply_to: Option>, pub text: S, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum MessageInputEmbed { + #[serde(rename = "app.bsky.embed.record")] + Record(Box>), + #[serde(rename = "chat.bsky.embed.joinLink")] + JoinLink(Box>), +} + + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct MessageRef { @@ -370,7 +908,7 @@ pub struct MessageRef { #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct MessageView { #[serde(skip_serializing_if = "Option::is_none")] - pub embed: Option>, + pub embed: Option>, ///Annotations of text (mentions, URLs, hashtags, etc) #[serde(skip_serializing_if = "Option::is_none")] pub facets: Option>>, @@ -378,6 +916,9 @@ pub struct MessageView { ///Reactions to this message, in ascending order of creation time. #[serde(skip_serializing_if = "Option::is_none")] pub reactions: Option>>, + ///If set, the message this message is replying to. The full view of the referenced message is embedded so the client can render it inline. Only a single level is embedded: the embedded message will not itself have a populated 'replyTo' field even if it was also a reply. + #[serde(skip_serializing_if = "Option::is_none")] + pub reply_to: Option>, pub rev: S, pub sender: convo::MessageViewSender, pub sent_at: Datetime, @@ -387,6 +928,30 @@ pub struct MessageView { } +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum MessageViewEmbed { + #[serde(rename = "app.bsky.embed.record#view")] + RecordView(Box>), + #[serde(rename = "chat.bsky.embed.joinLink#view")] + JoinLinkView(Box>), +} + + +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum MessageViewReplyTo { + #[serde(rename = "chat.bsky.convo.defs#messageView")] + MessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] + DeletedMessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#messageBeforeUserJoinedGroupView")] + MessageBeforeUserJoinedGroupView(Box>), +} + + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct MessageViewSender { @@ -415,57 +980,213 @@ pub struct ReactionViewSender { pub extra_data: Option>>, } -impl LexiconSchema for ConvoView { - fn nsid() -> &'static str { - "chat.bsky.convo.defs" - } - fn def_name() -> &'static str { - "convoView" - } - fn lexicon_doc() -> LexiconDoc<'static> { - lexicon_doc_chat_bsky_convo_defs() - } - fn validate(&self) -> Result<(), ConstraintError> { - Ok(()) - } -} +/// A reference to another message within the same convo, used to indicate that a message is a reply to it. -impl LexiconSchema for DeletedMessageView { - fn nsid() -> &'static str { - "chat.bsky.convo.defs" - } - fn def_name() -> &'static str { - "deletedMessageView" - } - fn lexicon_doc() -> LexiconDoc<'static> { - lexicon_doc_chat_bsky_convo_defs() - } - fn validate(&self) -> Result<(), ConstraintError> { - Ok(()) - } +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ReplyRef { + pub message_id: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, } -impl LexiconSchema for LogAcceptConvo { - fn nsid() -> &'static str { - "chat.bsky.convo.defs" - } - fn def_name() -> &'static str { - "logAcceptConvo" - } - fn lexicon_doc() -> LexiconDoc<'static> { - lexicon_doc_chat_bsky_convo_defs() - } - fn validate(&self) -> Result<(), ConstraintError> { - Ok(()) - } -} +/// System message indicating a user was added to the group convo. -impl LexiconSchema for LogAddReaction { +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataAddMember { + pub added_by: convo::SystemMessageReferredUser, + ///Current view of the member who was added. + pub member: convo::SystemMessageReferredUser, + ///Role the user was added to the group with. The role from 'member' will reflect the current data, not historical. + pub role: MemberRole, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating the group join link was created. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataCreateJoinLink { + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating the group join link was disabled. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataDisableJoinLink { + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating the group info was edited. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataEditGroup { + ///Group name that replaced the old. + #[serde(skip_serializing_if = "Option::is_none")] + pub new_name: Option, + ///Group name that was replaced. + #[serde(skip_serializing_if = "Option::is_none")] + pub old_name: Option, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating the group join link was edited. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataEditJoinLink { + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating the group join link was enabled. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataEnableJoinLink { + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating the group convo was locked. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataLockConvo { + ///Current view of the member who locked the group. + pub locked_by: convo::SystemMessageReferredUser, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating the group convo was locked permanently. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataLockConvoPermanently { + ///Current view of the member who locked the group. + pub locked_by: convo::SystemMessageReferredUser, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating a user joined the group convo via join link. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataMemberJoin { + ///If join link was configured to require approval, this will be set to who approved the request. Undefined if approval was not required. + #[serde(skip_serializing_if = "Option::is_none")] + pub approved_by: Option>, + ///Current view of the member who joined. + pub member: convo::SystemMessageReferredUser, + ///Role the user was added to the group with. The role from 'member' will reflect the current data, not historical. + pub role: MemberRole, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating a user voluntarily left the group convo. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataMemberLeave { + ///Current view of the member who left the group. + pub member: convo::SystemMessageReferredUser, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating a user was removed from the group convo. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataRemoveMember { + ///Current view of the member who was removed. + pub member: convo::SystemMessageReferredUser, + pub removed_by: convo::SystemMessageReferredUser, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// System message indicating the group convo was unlocked. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageDataUnlockConvo { + ///Current view of the member who unlocked the group. + pub unlocked_by: convo::SystemMessageReferredUser, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageReferredUser { + pub did: Did, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct SystemMessageView { + pub data: SystemMessageViewData, + pub id: S, + pub rev: S, + pub sent_at: Datetime, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum SystemMessageViewData { + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataAddMember")] + SystemMessageDataAddMember(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataRemoveMember")] + SystemMessageDataRemoveMember(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataMemberJoin")] + SystemMessageDataMemberJoin(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataMemberLeave")] + SystemMessageDataMemberLeave(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataLockConvo")] + SystemMessageDataLockConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataUnlockConvo")] + SystemMessageDataUnlockConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataLockConvoPermanently")] + SystemMessageDataLockConvoPermanently( + Box>, + ), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataEditGroup")] + SystemMessageDataEditGroup(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataCreateJoinLink")] + SystemMessageDataCreateJoinLink(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataEditJoinLink")] + SystemMessageDataEditJoinLink(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataEnableJoinLink")] + SystemMessageDataEnableJoinLink(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageDataDisableJoinLink")] + SystemMessageDataDisableJoinLink(Box>), +} + +impl LexiconSchema for ConvoRef { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "logAddReaction" + "convoRef" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -475,12 +1196,12 @@ impl LexiconSchema for LogAddReaction { } } -impl LexiconSchema for LogBeginConvo { +impl LexiconSchema for ConvoView { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "logBeginConvo" + "convoView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -490,12 +1211,12 @@ impl LexiconSchema for LogBeginConvo { } } -impl LexiconSchema for LogCreateMessage { +impl LexiconSchema for DeletedMessageView { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "logCreateMessage" + "deletedMessageView" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -505,12 +1226,12 @@ impl LexiconSchema for LogCreateMessage { } } -impl LexiconSchema for LogDeleteMessage { +impl LexiconSchema for DirectConvo { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "logDeleteMessage" + "directConvo" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -520,27 +1241,51 @@ impl LexiconSchema for LogDeleteMessage { } } -impl LexiconSchema for LogLeaveConvo { +impl LexiconSchema for GroupConvo { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "logLeaveConvo" + "groupConvo" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() } fn validate(&self) -> Result<(), ConstraintError> { + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 500usize { + return Err(ConstraintError::MaxLength { + path: ValidationPath::from_field("name"), + max: 500usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.name; + { + let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count(); + if count > 50usize { + return Err(ConstraintError::MaxGraphemes { + path: ValidationPath::from_field("name"), + max: 50usize, + actual: count, + }); + } + } + } Ok(()) } } -impl LexiconSchema for LogMuteConvo { +impl LexiconSchema for LogAcceptConvo { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "logMuteConvo" + "logAcceptConvo" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -550,12 +1295,12 @@ impl LexiconSchema for LogMuteConvo { } } -impl LexiconSchema for LogReadMessage { +impl LexiconSchema for LogAddMember { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "logReadMessage" + "logAddMember" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -565,12 +1310,12 @@ impl LexiconSchema for LogReadMessage { } } -impl LexiconSchema for LogRemoveReaction { +impl LexiconSchema for LogAddReaction { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "logRemoveReaction" + "logAddReaction" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -580,12 +1325,12 @@ impl LexiconSchema for LogRemoveReaction { } } -impl LexiconSchema for LogUnmuteConvo { +impl LexiconSchema for LogApproveJoinRequest { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "logUnmuteConvo" + "logApproveJoinRequest" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -595,12 +1340,12 @@ impl LexiconSchema for LogUnmuteConvo { } } -impl LexiconSchema for MessageAndReactionView { +impl LexiconSchema for LogBeginConvo { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "messageAndReactionView" + "logBeginConvo" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -610,51 +1355,27 @@ impl LexiconSchema for MessageAndReactionView { } } -impl LexiconSchema for MessageInput { +impl LexiconSchema for LogCreateJoinLink { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "messageInput" + "logCreateJoinLink" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() } fn validate(&self) -> Result<(), ConstraintError> { - { - let value = &self.text; - #[allow(unused_comparisons)] - if ::len(value.as_ref()) > 10000usize { - return Err(ConstraintError::MaxLength { - path: ValidationPath::from_field("text"), - max: 10000usize, - actual: ::len(value.as_ref()), - }); - } - } - { - let value = &self.text; - { - let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count(); - if count > 1000usize { - return Err(ConstraintError::MaxGraphemes { - path: ValidationPath::from_field("text"), - max: 1000usize, - actual: count, - }); - } - } - } Ok(()) } } -impl LexiconSchema for MessageRef { +impl LexiconSchema for LogCreateMessage { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "messageRef" + "logCreateMessage" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -664,51 +1385,27 @@ impl LexiconSchema for MessageRef { } } -impl LexiconSchema for MessageView { +impl LexiconSchema for LogDeleteMessage { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "messageView" + "logDeleteMessage" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() } fn validate(&self) -> Result<(), ConstraintError> { - { - let value = &self.text; - #[allow(unused_comparisons)] - if ::len(value.as_ref()) > 10000usize { - return Err(ConstraintError::MaxLength { - path: ValidationPath::from_field("text"), - max: 10000usize, - actual: ::len(value.as_ref()), - }); - } - } - { - let value = &self.text; - { - let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count(); - if count > 1000usize { - return Err(ConstraintError::MaxGraphemes { - path: ValidationPath::from_field("text"), - max: 1000usize, - actual: count, - }); - } - } - } Ok(()) } } -impl LexiconSchema for MessageViewSender { +impl LexiconSchema for LogDisableJoinLink { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "messageViewSender" + "logDisableJoinLink" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -718,12 +1415,12 @@ impl LexiconSchema for MessageViewSender { } } -impl LexiconSchema for ReactionView { +impl LexiconSchema for LogEditGroup { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "reactionView" + "logEditGroup" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -733,12 +1430,12 @@ impl LexiconSchema for ReactionView { } } -impl LexiconSchema for ReactionViewSender { +impl LexiconSchema for LogEditJoinLink { fn nsid() -> &'static str { "chat.bsky.convo.defs" } fn def_name() -> &'static str { - "reactionViewSender" + "logEditJoinLink" } fn lexicon_doc() -> LexiconDoc<'static> { lexicon_doc_chat_bsky_convo_defs() @@ -748,414 +1445,2547 @@ impl LexiconSchema for ReactionViewSender { } } -pub mod convo_view_state { - - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; - #[allow(unused)] - use ::core::marker::PhantomData; - mod sealed { - pub trait Sealed {} - } - /// State trait tracking which required fields have been set - pub trait State: sealed::Sealed { - type Id; - type Members; - type Muted; - type Rev; - type UnreadCount; +impl LexiconSchema for LogEnableJoinLink { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" } - /// Empty state - all required fields are unset - pub struct Empty(()); - impl sealed::Sealed for Empty {} - impl State for Empty { - type Id = Unset; - type Members = Unset; - type Muted = Unset; - type Rev = Unset; - type UnreadCount = Unset; + fn def_name() -> &'static str { + "logEnableJoinLink" } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData St>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type Members = St::Members; - type Muted = St::Muted; - type Rev = St::Rev; - type UnreadCount = St::UnreadCount; + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() } - ///State transition - sets the `members` field to Set - pub struct SetMembers(PhantomData St>); - impl sealed::Sealed for SetMembers {} - impl State for SetMembers { - type Id = St::Id; - type Members = Set; - type Muted = St::Muted; - type Rev = St::Rev; - type UnreadCount = St::UnreadCount; + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) } - ///State transition - sets the `muted` field to Set - pub struct SetMuted(PhantomData St>); - impl sealed::Sealed for SetMuted {} - impl State for SetMuted { - type Id = St::Id; - type Members = St::Members; - type Muted = Set; - type Rev = St::Rev; - type UnreadCount = St::UnreadCount; +} + +impl LexiconSchema for LogIncomingJoinRequest { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData St>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Id = St::Id; - type Members = St::Members; - type Muted = St::Muted; - type Rev = Set; - type UnreadCount = St::UnreadCount; + fn def_name() -> &'static str { + "logIncomingJoinRequest" } - ///State transition - sets the `unread_count` field to Set - pub struct SetUnreadCount(PhantomData St>); - impl sealed::Sealed for SetUnreadCount {} - impl State for SetUnreadCount { - type Id = St::Id; - type Members = St::Members; - type Muted = St::Muted; - type Rev = St::Rev; - type UnreadCount = Set; + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() } - /// Marker types for field names - #[allow(non_camel_case_types)] - pub mod members { - ///Marker type for the `id` field - pub struct id(()); - ///Marker type for the `members` field - pub struct members(()); - ///Marker type for the `muted` field - pub struct muted(()); - ///Marker type for the `rev` field - pub struct rev(()); - ///Marker type for the `unread_count` field - pub struct unread_count(()); + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) } } -/// Builder for constructing an instance of this type. -pub struct ConvoViewBuilder { - _state: PhantomData St>, - _fields: ( - Option, - Option>, - Option>, - Option>>, - Option, - Option, - Option>, - Option, - ), - _type: PhantomData S>, -} - -impl ConvoView { - /// Create a new builder for this type. - pub fn new() -> ConvoViewBuilder { - ConvoViewBuilder::new() +impl LexiconSchema for LogLeaveConvo { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" } -} - -impl ConvoViewBuilder { - /// Create a new builder with all fields unset. - pub fn new() -> Self { - ConvoViewBuilder { - _state: PhantomData, - _fields: (None, None, None, None, None, None, None, None), - _type: PhantomData, - } + fn def_name() -> &'static str { + "logLeaveConvo" } -} - -impl ConvoViewBuilder -where - St: convo_view_state::State, - St::Id: convo_view_state::IsUnset, -{ - /// Set the `id` field (required) - pub fn id( - mut self, - value: impl Into, - ) -> ConvoViewBuilder> { - self._fields.0 = Option::Some(value.into()); - ConvoViewBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) } } -impl ConvoViewBuilder { - /// Set the `lastMessage` field (optional) - pub fn last_message( - mut self, - value: impl Into>>, - ) -> Self { - self._fields.1 = value.into(); - self +impl LexiconSchema for LogLockConvo { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" } - /// Set the `lastMessage` field to an Option value (optional) - pub fn maybe_last_message(mut self, value: Option>) -> Self { - self._fields.1 = value; - self + fn def_name() -> &'static str { + "logLockConvo" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) } } -impl ConvoViewBuilder { - /// Set the `lastReaction` field (optional) - pub fn last_reaction( - mut self, - value: impl Into>>, - ) -> Self { - self._fields.2 = value.into(); - self +impl LexiconSchema for LogLockConvoPermanently { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" } - /// Set the `lastReaction` field to an Option value (optional) - pub fn maybe_last_reaction( - mut self, - value: Option>, - ) -> Self { - self._fields.2 = value; - self + fn def_name() -> &'static str { + "logLockConvoPermanently" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) } } -impl ConvoViewBuilder -where - St: convo_view_state::State, - St::Members: convo_view_state::IsUnset, -{ - /// Set the `members` field (required) - pub fn members( - mut self, - value: impl Into>>, - ) -> ConvoViewBuilder> { - self._fields.3 = Option::Some(value.into()); - ConvoViewBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } +impl LexiconSchema for LogMemberJoin { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logMemberJoin" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) } } -impl ConvoViewBuilder -where - St: convo_view_state::State, - St::Muted: convo_view_state::IsUnset, -{ - /// Set the `muted` field (required) - pub fn muted( - mut self, - value: impl Into, - ) -> ConvoViewBuilder> { - self._fields.4 = Option::Some(value.into()); - ConvoViewBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } +impl LexiconSchema for LogMemberLeave { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logMemberLeave" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) } } -impl ConvoViewBuilder -where - St: convo_view_state::State, - St::Rev: convo_view_state::IsUnset, -{ - /// Set the `rev` field (required) - pub fn rev( - mut self, - value: impl Into, - ) -> ConvoViewBuilder> { - self._fields.5 = Option::Some(value.into()); - ConvoViewBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } +impl LexiconSchema for LogMuteConvo { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logMuteConvo" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) } } -impl ConvoViewBuilder { - /// Set the `status` field (optional) - pub fn status(mut self, value: impl Into>>) -> Self { - self._fields.6 = value.into(); - self +impl LexiconSchema for LogOutgoingJoinRequest { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" } - /// Set the `status` field to an Option value (optional) - pub fn maybe_status(mut self, value: Option>) -> Self { - self._fields.6 = value; - self + fn def_name() -> &'static str { + "logOutgoingJoinRequest" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) } } -impl ConvoViewBuilder -where - St: convo_view_state::State, - St::UnreadCount: convo_view_state::IsUnset, -{ - /// Set the `unreadCount` field (required) - pub fn unread_count( - mut self, - value: impl Into, - ) -> ConvoViewBuilder> { - self._fields.7 = Option::Some(value.into()); - ConvoViewBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } +impl LexiconSchema for LogReadConvo { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logReadConvo" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) } } -impl ConvoViewBuilder -where - St: convo_view_state::State, - St::Id: convo_view_state::IsSet, - St::Members: convo_view_state::IsSet, - St::Muted: convo_view_state::IsSet, - St::Rev: convo_view_state::IsSet, - St::UnreadCount: convo_view_state::IsSet, -{ - /// Build the final struct. - pub fn build(self) -> ConvoView { - ConvoView { - id: self._fields.0.unwrap(), - last_message: self._fields.1, - last_reaction: self._fields.2, - members: self._fields.3.unwrap(), - muted: self._fields.4.unwrap(), - rev: self._fields.5.unwrap(), - status: self._fields.6, - unread_count: self._fields.7.unwrap(), - extra_data: Default::default(), - } +impl LexiconSchema for LogReadJoinRequests { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" } - /// Build the final struct with custom extra_data. - pub fn build_with_data( - self, - extra_data: BTreeMap>, - ) -> ConvoView { - ConvoView { - id: self._fields.0.unwrap(), - last_message: self._fields.1, - last_reaction: self._fields.2, - members: self._fields.3.unwrap(), - muted: self._fields.4.unwrap(), - rev: self._fields.5.unwrap(), - status: self._fields.6, - unread_count: self._fields.7.unwrap(), - extra_data: Some(extra_data), + fn def_name() -> &'static str { + "logReadJoinRequests" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for LogReadMessage { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logReadMessage" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for LogRejectJoinRequest { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logRejectJoinRequest" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for LogRemoveMember { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logRemoveMember" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for LogRemoveReaction { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logRemoveReaction" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for LogUnlockConvo { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logUnlockConvo" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for LogUnmuteConvo { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logUnmuteConvo" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for LogWithdrawIncomingJoinRequest { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logWithdrawIncomingJoinRequest" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for LogWithdrawOutgoingJoinRequest { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "logWithdrawOutgoingJoinRequest" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for MessageAndReactionView { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageAndReactionView" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for MessageBeforeUserJoinedGroupView { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageBeforeUserJoinedGroupView" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for MessageInput { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageInput" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + { + let value = &self.text; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10000usize { + return Err(ConstraintError::MaxLength { + path: ValidationPath::from_field("text"), + max: 10000usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.text; + { + let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count(); + if count > 1000usize { + return Err(ConstraintError::MaxGraphemes { + path: ValidationPath::from_field("text"), + max: 1000usize, + actual: count, + }); + } + } } + Ok(()) } } -fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { - #[allow(unused_imports)] - use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType}; - use jacquard_lexicon::lexicon::*; - use alloc::collections::BTreeMap; - LexiconDoc { - lexicon: Lexicon::Lexicon1, - id: CowStr::new_static("chat.bsky.convo.defs"), - defs: { - let mut map = BTreeMap::new(); - map.insert( - SmolStr::new_static("convoView"), - LexUserType::Object(LexObject { - required: Some( - vec![ - SmolStr::new_static("id"), SmolStr::new_static("rev"), - SmolStr::new_static("members"), SmolStr::new_static("muted"), - SmolStr::new_static("unreadCount") - ], - ), - properties: { +impl LexiconSchema for MessageRef { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageRef" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for MessageView { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageView" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + { + let value = &self.text; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 10000usize { + return Err(ConstraintError::MaxLength { + path: ValidationPath::from_field("text"), + max: 10000usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.text; + { + let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count(); + if count > 1000usize { + return Err(ConstraintError::MaxGraphemes { + path: ValidationPath::from_field("text"), + max: 1000usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +impl LexiconSchema for MessageViewSender { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "messageViewSender" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for ReactionView { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "reactionView" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for ReactionViewSender { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "reactionViewSender" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for ReplyRef { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "replyRef" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataAddMember { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataAddMember" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataCreateJoinLink { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataCreateJoinLink" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataDisableJoinLink { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataDisableJoinLink" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataEditGroup { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataEditGroup" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataEditJoinLink { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataEditJoinLink" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataEnableJoinLink { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataEnableJoinLink" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataLockConvo { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataLockConvo" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataLockConvoPermanently { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataLockConvoPermanently" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataMemberJoin { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataMemberJoin" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataMemberLeave { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataMemberLeave" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataRemoveMember { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataRemoveMember" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageDataUnlockConvo { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageDataUnlockConvo" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageReferredUser { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageReferredUser" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for SystemMessageView { + fn nsid() -> &'static str { + "chat.bsky.convo.defs" + } + fn def_name() -> &'static str { + "systemMessageView" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_convo_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +pub mod convo_ref_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Did; + type ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + type ConvoId = Unset; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Did = St::Did; + type ConvoId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct ConvoRefBuilder { + _state: PhantomData St>, + _fields: (Option, Option>), + _type: PhantomData S>, +} + +impl ConvoRef { + /// Create a new builder for this type. + pub fn new() -> ConvoRefBuilder { + ConvoRefBuilder::new() + } +} + +impl ConvoRefBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + ConvoRefBuilder { + _state: PhantomData, + _fields: (None, None), + _type: PhantomData, + } + } +} + +impl ConvoRefBuilder +where + St: convo_ref_state::State, + St::ConvoId: convo_ref_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> ConvoRefBuilder> { + self._fields.0 = Option::Some(value.into()); + ConvoRefBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ConvoRefBuilder +where + St: convo_ref_state::State, + St::Did: convo_ref_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ConvoRefBuilder> { + self._fields.1 = Option::Some(value.into()); + ConvoRefBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ConvoRefBuilder +where + St: convo_ref_state::State, + St::Did: convo_ref_state::IsSet, + St::ConvoId: convo_ref_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> ConvoRef { + ConvoRef { + convo_id: self._fields.0.unwrap(), + did: self._fields.1.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data(self, extra_data: BTreeMap>) -> ConvoRef { + ConvoRef { + convo_id: self._fields.0.unwrap(), + did: self._fields.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { + #[allow(unused_imports)] + use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType}; + use jacquard_lexicon::lexicon::*; + use alloc::collections::BTreeMap; + LexiconDoc { + lexicon: Lexicon::Lexicon1, + id: CowStr::new_static("chat.bsky.convo.defs"), + defs: { + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoKind"), + LexUserType::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("convoLockStatus"), + LexUserType::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("convoRef"), + LexUserType::Object(LexObject { + required: Some( + vec![SmolStr::new_static("did"), SmolStr::new_static("convoId")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("did"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Did), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("convoStatus"), + LexUserType::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("convoView"), + LexUserType::Object(LexObject { + required: Some( + vec![ + SmolStr::new_static("id"), SmolStr::new_static("rev"), + SmolStr::new_static("members"), SmolStr::new_static("muted"), + SmolStr::new_static("unreadCount") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("id"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("kind"), + LexObjectProperty::Union(LexRefUnion { + description: Some( + CowStr::new_static( + "Union field that has data specific to different kinds of convos.", + ), + ), + refs: vec![ + CowStr::new_static("#directConvo"), + CowStr::new_static("#groupConvo") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("lastMessage"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("#messageView"), + CowStr::new_static("#deletedMessageView"), + CowStr::new_static("#systemMessageView") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("lastReaction"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![CowStr::new_static("#messageAndReactionView")], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("members"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Members of this conversation. For direct convos, it will be an immutable list of the 2 members. For group convos, it will a list of important members (the first few members, the viewer, the member who added the viewer, the member who sent the last message, the member who sent the last reaction), but will not contain the full list of members. Use chat.bsky.convo.getConvoMembers to list all members.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("muted"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("status"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#convoStatus"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("unreadCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("deletedMessageView"), + LexUserType::Object(LexObject { + required: Some( + vec![ + SmolStr::new_static("id"), SmolStr::new_static("rev"), + SmolStr::new_static("sender"), SmolStr::new_static("sentAt") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("id"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("sender"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#messageViewSender"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("sentAt"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("directConvo"), + LexUserType::Object(LexObject { + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("groupConvo"), + LexUserType::Object(LexObject { + required: Some( + vec![ + SmolStr::new_static("createdAt"), + SmolStr::new_static("lockStatus"), + SmolStr::new_static("lockStatusModerationOverride"), + SmolStr::new_static("memberCount"), + SmolStr::new_static("memberLimit"), + SmolStr::new_static("name") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("createdAt"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("joinLink"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.group.defs#joinLinkView", + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("joinRequestCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("lockStatus"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#convoLockStatus"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("lockStatusModerationOverride"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("memberCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("memberLimit"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("name"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "The display name of the group conversation.", + ), + ), + max_length: Some(500usize), + max_graphemes: Some(50usize), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("unreadJoinRequestCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logAcceptConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating the viewer accepted a convo, and it can be moved out of the request inbox. Can be direct or group.", + ), + ), + required: Some( + vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logAddMember"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a member was added to a group convo. The member who was added gets a logBeginConvo (to create the convo) but also a logAddMember (to show the system message as the first message the user sees).", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message"), + SmolStr::new_static("relatedProfiles") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("relatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles referred in the system message.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logAddReaction"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a reaction was added to a message.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message"), + SmolStr::new_static("reaction") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("#messageView"), + CowStr::new_static("#deletedMessageView") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("reaction"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#reactionView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("relatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logApproveJoinRequest"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a join request was approved by the viewer. Only the owner gets this. The approved member gets a logBeginConvo.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("member") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("member"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logBeginConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a convo containing the viewer was started. Can be direct or group. When a member is added to a group convo, they also get this event.", + ), + ), + required: Some( + vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logCreateJoinLink"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a join link was created for a group convo.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logCreateMessage"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a user-originated message was created. Is not emitted for system messages.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("#messageView"), + CowStr::new_static("#deletedMessageView") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("relatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles referred to in the message view. This isn't required for compatibility, because it was added later, but should generally be present.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logDeleteMessage"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a user-originated message was deleted. Is not emitted for system messages.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("#messageView"), + CowStr::new_static("#deletedMessageView") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logDisableJoinLink"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a join link was disabled for a group convo.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logEditGroup"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating info about group convo was edited.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logEditJoinLink"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a settings about a join link for a group convo were edited.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logEnableJoinLink"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a join link was enabled for a group convo.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logIncomingJoinRequest"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a join request was made to a group the viewer owns. Only the owner gets this.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("member") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("member"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logLeaveConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating the viewer left a convo. Can be direct or group.", + ), + ), + required: Some( + vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logLockConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static("Event indicating a group convo was locked."), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message"), + SmolStr::new_static("relatedProfiles") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("relatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles referred in the system message.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logLockConvoPermanently"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a group convo was locked permanently.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message"), + SmolStr::new_static("relatedProfiles") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("relatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles referred in the system message.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logMemberJoin"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a member joined a group convo via join link. The member who was added gets a logBeginConvo (to create the convo) but also a logMemberJoin (to show the system message as the first message the user sees).", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message"), + SmolStr::new_static("relatedProfiles") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("relatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles referred in the system message.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logMemberLeave"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a member voluntarily left a group convo. The member who was removed gets a logLeaveConvo (to leave the convo) but not a logMemberLeave (because they already left, so can't see the system message).", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message"), + SmolStr::new_static("relatedProfiles") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("relatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles referred in the system message.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logMuteConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating the viewer muted a convo. Can be direct or group.", + ), + ), + required: Some( + vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logOutgoingJoinRequest"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a join request was made by the requester. Only requester actor gets this.", + ), + ), + required: Some( + vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logReadConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a convo was read up to a certain message.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("#messageView"), + CowStr::new_static("#deletedMessageView"), + CowStr::new_static("#systemMessageView") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logReadJoinRequests"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating the group owner marked join requests as read. Only the owner gets this.", + ), + ), + required: Some( + vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logReadMessage"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "DEPRECATED: use logReadConvo instead. Event indicating a convo was read up to a certain message.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("#messageView"), + CowStr::new_static("#deletedMessageView"), + CowStr::new_static("#systemMessageView") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logRejectJoinRequest"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a join request was rejected by the viewer. Only the owner gets this.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("member") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("member"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logRemoveMember"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a member was removed from a group convo. The member who was removed gets a logLeaveConvo (to leave the convo) but not a logRemoveMember (because they already left, so can't see the system message).", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message"), + SmolStr::new_static("relatedProfiles") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("relatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles referred in the system message.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logRemoveReaction"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a reaction was removed from a message.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message"), + SmolStr::new_static("reaction") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("#messageView"), + CowStr::new_static("#deletedMessageView") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("reaction"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#reactionView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("relatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles referred in the message and reaction views. This isn't required for compatibility, because it was added later, but should generally be present.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logUnlockConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a group convo was unlocked.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("message"), + SmolStr::new_static("relatedProfiles") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("relatedProfiles"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Profiles referred in the system message.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logUnmuteConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating the viewer unmuted a convo. Can be direct or group.", + ), + ), + required: Some( + vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logWithdrawIncomingJoinRequest"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating a prospective member withdrew their join request. Only the owner gets this.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("rev"), SmolStr::new_static("convoId"), + SmolStr::new_static("member") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("member"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#profileViewBasic", + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("logWithdrawOutgoingJoinRequest"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Event indicating the viewer withdrew their own join request. Only requester actor gets this.", + ), + ), + required: Some( + vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("messageAndReactionView"), + LexUserType::Object(LexObject { + required: Some( + vec![ + SmolStr::new_static("message"), + SmolStr::new_static("reaction") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("message"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#messageView"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("reaction"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#reactionView"), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("messageBeforeUserJoinedGroupView"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Placeholder embedded in place of a reply's parent message when that parent was sent before the viewer joined the group convo. The viewer has no access to that history, so no message data is carried.", + ), + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("messageInput"), + LexUserType::Object(LexObject { + required: Some(vec![SmolStr::new_static("text")]), + properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("id"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("lastMessage"), + SmolStr::new_static("embed"), LexObjectProperty::Union(LexRefUnion { refs: vec![ - CowStr::new_static("#messageView"), - CowStr::new_static("#deletedMessageView") + CowStr::new_static("app.bsky.embed.record"), + CowStr::new_static("chat.bsky.embed.joinLink") ], ..Default::default() }), ); map.insert( - SmolStr::new_static("lastReaction"), - LexObjectProperty::Union(LexRefUnion { - refs: vec![CowStr::new_static("#messageAndReactionView")], - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("members"), + SmolStr::new_static("facets"), LexObjectProperty::Array(LexArray { - items: LexArrayItem::Ref(LexRef { - r#ref: CowStr::new_static( - "chat.bsky.actor.defs#profileViewBasic", + description: Some( + CowStr::new_static( + "Annotations of text (mentions, URLs, hashtags, etc)", ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static("app.bsky.richtext.facet"), ..Default::default() }), ..Default::default() }), ); map.insert( - SmolStr::new_static("muted"), - LexObjectProperty::Boolean(LexBoolean { + SmolStr::new_static("replyTo"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#replyRef"), ..Default::default() }), ); map.insert( - SmolStr::new_static("rev"), - LexObjectProperty::String(LexString { ..Default::default() }), + SmolStr::new_static("text"), + LexObjectProperty::String(LexString { + max_length: Some(10000usize), + max_graphemes: Some(1000usize), + ..Default::default() + }), ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("messageRef"), + LexUserType::Object(LexObject { + required: Some( + vec![ + SmolStr::new_static("did"), SmolStr::new_static("messageId"), + SmolStr::new_static("convoId") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("status"), + SmolStr::new_static("convoId"), LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( - SmolStr::new_static("unreadCount"), - LexObjectProperty::Integer(LexInteger { + SmolStr::new_static("did"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Did), ..Default::default() }), ); + map.insert( + SmolStr::new_static("messageId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); map }, ..Default::default() }), ); map.insert( - SmolStr::new_static("deletedMessageView"), + SmolStr::new_static("messageView"), LexUserType::Object(LexObject { required: Some( vec![ SmolStr::new_static("id"), SmolStr::new_static("rev"), - SmolStr::new_static("sender"), SmolStr::new_static("sentAt") + SmolStr::new_static("text"), SmolStr::new_static("sender"), + SmolStr::new_static("sentAt") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("embed"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("app.bsky.embed.record#view"), + CowStr::new_static("chat.bsky.embed.joinLink#view") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("facets"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Annotations of text (mentions, URLs, hashtags, etc)", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static("app.bsky.richtext.facet"), + ..Default::default() + }), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("id"), LexObjectProperty::String(LexString { ..Default::default() }), ); + map.insert( + SmolStr::new_static("reactions"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Reactions to this message, in ascending order of creation time.", + ), + ), + items: LexArrayItem::Ref(LexRef { + r#ref: CowStr::new_static("#reactionView"), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("replyTo"), + LexObjectProperty::Union(LexRefUnion { + description: Some( + CowStr::new_static( + "If set, the message this message is replying to. The full view of the referenced message is embedded so the client can render it inline. Only a single level is embedded: the embedded message will not itself have a populated 'replyTo' field even if it was also a reply.", + ), + ), + refs: vec![ + CowStr::new_static("#messageView"), + CowStr::new_static("#deletedMessageView"), + CowStr::new_static("#messageBeforeUserJoinedGroupView") + ], + ..Default::default() + }), + ); map.insert( SmolStr::new_static("rev"), LexObjectProperty::String(LexString { ..Default::default() }), @@ -1174,27 +4004,32 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("text"), + LexObjectProperty::String(LexString { + max_length: Some(10000usize), + max_graphemes: Some(1000usize), + ..Default::default() + }), + ); map }, ..Default::default() }), ); map.insert( - SmolStr::new_static("logAcceptConvo"), + SmolStr::new_static("messageViewSender"), LexUserType::Object(LexObject { - required: Some( - vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], - ), + required: Some(vec![SmolStr::new_static("did")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("rev"), - LexObjectProperty::String(LexString { ..Default::default() }), + SmolStr::new_static("did"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Did), + ..Default::default() + }), ); map }, @@ -1202,41 +4037,33 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("logAddReaction"), + SmolStr::new_static("reactionView"), LexUserType::Object(LexObject { required: Some( vec![ - SmolStr::new_static("rev"), SmolStr::new_static("convoId"), - SmolStr::new_static("message"), - SmolStr::new_static("reaction") + SmolStr::new_static("value"), SmolStr::new_static("sender"), + SmolStr::new_static("createdAt") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("message"), - LexObjectProperty::Union(LexRefUnion { - refs: vec![ - CowStr::new_static("#messageView"), - CowStr::new_static("#deletedMessageView") - ], + SmolStr::new_static("createdAt"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( - SmolStr::new_static("reaction"), + SmolStr::new_static("sender"), LexObjectProperty::Ref(LexRef { - r#ref: CowStr::new_static("#reactionView"), + r#ref: CowStr::new_static("#reactionViewSender"), ..Default::default() }), ); map.insert( - SmolStr::new_static("rev"), + SmolStr::new_static("value"), LexObjectProperty::String(LexString { ..Default::default() }), ); map @@ -1245,21 +4072,18 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("logBeginConvo"), + SmolStr::new_static("reactionViewSender"), LexUserType::Object(LexObject { - required: Some( - vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], - ), + required: Some(vec![SmolStr::new_static("did")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("rev"), - LexObjectProperty::String(LexString { ..Default::default() }), + SmolStr::new_static("did"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Did), + ..Default::default() + }), ); map }, @@ -1267,33 +4091,19 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("logCreateMessage"), + SmolStr::new_static("replyRef"), LexUserType::Object(LexObject { - required: Some( - vec![ - SmolStr::new_static("rev"), SmolStr::new_static("convoId"), - SmolStr::new_static("message") - ], + description: Some( + CowStr::new_static( + "A reference to another message within the same convo, used to indicate that a message is a reply to it.", + ), ), + required: Some(vec![SmolStr::new_static("messageId")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("message"), - LexObjectProperty::Union(LexRefUnion { - refs: vec![ - CowStr::new_static("#messageView"), - CowStr::new_static("#deletedMessageView") - ], - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("rev"), + SmolStr::new_static("messageId"), LexObjectProperty::String(LexString { ..Default::default() }), ); map @@ -1302,34 +4112,44 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("logDeleteMessage"), + SmolStr::new_static("systemMessageDataAddMember"), LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "System message indicating a user was added to the group convo.", + ), + ), required: Some( vec![ - SmolStr::new_static("rev"), SmolStr::new_static("convoId"), - SmolStr::new_static("message") + SmolStr::new_static("member"), SmolStr::new_static("role"), + SmolStr::new_static("addedBy") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), + SmolStr::new_static("addedBy"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageReferredUser"), + ..Default::default() + }), ); map.insert( - SmolStr::new_static("message"), - LexObjectProperty::Union(LexRefUnion { - refs: vec![ - CowStr::new_static("#messageView"), - CowStr::new_static("#deletedMessageView") - ], + SmolStr::new_static("member"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageReferredUser"), ..Default::default() }), ); map.insert( - SmolStr::new_static("rev"), - LexObjectProperty::String(LexString { ..Default::default() }), + SmolStr::new_static("role"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#memberRole", + ), + ..Default::default() + }), ); map }, @@ -1337,78 +4157,65 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("logLeaveConvo"), + SmolStr::new_static("systemMessageDataCreateJoinLink"), LexUserType::Object(LexObject { - required: Some( - vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + description: Some( + CowStr::new_static( + "System message indicating the group join link was created.", + ), ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); - map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("rev"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); map }, ..Default::default() }), ); map.insert( - SmolStr::new_static("logMuteConvo"), + SmolStr::new_static("systemMessageDataDisableJoinLink"), LexUserType::Object(LexObject { - required: Some( - vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + description: Some( + CowStr::new_static( + "System message indicating the group join link was disabled.", + ), ), properties: { #[allow(unused_mut)] - let mut map = BTreeMap::new(); - map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("rev"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); + let mut map = BTreeMap::new(); map }, ..Default::default() }), ); map.insert( - SmolStr::new_static("logReadMessage"), + SmolStr::new_static("systemMessageDataEditGroup"), LexUserType::Object(LexObject { - required: Some( - vec![ - SmolStr::new_static("rev"), SmolStr::new_static("convoId"), - SmolStr::new_static("message") - ], + description: Some( + CowStr::new_static( + "System message indicating the group info was edited.", + ), ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("message"), - LexObjectProperty::Union(LexRefUnion { - refs: vec![ - CowStr::new_static("#messageView"), - CowStr::new_static("#deletedMessageView") - ], + SmolStr::new_static("newName"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("Group name that replaced the old."), + ), ..Default::default() }), ); map.insert( - SmolStr::new_static("rev"), - LexObjectProperty::String(LexString { ..Default::default() }), + SmolStr::new_static("oldName"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("Group name that was replaced."), + ), + ..Default::default() + }), ); map }, @@ -1416,93 +4223,77 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("logRemoveReaction"), + SmolStr::new_static("systemMessageDataEditJoinLink"), LexUserType::Object(LexObject { - required: Some( - vec![ - SmolStr::new_static("rev"), SmolStr::new_static("convoId"), - SmolStr::new_static("message"), - SmolStr::new_static("reaction") - ], + description: Some( + CowStr::new_static( + "System message indicating the group join link was edited.", + ), ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); - map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("message"), - LexObjectProperty::Union(LexRefUnion { - refs: vec![ - CowStr::new_static("#messageView"), - CowStr::new_static("#deletedMessageView") - ], - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("reaction"), - LexObjectProperty::Ref(LexRef { - r#ref: CowStr::new_static("#reactionView"), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("rev"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); map }, ..Default::default() }), ); map.insert( - SmolStr::new_static("logUnmuteConvo"), + SmolStr::new_static("systemMessageDataEnableJoinLink"), LexUserType::Object(LexObject { - required: Some( - vec![SmolStr::new_static("rev"), SmolStr::new_static("convoId")], + description: Some( + CowStr::new_static( + "System message indicating the group join link was enabled.", + ), ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); - map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("rev"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); map }, ..Default::default() }), ); map.insert( - SmolStr::new_static("messageAndReactionView"), + SmolStr::new_static("systemMessageDataLockConvo"), LexUserType::Object(LexObject { - required: Some( - vec![ - SmolStr::new_static("message"), - SmolStr::new_static("reaction") - ], + description: Some( + CowStr::new_static( + "System message indicating the group convo was locked.", + ), ), + required: Some(vec![SmolStr::new_static("lockedBy")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("message"), + SmolStr::new_static("lockedBy"), LexObjectProperty::Ref(LexRef { - r#ref: CowStr::new_static("#messageView"), + r#ref: CowStr::new_static("#systemMessageReferredUser"), ..Default::default() }), ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("systemMessageDataLockConvoPermanently"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "System message indicating the group convo was locked permanently.", + ), + ), + required: Some(vec![SmolStr::new_static("lockedBy")]), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("reaction"), + SmolStr::new_static("lockedBy"), LexObjectProperty::Ref(LexRef { - r#ref: CowStr::new_static("#reactionView"), + r#ref: CowStr::new_static("#systemMessageReferredUser"), ..Default::default() }), ); @@ -1512,39 +4303,39 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("messageInput"), + SmolStr::new_static("systemMessageDataMemberJoin"), LexUserType::Object(LexObject { - required: Some(vec![SmolStr::new_static("text")]), + description: Some( + CowStr::new_static( + "System message indicating a user joined the group convo via join link.", + ), + ), + required: Some( + vec![SmolStr::new_static("member"), SmolStr::new_static("role")], + ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("embed"), - LexObjectProperty::Union(LexRefUnion { - refs: vec![CowStr::new_static("app.bsky.embed.record")], + SmolStr::new_static("approvedBy"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageReferredUser"), ..Default::default() }), ); map.insert( - SmolStr::new_static("facets"), - LexObjectProperty::Array(LexArray { - description: Some( - CowStr::new_static( - "Annotations of text (mentions, URLs, hashtags, etc)", - ), - ), - items: LexArrayItem::Ref(LexRef { - r#ref: CowStr::new_static("app.bsky.richtext.facet"), - ..Default::default() - }), + SmolStr::new_static("member"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageReferredUser"), ..Default::default() }), ); map.insert( - SmolStr::new_static("text"), - LexObjectProperty::String(LexString { - max_length: Some(10000usize), - max_graphemes: Some(1000usize), + SmolStr::new_static("role"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.actor.defs#memberRole", + ), ..Default::default() }), ); @@ -1554,116 +4345,81 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("messageRef"), + SmolStr::new_static("systemMessageDataMemberLeave"), LexUserType::Object(LexObject { - required: Some( - vec![ - SmolStr::new_static("did"), SmolStr::new_static("messageId"), - SmolStr::new_static("convoId") - ], + description: Some( + CowStr::new_static( + "System message indicating a user voluntarily left the group convo.", + ), ), + required: Some(vec![SmolStr::new_static("member")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("convoId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("did"), - LexObjectProperty::String(LexString { - format: Some(LexStringFormat::Did), + SmolStr::new_static("member"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageReferredUser"), ..Default::default() }), ); - map.insert( - SmolStr::new_static("messageId"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); map }, ..Default::default() }), ); map.insert( - SmolStr::new_static("messageView"), + SmolStr::new_static("systemMessageDataRemoveMember"), LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "System message indicating a user was removed from the group convo.", + ), + ), required: Some( vec![ - SmolStr::new_static("id"), SmolStr::new_static("rev"), - SmolStr::new_static("text"), SmolStr::new_static("sender"), - SmolStr::new_static("sentAt") + SmolStr::new_static("member"), + SmolStr::new_static("removedBy") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("embed"), - LexObjectProperty::Union(LexRefUnion { - refs: vec![ - CowStr::new_static("app.bsky.embed.record#view") - ], - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("facets"), - LexObjectProperty::Array(LexArray { - description: Some( - CowStr::new_static( - "Annotations of text (mentions, URLs, hashtags, etc)", - ), - ), - items: LexArrayItem::Ref(LexRef { - r#ref: CowStr::new_static("app.bsky.richtext.facet"), - ..Default::default() - }), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("id"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("reactions"), - LexObjectProperty::Array(LexArray { - description: Some( - CowStr::new_static( - "Reactions to this message, in ascending order of creation time.", - ), - ), - items: LexArrayItem::Ref(LexRef { - r#ref: CowStr::new_static("#reactionView"), - ..Default::default() - }), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("rev"), - LexObjectProperty::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("sender"), + SmolStr::new_static("member"), LexObjectProperty::Ref(LexRef { - r#ref: CowStr::new_static("#messageViewSender"), + r#ref: CowStr::new_static("#systemMessageReferredUser"), ..Default::default() }), ); map.insert( - SmolStr::new_static("sentAt"), - LexObjectProperty::String(LexString { - format: Some(LexStringFormat::Datetime), + SmolStr::new_static("removedBy"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageReferredUser"), ..Default::default() }), ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("systemMessageDataUnlockConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "System message indicating the group convo was unlocked.", + ), + ), + required: Some(vec![SmolStr::new_static("unlockedBy")]), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("text"), - LexObjectProperty::String(LexString { - max_length: Some(10000usize), - max_graphemes: Some(1000usize), + SmolStr::new_static("unlockedBy"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#systemMessageReferredUser"), ..Default::default() }), ); @@ -1673,7 +4429,7 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("messageViewSender"), + SmolStr::new_static("systemMessageReferredUser"), LexUserType::Object(LexObject { required: Some(vec![SmolStr::new_static("did")]), properties: { @@ -1692,51 +4448,49 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("reactionView"), + SmolStr::new_static("systemMessageView"), LexUserType::Object(LexObject { required: Some( vec![ - SmolStr::new_static("value"), SmolStr::new_static("sender"), - SmolStr::new_static("createdAt") + SmolStr::new_static("id"), SmolStr::new_static("rev"), + SmolStr::new_static("sentAt"), SmolStr::new_static("data") ], ), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("createdAt"), - LexObjectProperty::String(LexString { - format: Some(LexStringFormat::Datetime), + SmolStr::new_static("data"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("#systemMessageDataAddMember"), + CowStr::new_static("#systemMessageDataRemoveMember"), + CowStr::new_static("#systemMessageDataMemberJoin"), + CowStr::new_static("#systemMessageDataMemberLeave"), + CowStr::new_static("#systemMessageDataLockConvo"), + CowStr::new_static("#systemMessageDataUnlockConvo"), + CowStr::new_static("#systemMessageDataLockConvoPermanently"), + CowStr::new_static("#systemMessageDataEditGroup"), + CowStr::new_static("#systemMessageDataCreateJoinLink"), + CowStr::new_static("#systemMessageDataEditJoinLink"), + CowStr::new_static("#systemMessageDataEnableJoinLink"), + CowStr::new_static("#systemMessageDataDisableJoinLink") + ], ..Default::default() }), ); map.insert( - SmolStr::new_static("sender"), - LexObjectProperty::Ref(LexRef { - r#ref: CowStr::new_static("#reactionViewSender"), - ..Default::default() - }), + SmolStr::new_static("id"), + LexObjectProperty::String(LexString { ..Default::default() }), ); map.insert( - SmolStr::new_static("value"), + SmolStr::new_static("rev"), LexObjectProperty::String(LexString { ..Default::default() }), ); - map - }, - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("reactionViewSender"), - LexUserType::Object(LexObject { - required: Some(vec![SmolStr::new_static("did")]), - properties: { - #[allow(unused_mut)] - let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("did"), + SmolStr::new_static("sentAt"), LexObjectProperty::String(LexString { - format: Some(LexStringFormat::Did), + format: Some(LexStringFormat::Datetime), ..Default::default() }), ); @@ -1751,7 +4505,5480 @@ fn lexicon_doc_chat_bsky_convo_defs() -> LexiconDoc<'static> { } } -pub mod deleted_message_view_state { +pub mod convo_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Rev; + type Id; + type UnreadCount; + type Members; + type Muted; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Rev = Unset; + type Id = Unset; + type UnreadCount = Unset; + type Members = Unset; + type Muted = Unset; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Rev = Set; + type Id = St::Id; + type UnreadCount = St::UnreadCount; + type Members = St::Members; + type Muted = St::Muted; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData St>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Rev = St::Rev; + type Id = Set; + type UnreadCount = St::UnreadCount; + type Members = St::Members; + type Muted = St::Muted; + } + ///State transition - sets the `unread_count` field to Set + pub struct SetUnreadCount(PhantomData St>); + impl sealed::Sealed for SetUnreadCount {} + impl State for SetUnreadCount { + type Rev = St::Rev; + type Id = St::Id; + type UnreadCount = Set; + type Members = St::Members; + type Muted = St::Muted; + } + ///State transition - sets the `members` field to Set + pub struct SetMembers(PhantomData St>); + impl sealed::Sealed for SetMembers {} + impl State for SetMembers { + type Rev = St::Rev; + type Id = St::Id; + type UnreadCount = St::UnreadCount; + type Members = Set; + type Muted = St::Muted; + } + ///State transition - sets the `muted` field to Set + pub struct SetMuted(PhantomData St>); + impl sealed::Sealed for SetMuted {} + impl State for SetMuted { + type Rev = St::Rev; + type Id = St::Id; + type UnreadCount = St::UnreadCount; + type Members = St::Members; + type Muted = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `id` field + pub struct id(()); + ///Marker type for the `unread_count` field + pub struct unread_count(()); + ///Marker type for the `members` field + pub struct members(()); + ///Marker type for the `muted` field + pub struct muted(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct ConvoViewBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>, + Option>, + Option>>, + Option, + Option, + Option>, + Option, + ), + _type: PhantomData S>, +} + +impl ConvoView { + /// Create a new builder for this type. + pub fn new() -> ConvoViewBuilder { + ConvoViewBuilder::new() + } +} + +impl ConvoViewBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + ConvoViewBuilder { + _state: PhantomData, + _fields: (None, None, None, None, None, None, None, None, None), + _type: PhantomData, + } + } +} + +impl ConvoViewBuilder +where + St: convo_view_state::State, + St::Id: convo_view_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into, + ) -> ConvoViewBuilder> { + self._fields.0 = Option::Some(value.into()); + ConvoViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ConvoViewBuilder { + /// Set the `kind` field (optional) + pub fn kind(mut self, value: impl Into>>) -> Self { + self._fields.1 = value.into(); + self + } + /// Set the `kind` field to an Option value (optional) + pub fn maybe_kind(mut self, value: Option>) -> Self { + self._fields.1 = value; + self + } +} + +impl ConvoViewBuilder { + /// Set the `lastMessage` field (optional) + pub fn last_message( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.2 = value.into(); + self + } + /// Set the `lastMessage` field to an Option value (optional) + pub fn maybe_last_message(mut self, value: Option>) -> Self { + self._fields.2 = value; + self + } +} + +impl ConvoViewBuilder { + /// Set the `lastReaction` field (optional) + pub fn last_reaction( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `lastReaction` field to an Option value (optional) + pub fn maybe_last_reaction( + mut self, + value: Option>, + ) -> Self { + self._fields.3 = value; + self + } +} + +impl ConvoViewBuilder +where + St: convo_view_state::State, + St::Members: convo_view_state::IsUnset, +{ + /// Set the `members` field (required) + pub fn members( + mut self, + value: impl Into>>, + ) -> ConvoViewBuilder> { + self._fields.4 = Option::Some(value.into()); + ConvoViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ConvoViewBuilder +where + St: convo_view_state::State, + St::Muted: convo_view_state::IsUnset, +{ + /// Set the `muted` field (required) + pub fn muted( + mut self, + value: impl Into, + ) -> ConvoViewBuilder> { + self._fields.5 = Option::Some(value.into()); + ConvoViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ConvoViewBuilder +where + St: convo_view_state::State, + St::Rev: convo_view_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> ConvoViewBuilder> { + self._fields.6 = Option::Some(value.into()); + ConvoViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ConvoViewBuilder { + /// Set the `status` field (optional) + pub fn status(mut self, value: impl Into>>) -> Self { + self._fields.7 = value.into(); + self + } + /// Set the `status` field to an Option value (optional) + pub fn maybe_status(mut self, value: Option>) -> Self { + self._fields.7 = value; + self + } +} + +impl ConvoViewBuilder +where + St: convo_view_state::State, + St::UnreadCount: convo_view_state::IsUnset, +{ + /// Set the `unreadCount` field (required) + pub fn unread_count( + mut self, + value: impl Into, + ) -> ConvoViewBuilder> { + self._fields.8 = Option::Some(value.into()); + ConvoViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ConvoViewBuilder +where + St: convo_view_state::State, + St::Rev: convo_view_state::IsSet, + St::Id: convo_view_state::IsSet, + St::UnreadCount: convo_view_state::IsSet, + St::Members: convo_view_state::IsSet, + St::Muted: convo_view_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> ConvoView { + ConvoView { + id: self._fields.0.unwrap(), + kind: self._fields.1, + last_message: self._fields.2, + last_reaction: self._fields.3, + members: self._fields.4.unwrap(), + muted: self._fields.5.unwrap(), + rev: self._fields.6.unwrap(), + status: self._fields.7, + unread_count: self._fields.8.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> ConvoView { + ConvoView { + id: self._fields.0.unwrap(), + kind: self._fields.1, + last_message: self._fields.2, + last_reaction: self._fields.3, + members: self._fields.4.unwrap(), + muted: self._fields.5.unwrap(), + rev: self._fields.6.unwrap(), + status: self._fields.7, + unread_count: self._fields.8.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod deleted_message_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type SentAt; + type Rev; + type Sender; + type Id; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type SentAt = Unset; + type Rev = Unset; + type Sender = Unset; + type Id = Unset; + } + ///State transition - sets the `sent_at` field to Set + pub struct SetSentAt(PhantomData St>); + impl sealed::Sealed for SetSentAt {} + impl State for SetSentAt { + type SentAt = Set; + type Rev = St::Rev; + type Sender = St::Sender; + type Id = St::Id; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type SentAt = St::SentAt; + type Rev = Set; + type Sender = St::Sender; + type Id = St::Id; + } + ///State transition - sets the `sender` field to Set + pub struct SetSender(PhantomData St>); + impl sealed::Sealed for SetSender {} + impl State for SetSender { + type SentAt = St::SentAt; + type Rev = St::Rev; + type Sender = Set; + type Id = St::Id; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData St>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type SentAt = St::SentAt; + type Rev = St::Rev; + type Sender = St::Sender; + type Id = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `sent_at` field + pub struct sent_at(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `sender` field + pub struct sender(()); + ///Marker type for the `id` field + pub struct id(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct DeletedMessageViewBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option, + Option>, + Option, + ), + _type: PhantomData S>, +} + +impl DeletedMessageView { + /// Create a new builder for this type. + pub fn new() -> DeletedMessageViewBuilder { + DeletedMessageViewBuilder::new() + } +} + +impl DeletedMessageViewBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + DeletedMessageViewBuilder { + _state: PhantomData, + _fields: (None, None, None, None), + _type: PhantomData, + } + } +} + +impl DeletedMessageViewBuilder +where + St: deleted_message_view_state::State, + St::Id: deleted_message_view_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into, + ) -> DeletedMessageViewBuilder> { + self._fields.0 = Option::Some(value.into()); + DeletedMessageViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl DeletedMessageViewBuilder +where + St: deleted_message_view_state::State, + St::Rev: deleted_message_view_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> DeletedMessageViewBuilder> { + self._fields.1 = Option::Some(value.into()); + DeletedMessageViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl DeletedMessageViewBuilder +where + St: deleted_message_view_state::State, + St::Sender: deleted_message_view_state::IsUnset, +{ + /// Set the `sender` field (required) + pub fn sender( + mut self, + value: impl Into>, + ) -> DeletedMessageViewBuilder> { + self._fields.2 = Option::Some(value.into()); + DeletedMessageViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl DeletedMessageViewBuilder +where + St: deleted_message_view_state::State, + St::SentAt: deleted_message_view_state::IsUnset, +{ + /// Set the `sentAt` field (required) + pub fn sent_at( + mut self, + value: impl Into, + ) -> DeletedMessageViewBuilder> { + self._fields.3 = Option::Some(value.into()); + DeletedMessageViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl DeletedMessageViewBuilder +where + St: deleted_message_view_state::State, + St::SentAt: deleted_message_view_state::IsSet, + St::Rev: deleted_message_view_state::IsSet, + St::Sender: deleted_message_view_state::IsSet, + St::Id: deleted_message_view_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> DeletedMessageView { + DeletedMessageView { + id: self._fields.0.unwrap(), + rev: self._fields.1.unwrap(), + sender: self._fields.2.unwrap(), + sent_at: self._fields.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> DeletedMessageView { + DeletedMessageView { + id: self._fields.0.unwrap(), + rev: self._fields.1.unwrap(), + sender: self._fields.2.unwrap(), + sent_at: self._fields.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod group_convo_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type LockStatus; + type LockStatusModerationOverride; + type CreatedAt; + type MemberCount; + type MemberLimit; + type Name; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type LockStatus = Unset; + type LockStatusModerationOverride = Unset; + type CreatedAt = Unset; + type MemberCount = Unset; + type MemberLimit = Unset; + type Name = Unset; + } + ///State transition - sets the `lock_status` field to Set + pub struct SetLockStatus(PhantomData St>); + impl sealed::Sealed for SetLockStatus {} + impl State for SetLockStatus { + type LockStatus = Set; + type LockStatusModerationOverride = St::LockStatusModerationOverride; + type CreatedAt = St::CreatedAt; + type MemberCount = St::MemberCount; + type MemberLimit = St::MemberLimit; + type Name = St::Name; + } + ///State transition - sets the `lock_status_moderation_override` field to Set + pub struct SetLockStatusModerationOverride( + PhantomData St>, + ); + impl sealed::Sealed for SetLockStatusModerationOverride {} + impl State for SetLockStatusModerationOverride { + type LockStatus = St::LockStatus; + type LockStatusModerationOverride = Set< + members::lock_status_moderation_override, + >; + type CreatedAt = St::CreatedAt; + type MemberCount = St::MemberCount; + type MemberLimit = St::MemberLimit; + type Name = St::Name; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type LockStatus = St::LockStatus; + type LockStatusModerationOverride = St::LockStatusModerationOverride; + type CreatedAt = Set; + type MemberCount = St::MemberCount; + type MemberLimit = St::MemberLimit; + type Name = St::Name; + } + ///State transition - sets the `member_count` field to Set + pub struct SetMemberCount(PhantomData St>); + impl sealed::Sealed for SetMemberCount {} + impl State for SetMemberCount { + type LockStatus = St::LockStatus; + type LockStatusModerationOverride = St::LockStatusModerationOverride; + type CreatedAt = St::CreatedAt; + type MemberCount = Set; + type MemberLimit = St::MemberLimit; + type Name = St::Name; + } + ///State transition - sets the `member_limit` field to Set + pub struct SetMemberLimit(PhantomData St>); + impl sealed::Sealed for SetMemberLimit {} + impl State for SetMemberLimit { + type LockStatus = St::LockStatus; + type LockStatusModerationOverride = St::LockStatusModerationOverride; + type CreatedAt = St::CreatedAt; + type MemberCount = St::MemberCount; + type MemberLimit = Set; + type Name = St::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData St>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type LockStatus = St::LockStatus; + type LockStatusModerationOverride = St::LockStatusModerationOverride; + type CreatedAt = St::CreatedAt; + type MemberCount = St::MemberCount; + type MemberLimit = St::MemberLimit; + type Name = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `lock_status` field + pub struct lock_status(()); + ///Marker type for the `lock_status_moderation_override` field + pub struct lock_status_moderation_override(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `member_count` field + pub struct member_count(()); + ///Marker type for the `member_limit` field + pub struct member_limit(()); + ///Marker type for the `name` field + pub struct name(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct GroupConvoBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option, + Option>, + Option, + Option, + Option, + Option, + Option, + ), + _type: PhantomData S>, +} + +impl GroupConvo { + /// Create a new builder for this type. + pub fn new() -> GroupConvoBuilder { + GroupConvoBuilder::new() + } +} + +impl GroupConvoBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + GroupConvoBuilder { + _state: PhantomData, + _fields: (None, None, None, None, None, None, None, None, None), + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::CreatedAt: group_convo_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> GroupConvoBuilder> { + self._fields.0 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder { + /// Set the `joinLink` field (optional) + pub fn join_link(mut self, value: impl Into>>) -> Self { + self._fields.1 = value.into(); + self + } + /// Set the `joinLink` field to an Option value (optional) + pub fn maybe_join_link(mut self, value: Option>) -> Self { + self._fields.1 = value; + self + } +} + +impl GroupConvoBuilder { + /// Set the `joinRequestCount` field (optional) + pub fn join_request_count(mut self, value: impl Into>) -> Self { + self._fields.2 = value.into(); + self + } + /// Set the `joinRequestCount` field to an Option value (optional) + pub fn maybe_join_request_count(mut self, value: Option) -> Self { + self._fields.2 = value; + self + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::LockStatus: group_convo_state::IsUnset, +{ + /// Set the `lockStatus` field (required) + pub fn lock_status( + mut self, + value: impl Into>, + ) -> GroupConvoBuilder> { + self._fields.3 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::LockStatusModerationOverride: group_convo_state::IsUnset, +{ + /// Set the `lockStatusModerationOverride` field (required) + pub fn lock_status_moderation_override( + mut self, + value: impl Into, + ) -> GroupConvoBuilder> { + self._fields.4 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::MemberCount: group_convo_state::IsUnset, +{ + /// Set the `memberCount` field (required) + pub fn member_count( + mut self, + value: impl Into, + ) -> GroupConvoBuilder> { + self._fields.5 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::MemberLimit: group_convo_state::IsUnset, +{ + /// Set the `memberLimit` field (required) + pub fn member_limit( + mut self, + value: impl Into, + ) -> GroupConvoBuilder> { + self._fields.6 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::Name: group_convo_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into, + ) -> GroupConvoBuilder> { + self._fields.7 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder { + /// Set the `unreadJoinRequestCount` field (optional) + pub fn unread_join_request_count(mut self, value: impl Into>) -> Self { + self._fields.8 = value.into(); + self + } + /// Set the `unreadJoinRequestCount` field to an Option value (optional) + pub fn maybe_unread_join_request_count(mut self, value: Option) -> Self { + self._fields.8 = value; + self + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::LockStatus: group_convo_state::IsSet, + St::LockStatusModerationOverride: group_convo_state::IsSet, + St::CreatedAt: group_convo_state::IsSet, + St::MemberCount: group_convo_state::IsSet, + St::MemberLimit: group_convo_state::IsSet, + St::Name: group_convo_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> GroupConvo { + GroupConvo { + created_at: self._fields.0.unwrap(), + join_link: self._fields.1, + join_request_count: self._fields.2, + lock_status: self._fields.3.unwrap(), + lock_status_moderation_override: self._fields.4.unwrap(), + member_count: self._fields.5.unwrap(), + member_limit: self._fields.6.unwrap(), + name: self._fields.7.unwrap(), + unread_join_request_count: self._fields.8, + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> GroupConvo { + GroupConvo { + created_at: self._fields.0.unwrap(), + join_link: self._fields.1, + join_request_count: self._fields.2, + lock_status: self._fields.3.unwrap(), + lock_status_moderation_override: self._fields.4.unwrap(), + member_count: self._fields.5.unwrap(), + member_limit: self._fields.6.unwrap(), + name: self._fields.7.unwrap(), + unread_join_request_count: self._fields.8, + extra_data: Some(extra_data), + } + } +} + +pub mod log_add_member_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Rev; + type Message; + type RelatedProfiles; + type ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Rev = Unset; + type Message = Unset; + type RelatedProfiles = Unset; + type ConvoId = Unset; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Rev = Set; + type Message = St::Message; + type RelatedProfiles = St::RelatedProfiles; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Rev = St::Rev; + type Message = Set; + type RelatedProfiles = St::RelatedProfiles; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `related_profiles` field to Set + pub struct SetRelatedProfiles(PhantomData St>); + impl sealed::Sealed for SetRelatedProfiles {} + impl State for SetRelatedProfiles { + type Rev = St::Rev; + type Message = St::Message; + type RelatedProfiles = Set; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Rev = St::Rev; + type Message = St::Message; + type RelatedProfiles = St::RelatedProfiles; + type ConvoId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `related_profiles` field + pub struct related_profiles(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogAddMemberBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>>, + Option, + ), + _type: PhantomData S>, +} + +impl LogAddMember { + /// Create a new builder for this type. + pub fn new() -> LogAddMemberBuilder { + LogAddMemberBuilder::new() + } +} + +impl LogAddMemberBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogAddMemberBuilder { + _state: PhantomData, + _fields: (None, None, None, None), + _type: PhantomData, + } + } +} + +impl LogAddMemberBuilder +where + St: log_add_member_state::State, + St::ConvoId: log_add_member_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogAddMemberBuilder> { + self._fields.0 = Option::Some(value.into()); + LogAddMemberBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogAddMemberBuilder +where + St: log_add_member_state::State, + St::Message: log_add_member_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogAddMemberBuilder> { + self._fields.1 = Option::Some(value.into()); + LogAddMemberBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogAddMemberBuilder +where + St: log_add_member_state::State, + St::RelatedProfiles: log_add_member_state::IsUnset, +{ + /// Set the `relatedProfiles` field (required) + pub fn related_profiles( + mut self, + value: impl Into>>, + ) -> LogAddMemberBuilder> { + self._fields.2 = Option::Some(value.into()); + LogAddMemberBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogAddMemberBuilder +where + St: log_add_member_state::State, + St::Rev: log_add_member_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogAddMemberBuilder> { + self._fields.3 = Option::Some(value.into()); + LogAddMemberBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogAddMemberBuilder +where + St: log_add_member_state::State, + St::Rev: log_add_member_state::IsSet, + St::Message: log_add_member_state::IsSet, + St::RelatedProfiles: log_add_member_state::IsSet, + St::ConvoId: log_add_member_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogAddMember { + LogAddMember { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogAddMember { + LogAddMember { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_add_reaction_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Reaction; + type Rev; + type ConvoId; + type Message; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Reaction = Unset; + type Rev = Unset; + type ConvoId = Unset; + type Message = Unset; + } + ///State transition - sets the `reaction` field to Set + pub struct SetReaction(PhantomData St>); + impl sealed::Sealed for SetReaction {} + impl State for SetReaction { + type Reaction = Set; + type Rev = St::Rev; + type ConvoId = St::ConvoId; + type Message = St::Message; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Reaction = St::Reaction; + type Rev = Set; + type ConvoId = St::ConvoId; + type Message = St::Message; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Reaction = St::Reaction; + type Rev = St::Rev; + type ConvoId = Set; + type Message = St::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Reaction = St::Reaction; + type Rev = St::Rev; + type ConvoId = St::ConvoId; + type Message = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `reaction` field + pub struct reaction(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogAddReactionBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>, + Option>>, + Option, + ), + _type: PhantomData S>, +} + +impl LogAddReaction { + /// Create a new builder for this type. + pub fn new() -> LogAddReactionBuilder { + LogAddReactionBuilder::new() + } +} + +impl LogAddReactionBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogAddReactionBuilder { + _state: PhantomData, + _fields: (None, None, None, None, None), + _type: PhantomData, + } + } +} + +impl LogAddReactionBuilder +where + St: log_add_reaction_state::State, + St::ConvoId: log_add_reaction_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogAddReactionBuilder> { + self._fields.0 = Option::Some(value.into()); + LogAddReactionBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogAddReactionBuilder +where + St: log_add_reaction_state::State, + St::Message: log_add_reaction_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogAddReactionBuilder> { + self._fields.1 = Option::Some(value.into()); + LogAddReactionBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogAddReactionBuilder +where + St: log_add_reaction_state::State, + St::Reaction: log_add_reaction_state::IsUnset, +{ + /// Set the `reaction` field (required) + pub fn reaction( + mut self, + value: impl Into>, + ) -> LogAddReactionBuilder> { + self._fields.2 = Option::Some(value.into()); + LogAddReactionBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogAddReactionBuilder { + /// Set the `relatedProfiles` field (optional) + pub fn related_profiles( + mut self, + value: impl Into>>>, + ) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `relatedProfiles` field to an Option value (optional) + pub fn maybe_related_profiles( + mut self, + value: Option>>, + ) -> Self { + self._fields.3 = value; + self + } +} + +impl LogAddReactionBuilder +where + St: log_add_reaction_state::State, + St::Rev: log_add_reaction_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogAddReactionBuilder> { + self._fields.4 = Option::Some(value.into()); + LogAddReactionBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogAddReactionBuilder +where + St: log_add_reaction_state::State, + St::Reaction: log_add_reaction_state::IsSet, + St::Rev: log_add_reaction_state::IsSet, + St::ConvoId: log_add_reaction_state::IsSet, + St::Message: log_add_reaction_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogAddReaction { + LogAddReaction { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + reaction: self._fields.2.unwrap(), + related_profiles: self._fields.3, + rev: self._fields.4.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogAddReaction { + LogAddReaction { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + reaction: self._fields.2.unwrap(), + related_profiles: self._fields.3, + rev: self._fields.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_approve_join_request_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Rev; + type ConvoId; + type Member; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Rev = Unset; + type ConvoId = Unset; + type Member = Unset; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Rev = Set; + type ConvoId = St::ConvoId; + type Member = St::Member; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Rev = St::Rev; + type ConvoId = Set; + type Member = St::Member; + } + ///State transition - sets the `member` field to Set + pub struct SetMember(PhantomData St>); + impl sealed::Sealed for SetMember {} + impl State for SetMember { + type Rev = St::Rev; + type ConvoId = St::ConvoId; + type Member = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `member` field + pub struct member(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogApproveJoinRequestBuilder< + S: BosStr, + St: log_approve_join_request_state::State, +> { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogApproveJoinRequest { + /// Create a new builder for this type. + pub fn new() -> LogApproveJoinRequestBuilder< + S, + log_approve_join_request_state::Empty, + > { + LogApproveJoinRequestBuilder::new() + } +} + +impl LogApproveJoinRequestBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogApproveJoinRequestBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogApproveJoinRequestBuilder +where + St: log_approve_join_request_state::State, + St::ConvoId: log_approve_join_request_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogApproveJoinRequestBuilder< + S, + log_approve_join_request_state::SetConvoId, + > { + self._fields.0 = Option::Some(value.into()); + LogApproveJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogApproveJoinRequestBuilder +where + St: log_approve_join_request_state::State, + St::Member: log_approve_join_request_state::IsUnset, +{ + /// Set the `member` field (required) + pub fn member( + mut self, + value: impl Into>, + ) -> LogApproveJoinRequestBuilder> { + self._fields.1 = Option::Some(value.into()); + LogApproveJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogApproveJoinRequestBuilder +where + St: log_approve_join_request_state::State, + St::Rev: log_approve_join_request_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogApproveJoinRequestBuilder> { + self._fields.2 = Option::Some(value.into()); + LogApproveJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogApproveJoinRequestBuilder +where + St: log_approve_join_request_state::State, + St::Rev: log_approve_join_request_state::IsSet, + St::ConvoId: log_approve_join_request_state::IsSet, + St::Member: log_approve_join_request_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogApproveJoinRequest { + LogApproveJoinRequest { + convo_id: self._fields.0.unwrap(), + member: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogApproveJoinRequest { + LogApproveJoinRequest { + convo_id: self._fields.0.unwrap(), + member: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_create_join_link_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Message; + type ConvoId; + type Rev; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Message = Unset; + type ConvoId = Unset; + type Rev = Unset; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; + type ConvoId = St::ConvoId; + type Rev = St::Rev; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Message = St::Message; + type ConvoId = Set; + type Rev = St::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Message = St::Message; + type ConvoId = St::ConvoId; + type Rev = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `rev` field + pub struct rev(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogCreateJoinLinkBuilder { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogCreateJoinLink { + /// Create a new builder for this type. + pub fn new() -> LogCreateJoinLinkBuilder { + LogCreateJoinLinkBuilder::new() + } +} + +impl LogCreateJoinLinkBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogCreateJoinLinkBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogCreateJoinLinkBuilder +where + St: log_create_join_link_state::State, + St::ConvoId: log_create_join_link_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogCreateJoinLinkBuilder> { + self._fields.0 = Option::Some(value.into()); + LogCreateJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogCreateJoinLinkBuilder +where + St: log_create_join_link_state::State, + St::Message: log_create_join_link_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogCreateJoinLinkBuilder> { + self._fields.1 = Option::Some(value.into()); + LogCreateJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogCreateJoinLinkBuilder +where + St: log_create_join_link_state::State, + St::Rev: log_create_join_link_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogCreateJoinLinkBuilder> { + self._fields.2 = Option::Some(value.into()); + LogCreateJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogCreateJoinLinkBuilder +where + St: log_create_join_link_state::State, + St::Message: log_create_join_link_state::IsSet, + St::ConvoId: log_create_join_link_state::IsSet, + St::Rev: log_create_join_link_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogCreateJoinLink { + LogCreateJoinLink { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogCreateJoinLink { + LogCreateJoinLink { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_create_message_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type ConvoId; + type Rev; + type Message; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = Unset; + type Rev = Unset; + type Message = Unset; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type ConvoId = Set; + type Rev = St::Rev; + type Message = St::Message; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type ConvoId = St::ConvoId; + type Rev = Set; + type Message = St::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type ConvoId = St::ConvoId; + type Rev = St::Rev; + type Message = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `message` field + pub struct message(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogCreateMessageBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>>, + Option, + ), + _type: PhantomData S>, +} + +impl LogCreateMessage { + /// Create a new builder for this type. + pub fn new() -> LogCreateMessageBuilder { + LogCreateMessageBuilder::new() + } +} + +impl LogCreateMessageBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogCreateMessageBuilder { + _state: PhantomData, + _fields: (None, None, None, None), + _type: PhantomData, + } + } +} + +impl LogCreateMessageBuilder +where + St: log_create_message_state::State, + St::ConvoId: log_create_message_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogCreateMessageBuilder> { + self._fields.0 = Option::Some(value.into()); + LogCreateMessageBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogCreateMessageBuilder +where + St: log_create_message_state::State, + St::Message: log_create_message_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogCreateMessageBuilder> { + self._fields.1 = Option::Some(value.into()); + LogCreateMessageBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogCreateMessageBuilder { + /// Set the `relatedProfiles` field (optional) + pub fn related_profiles( + mut self, + value: impl Into>>>, + ) -> Self { + self._fields.2 = value.into(); + self + } + /// Set the `relatedProfiles` field to an Option value (optional) + pub fn maybe_related_profiles( + mut self, + value: Option>>, + ) -> Self { + self._fields.2 = value; + self + } +} + +impl LogCreateMessageBuilder +where + St: log_create_message_state::State, + St::Rev: log_create_message_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogCreateMessageBuilder> { + self._fields.3 = Option::Some(value.into()); + LogCreateMessageBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogCreateMessageBuilder +where + St: log_create_message_state::State, + St::ConvoId: log_create_message_state::IsSet, + St::Rev: log_create_message_state::IsSet, + St::Message: log_create_message_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogCreateMessage { + LogCreateMessage { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2, + rev: self._fields.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogCreateMessage { + LogCreateMessage { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2, + rev: self._fields.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_delete_message_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Rev; + type Message; + type ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Rev = Unset; + type Message = Unset; + type ConvoId = Unset; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Rev = Set; + type Message = St::Message; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Rev = St::Rev; + type Message = Set; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Rev = St::Rev; + type Message = St::Message; + type ConvoId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogDeleteMessageBuilder { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogDeleteMessage { + /// Create a new builder for this type. + pub fn new() -> LogDeleteMessageBuilder { + LogDeleteMessageBuilder::new() + } +} + +impl LogDeleteMessageBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogDeleteMessageBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogDeleteMessageBuilder +where + St: log_delete_message_state::State, + St::ConvoId: log_delete_message_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogDeleteMessageBuilder> { + self._fields.0 = Option::Some(value.into()); + LogDeleteMessageBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogDeleteMessageBuilder +where + St: log_delete_message_state::State, + St::Message: log_delete_message_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogDeleteMessageBuilder> { + self._fields.1 = Option::Some(value.into()); + LogDeleteMessageBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogDeleteMessageBuilder +where + St: log_delete_message_state::State, + St::Rev: log_delete_message_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogDeleteMessageBuilder> { + self._fields.2 = Option::Some(value.into()); + LogDeleteMessageBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogDeleteMessageBuilder +where + St: log_delete_message_state::State, + St::Rev: log_delete_message_state::IsSet, + St::Message: log_delete_message_state::IsSet, + St::ConvoId: log_delete_message_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogDeleteMessage { + LogDeleteMessage { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogDeleteMessage { + LogDeleteMessage { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_disable_join_link_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Rev; + type ConvoId; + type Message; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Rev = Unset; + type ConvoId = Unset; + type Message = Unset; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Rev = Set; + type ConvoId = St::ConvoId; + type Message = St::Message; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Rev = St::Rev; + type ConvoId = Set; + type Message = St::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Rev = St::Rev; + type ConvoId = St::ConvoId; + type Message = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogDisableJoinLinkBuilder { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogDisableJoinLink { + /// Create a new builder for this type. + pub fn new() -> LogDisableJoinLinkBuilder { + LogDisableJoinLinkBuilder::new() + } +} + +impl LogDisableJoinLinkBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogDisableJoinLinkBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogDisableJoinLinkBuilder +where + St: log_disable_join_link_state::State, + St::ConvoId: log_disable_join_link_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogDisableJoinLinkBuilder> { + self._fields.0 = Option::Some(value.into()); + LogDisableJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogDisableJoinLinkBuilder +where + St: log_disable_join_link_state::State, + St::Message: log_disable_join_link_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogDisableJoinLinkBuilder> { + self._fields.1 = Option::Some(value.into()); + LogDisableJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogDisableJoinLinkBuilder +where + St: log_disable_join_link_state::State, + St::Rev: log_disable_join_link_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogDisableJoinLinkBuilder> { + self._fields.2 = Option::Some(value.into()); + LogDisableJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogDisableJoinLinkBuilder +where + St: log_disable_join_link_state::State, + St::Rev: log_disable_join_link_state::IsSet, + St::ConvoId: log_disable_join_link_state::IsSet, + St::Message: log_disable_join_link_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogDisableJoinLink { + LogDisableJoinLink { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogDisableJoinLink { + LogDisableJoinLink { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_edit_group_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Message; + type Rev; + type ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Message = Unset; + type Rev = Unset; + type ConvoId = Unset; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; + type Rev = St::Rev; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Message = St::Message; + type Rev = Set; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Message = St::Message; + type Rev = St::Rev; + type ConvoId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogEditGroupBuilder { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogEditGroup { + /// Create a new builder for this type. + pub fn new() -> LogEditGroupBuilder { + LogEditGroupBuilder::new() + } +} + +impl LogEditGroupBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogEditGroupBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogEditGroupBuilder +where + St: log_edit_group_state::State, + St::ConvoId: log_edit_group_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogEditGroupBuilder> { + self._fields.0 = Option::Some(value.into()); + LogEditGroupBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogEditGroupBuilder +where + St: log_edit_group_state::State, + St::Message: log_edit_group_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogEditGroupBuilder> { + self._fields.1 = Option::Some(value.into()); + LogEditGroupBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogEditGroupBuilder +where + St: log_edit_group_state::State, + St::Rev: log_edit_group_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogEditGroupBuilder> { + self._fields.2 = Option::Some(value.into()); + LogEditGroupBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogEditGroupBuilder +where + St: log_edit_group_state::State, + St::Message: log_edit_group_state::IsSet, + St::Rev: log_edit_group_state::IsSet, + St::ConvoId: log_edit_group_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogEditGroup { + LogEditGroup { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogEditGroup { + LogEditGroup { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_edit_join_link_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type ConvoId; + type Message; + type Rev; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = Unset; + type Message = Unset; + type Rev = Unset; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type ConvoId = Set; + type Message = St::Message; + type Rev = St::Rev; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type ConvoId = St::ConvoId; + type Message = Set; + type Rev = St::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type ConvoId = St::ConvoId; + type Message = St::Message; + type Rev = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogEditJoinLinkBuilder { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogEditJoinLink { + /// Create a new builder for this type. + pub fn new() -> LogEditJoinLinkBuilder { + LogEditJoinLinkBuilder::new() + } +} + +impl LogEditJoinLinkBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogEditJoinLinkBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogEditJoinLinkBuilder +where + St: log_edit_join_link_state::State, + St::ConvoId: log_edit_join_link_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogEditJoinLinkBuilder> { + self._fields.0 = Option::Some(value.into()); + LogEditJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogEditJoinLinkBuilder +where + St: log_edit_join_link_state::State, + St::Message: log_edit_join_link_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogEditJoinLinkBuilder> { + self._fields.1 = Option::Some(value.into()); + LogEditJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogEditJoinLinkBuilder +where + St: log_edit_join_link_state::State, + St::Rev: log_edit_join_link_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogEditJoinLinkBuilder> { + self._fields.2 = Option::Some(value.into()); + LogEditJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogEditJoinLinkBuilder +where + St: log_edit_join_link_state::State, + St::ConvoId: log_edit_join_link_state::IsSet, + St::Message: log_edit_join_link_state::IsSet, + St::Rev: log_edit_join_link_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogEditJoinLink { + LogEditJoinLink { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogEditJoinLink { + LogEditJoinLink { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_enable_join_link_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Message; + type Rev; + type ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Message = Unset; + type Rev = Unset; + type ConvoId = Unset; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; + type Rev = St::Rev; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Message = St::Message; + type Rev = Set; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Message = St::Message; + type Rev = St::Rev; + type ConvoId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogEnableJoinLinkBuilder { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogEnableJoinLink { + /// Create a new builder for this type. + pub fn new() -> LogEnableJoinLinkBuilder { + LogEnableJoinLinkBuilder::new() + } +} + +impl LogEnableJoinLinkBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogEnableJoinLinkBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogEnableJoinLinkBuilder +where + St: log_enable_join_link_state::State, + St::ConvoId: log_enable_join_link_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogEnableJoinLinkBuilder> { + self._fields.0 = Option::Some(value.into()); + LogEnableJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogEnableJoinLinkBuilder +where + St: log_enable_join_link_state::State, + St::Message: log_enable_join_link_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogEnableJoinLinkBuilder> { + self._fields.1 = Option::Some(value.into()); + LogEnableJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogEnableJoinLinkBuilder +where + St: log_enable_join_link_state::State, + St::Rev: log_enable_join_link_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogEnableJoinLinkBuilder> { + self._fields.2 = Option::Some(value.into()); + LogEnableJoinLinkBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogEnableJoinLinkBuilder +where + St: log_enable_join_link_state::State, + St::Message: log_enable_join_link_state::IsSet, + St::Rev: log_enable_join_link_state::IsSet, + St::ConvoId: log_enable_join_link_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogEnableJoinLink { + LogEnableJoinLink { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogEnableJoinLink { + LogEnableJoinLink { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_incoming_join_request_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Rev; + type ConvoId; + type Member; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Rev = Unset; + type ConvoId = Unset; + type Member = Unset; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Rev = Set; + type ConvoId = St::ConvoId; + type Member = St::Member; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Rev = St::Rev; + type ConvoId = Set; + type Member = St::Member; + } + ///State transition - sets the `member` field to Set + pub struct SetMember(PhantomData St>); + impl sealed::Sealed for SetMember {} + impl State for SetMember { + type Rev = St::Rev; + type ConvoId = St::ConvoId; + type Member = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `member` field + pub struct member(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogIncomingJoinRequestBuilder< + S: BosStr, + St: log_incoming_join_request_state::State, +> { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogIncomingJoinRequest { + /// Create a new builder for this type. + pub fn new() -> LogIncomingJoinRequestBuilder< + S, + log_incoming_join_request_state::Empty, + > { + LogIncomingJoinRequestBuilder::new() + } +} + +impl< + S: BosStr, +> LogIncomingJoinRequestBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogIncomingJoinRequestBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogIncomingJoinRequestBuilder +where + St: log_incoming_join_request_state::State, + St::ConvoId: log_incoming_join_request_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogIncomingJoinRequestBuilder< + S, + log_incoming_join_request_state::SetConvoId, + > { + self._fields.0 = Option::Some(value.into()); + LogIncomingJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogIncomingJoinRequestBuilder +where + St: log_incoming_join_request_state::State, + St::Member: log_incoming_join_request_state::IsUnset, +{ + /// Set the `member` field (required) + pub fn member( + mut self, + value: impl Into>, + ) -> LogIncomingJoinRequestBuilder< + S, + log_incoming_join_request_state::SetMember, + > { + self._fields.1 = Option::Some(value.into()); + LogIncomingJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogIncomingJoinRequestBuilder +where + St: log_incoming_join_request_state::State, + St::Rev: log_incoming_join_request_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogIncomingJoinRequestBuilder> { + self._fields.2 = Option::Some(value.into()); + LogIncomingJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogIncomingJoinRequestBuilder +where + St: log_incoming_join_request_state::State, + St::Rev: log_incoming_join_request_state::IsSet, + St::ConvoId: log_incoming_join_request_state::IsSet, + St::Member: log_incoming_join_request_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogIncomingJoinRequest { + LogIncomingJoinRequest { + convo_id: self._fields.0.unwrap(), + member: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogIncomingJoinRequest { + LogIncomingJoinRequest { + convo_id: self._fields.0.unwrap(), + member: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_lock_convo_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Message; + type Rev; + type ConvoId; + type RelatedProfiles; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Message = Unset; + type Rev = Unset; + type ConvoId = Unset; + type RelatedProfiles = Unset; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; + type Rev = St::Rev; + type ConvoId = St::ConvoId; + type RelatedProfiles = St::RelatedProfiles; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Message = St::Message; + type Rev = Set; + type ConvoId = St::ConvoId; + type RelatedProfiles = St::RelatedProfiles; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Message = St::Message; + type Rev = St::Rev; + type ConvoId = Set; + type RelatedProfiles = St::RelatedProfiles; + } + ///State transition - sets the `related_profiles` field to Set + pub struct SetRelatedProfiles(PhantomData St>); + impl sealed::Sealed for SetRelatedProfiles {} + impl State for SetRelatedProfiles { + type Message = St::Message; + type Rev = St::Rev; + type ConvoId = St::ConvoId; + type RelatedProfiles = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `related_profiles` field + pub struct related_profiles(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogLockConvoBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>>, + Option, + ), + _type: PhantomData S>, +} + +impl LogLockConvo { + /// Create a new builder for this type. + pub fn new() -> LogLockConvoBuilder { + LogLockConvoBuilder::new() + } +} + +impl LogLockConvoBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogLockConvoBuilder { + _state: PhantomData, + _fields: (None, None, None, None), + _type: PhantomData, + } + } +} + +impl LogLockConvoBuilder +where + St: log_lock_convo_state::State, + St::ConvoId: log_lock_convo_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogLockConvoBuilder> { + self._fields.0 = Option::Some(value.into()); + LogLockConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogLockConvoBuilder +where + St: log_lock_convo_state::State, + St::Message: log_lock_convo_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogLockConvoBuilder> { + self._fields.1 = Option::Some(value.into()); + LogLockConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogLockConvoBuilder +where + St: log_lock_convo_state::State, + St::RelatedProfiles: log_lock_convo_state::IsUnset, +{ + /// Set the `relatedProfiles` field (required) + pub fn related_profiles( + mut self, + value: impl Into>>, + ) -> LogLockConvoBuilder> { + self._fields.2 = Option::Some(value.into()); + LogLockConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogLockConvoBuilder +where + St: log_lock_convo_state::State, + St::Rev: log_lock_convo_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogLockConvoBuilder> { + self._fields.3 = Option::Some(value.into()); + LogLockConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogLockConvoBuilder +where + St: log_lock_convo_state::State, + St::Message: log_lock_convo_state::IsSet, + St::Rev: log_lock_convo_state::IsSet, + St::ConvoId: log_lock_convo_state::IsSet, + St::RelatedProfiles: log_lock_convo_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogLockConvo { + LogLockConvo { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogLockConvo { + LogLockConvo { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_lock_convo_permanently_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Message; + type ConvoId; + type Rev; + type RelatedProfiles; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Message = Unset; + type ConvoId = Unset; + type Rev = Unset; + type RelatedProfiles = Unset; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; + type ConvoId = St::ConvoId; + type Rev = St::Rev; + type RelatedProfiles = St::RelatedProfiles; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Message = St::Message; + type ConvoId = Set; + type Rev = St::Rev; + type RelatedProfiles = St::RelatedProfiles; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Message = St::Message; + type ConvoId = St::ConvoId; + type Rev = Set; + type RelatedProfiles = St::RelatedProfiles; + } + ///State transition - sets the `related_profiles` field to Set + pub struct SetRelatedProfiles(PhantomData St>); + impl sealed::Sealed for SetRelatedProfiles {} + impl State for SetRelatedProfiles { + type Message = St::Message; + type ConvoId = St::ConvoId; + type Rev = St::Rev; + type RelatedProfiles = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `related_profiles` field + pub struct related_profiles(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogLockConvoPermanentlyBuilder< + S: BosStr, + St: log_lock_convo_permanently_state::State, +> { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>>, + Option, + ), + _type: PhantomData S>, +} + +impl LogLockConvoPermanently { + /// Create a new builder for this type. + pub fn new() -> LogLockConvoPermanentlyBuilder< + S, + log_lock_convo_permanently_state::Empty, + > { + LogLockConvoPermanentlyBuilder::new() + } +} + +impl< + S: BosStr, +> LogLockConvoPermanentlyBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogLockConvoPermanentlyBuilder { + _state: PhantomData, + _fields: (None, None, None, None), + _type: PhantomData, + } + } +} + +impl LogLockConvoPermanentlyBuilder +where + St: log_lock_convo_permanently_state::State, + St::ConvoId: log_lock_convo_permanently_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogLockConvoPermanentlyBuilder< + S, + log_lock_convo_permanently_state::SetConvoId, + > { + self._fields.0 = Option::Some(value.into()); + LogLockConvoPermanentlyBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogLockConvoPermanentlyBuilder +where + St: log_lock_convo_permanently_state::State, + St::Message: log_lock_convo_permanently_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogLockConvoPermanentlyBuilder< + S, + log_lock_convo_permanently_state::SetMessage, + > { + self._fields.1 = Option::Some(value.into()); + LogLockConvoPermanentlyBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogLockConvoPermanentlyBuilder +where + St: log_lock_convo_permanently_state::State, + St::RelatedProfiles: log_lock_convo_permanently_state::IsUnset, +{ + /// Set the `relatedProfiles` field (required) + pub fn related_profiles( + mut self, + value: impl Into>>, + ) -> LogLockConvoPermanentlyBuilder< + S, + log_lock_convo_permanently_state::SetRelatedProfiles, + > { + self._fields.2 = Option::Some(value.into()); + LogLockConvoPermanentlyBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogLockConvoPermanentlyBuilder +where + St: log_lock_convo_permanently_state::State, + St::Rev: log_lock_convo_permanently_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogLockConvoPermanentlyBuilder< + S, + log_lock_convo_permanently_state::SetRev, + > { + self._fields.3 = Option::Some(value.into()); + LogLockConvoPermanentlyBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogLockConvoPermanentlyBuilder +where + St: log_lock_convo_permanently_state::State, + St::Message: log_lock_convo_permanently_state::IsSet, + St::ConvoId: log_lock_convo_permanently_state::IsSet, + St::Rev: log_lock_convo_permanently_state::IsSet, + St::RelatedProfiles: log_lock_convo_permanently_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogLockConvoPermanently { + LogLockConvoPermanently { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogLockConvoPermanently { + LogLockConvoPermanently { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_member_join_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type ConvoId; + type RelatedProfiles; + type Rev; + type Message; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = Unset; + type RelatedProfiles = Unset; + type Rev = Unset; + type Message = Unset; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type ConvoId = Set; + type RelatedProfiles = St::RelatedProfiles; + type Rev = St::Rev; + type Message = St::Message; + } + ///State transition - sets the `related_profiles` field to Set + pub struct SetRelatedProfiles(PhantomData St>); + impl sealed::Sealed for SetRelatedProfiles {} + impl State for SetRelatedProfiles { + type ConvoId = St::ConvoId; + type RelatedProfiles = Set; + type Rev = St::Rev; + type Message = St::Message; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type ConvoId = St::ConvoId; + type RelatedProfiles = St::RelatedProfiles; + type Rev = Set; + type Message = St::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type ConvoId = St::ConvoId; + type RelatedProfiles = St::RelatedProfiles; + type Rev = St::Rev; + type Message = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `related_profiles` field + pub struct related_profiles(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `message` field + pub struct message(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogMemberJoinBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>>, + Option, + ), + _type: PhantomData S>, +} + +impl LogMemberJoin { + /// Create a new builder for this type. + pub fn new() -> LogMemberJoinBuilder { + LogMemberJoinBuilder::new() + } +} + +impl LogMemberJoinBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogMemberJoinBuilder { + _state: PhantomData, + _fields: (None, None, None, None), + _type: PhantomData, + } + } +} + +impl LogMemberJoinBuilder +where + St: log_member_join_state::State, + St::ConvoId: log_member_join_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogMemberJoinBuilder> { + self._fields.0 = Option::Some(value.into()); + LogMemberJoinBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogMemberJoinBuilder +where + St: log_member_join_state::State, + St::Message: log_member_join_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogMemberJoinBuilder> { + self._fields.1 = Option::Some(value.into()); + LogMemberJoinBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogMemberJoinBuilder +where + St: log_member_join_state::State, + St::RelatedProfiles: log_member_join_state::IsUnset, +{ + /// Set the `relatedProfiles` field (required) + pub fn related_profiles( + mut self, + value: impl Into>>, + ) -> LogMemberJoinBuilder> { + self._fields.2 = Option::Some(value.into()); + LogMemberJoinBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogMemberJoinBuilder +where + St: log_member_join_state::State, + St::Rev: log_member_join_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogMemberJoinBuilder> { + self._fields.3 = Option::Some(value.into()); + LogMemberJoinBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogMemberJoinBuilder +where + St: log_member_join_state::State, + St::ConvoId: log_member_join_state::IsSet, + St::RelatedProfiles: log_member_join_state::IsSet, + St::Rev: log_member_join_state::IsSet, + St::Message: log_member_join_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogMemberJoin { + LogMemberJoin { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogMemberJoin { + LogMemberJoin { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_member_leave_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type ConvoId; + type Message; + type Rev; + type RelatedProfiles; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = Unset; + type Message = Unset; + type Rev = Unset; + type RelatedProfiles = Unset; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type ConvoId = Set; + type Message = St::Message; + type Rev = St::Rev; + type RelatedProfiles = St::RelatedProfiles; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type ConvoId = St::ConvoId; + type Message = Set; + type Rev = St::Rev; + type RelatedProfiles = St::RelatedProfiles; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type ConvoId = St::ConvoId; + type Message = St::Message; + type Rev = Set; + type RelatedProfiles = St::RelatedProfiles; + } + ///State transition - sets the `related_profiles` field to Set + pub struct SetRelatedProfiles(PhantomData St>); + impl sealed::Sealed for SetRelatedProfiles {} + impl State for SetRelatedProfiles { + type ConvoId = St::ConvoId; + type Message = St::Message; + type Rev = St::Rev; + type RelatedProfiles = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `related_profiles` field + pub struct related_profiles(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogMemberLeaveBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>>, + Option, + ), + _type: PhantomData S>, +} + +impl LogMemberLeave { + /// Create a new builder for this type. + pub fn new() -> LogMemberLeaveBuilder { + LogMemberLeaveBuilder::new() + } +} + +impl LogMemberLeaveBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogMemberLeaveBuilder { + _state: PhantomData, + _fields: (None, None, None, None), + _type: PhantomData, + } + } +} + +impl LogMemberLeaveBuilder +where + St: log_member_leave_state::State, + St::ConvoId: log_member_leave_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogMemberLeaveBuilder> { + self._fields.0 = Option::Some(value.into()); + LogMemberLeaveBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogMemberLeaveBuilder +where + St: log_member_leave_state::State, + St::Message: log_member_leave_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogMemberLeaveBuilder> { + self._fields.1 = Option::Some(value.into()); + LogMemberLeaveBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogMemberLeaveBuilder +where + St: log_member_leave_state::State, + St::RelatedProfiles: log_member_leave_state::IsUnset, +{ + /// Set the `relatedProfiles` field (required) + pub fn related_profiles( + mut self, + value: impl Into>>, + ) -> LogMemberLeaveBuilder> { + self._fields.2 = Option::Some(value.into()); + LogMemberLeaveBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogMemberLeaveBuilder +where + St: log_member_leave_state::State, + St::Rev: log_member_leave_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogMemberLeaveBuilder> { + self._fields.3 = Option::Some(value.into()); + LogMemberLeaveBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogMemberLeaveBuilder +where + St: log_member_leave_state::State, + St::ConvoId: log_member_leave_state::IsSet, + St::Message: log_member_leave_state::IsSet, + St::Rev: log_member_leave_state::IsSet, + St::RelatedProfiles: log_member_leave_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogMemberLeave { + LogMemberLeave { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogMemberLeave { + LogMemberLeave { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_read_convo_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type ConvoId; + type Rev; + type Message; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = Unset; + type Rev = Unset; + type Message = Unset; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type ConvoId = Set; + type Rev = St::Rev; + type Message = St::Message; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type ConvoId = St::ConvoId; + type Rev = Set; + type Message = St::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type ConvoId = St::ConvoId; + type Rev = St::Rev; + type Message = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `message` field + pub struct message(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogReadConvoBuilder { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogReadConvo { + /// Create a new builder for this type. + pub fn new() -> LogReadConvoBuilder { + LogReadConvoBuilder::new() + } +} + +impl LogReadConvoBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogReadConvoBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogReadConvoBuilder +where + St: log_read_convo_state::State, + St::ConvoId: log_read_convo_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogReadConvoBuilder> { + self._fields.0 = Option::Some(value.into()); + LogReadConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogReadConvoBuilder +where + St: log_read_convo_state::State, + St::Message: log_read_convo_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogReadConvoBuilder> { + self._fields.1 = Option::Some(value.into()); + LogReadConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogReadConvoBuilder +where + St: log_read_convo_state::State, + St::Rev: log_read_convo_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogReadConvoBuilder> { + self._fields.2 = Option::Some(value.into()); + LogReadConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogReadConvoBuilder +where + St: log_read_convo_state::State, + St::ConvoId: log_read_convo_state::IsSet, + St::Rev: log_read_convo_state::IsSet, + St::Message: log_read_convo_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogReadConvo { + LogReadConvo { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogReadConvo { + LogReadConvo { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_read_message_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Message; + type ConvoId; + type Rev; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Message = Unset; + type ConvoId = Unset; + type Rev = Unset; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; + type ConvoId = St::ConvoId; + type Rev = St::Rev; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Message = St::Message; + type ConvoId = Set; + type Rev = St::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Message = St::Message; + type ConvoId = St::ConvoId; + type Rev = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `rev` field + pub struct rev(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogReadMessageBuilder { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogReadMessage { + /// Create a new builder for this type. + pub fn new() -> LogReadMessageBuilder { + LogReadMessageBuilder::new() + } +} + +impl LogReadMessageBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogReadMessageBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogReadMessageBuilder +where + St: log_read_message_state::State, + St::ConvoId: log_read_message_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogReadMessageBuilder> { + self._fields.0 = Option::Some(value.into()); + LogReadMessageBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogReadMessageBuilder +where + St: log_read_message_state::State, + St::Message: log_read_message_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogReadMessageBuilder> { + self._fields.1 = Option::Some(value.into()); + LogReadMessageBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogReadMessageBuilder +where + St: log_read_message_state::State, + St::Rev: log_read_message_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogReadMessageBuilder> { + self._fields.2 = Option::Some(value.into()); + LogReadMessageBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogReadMessageBuilder +where + St: log_read_message_state::State, + St::Message: log_read_message_state::IsSet, + St::ConvoId: log_read_message_state::IsSet, + St::Rev: log_read_message_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogReadMessage { + LogReadMessage { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogReadMessage { + LogReadMessage { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_reject_join_request_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type ConvoId; + type Member; + type Rev; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = Unset; + type Member = Unset; + type Rev = Unset; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type ConvoId = Set; + type Member = St::Member; + type Rev = St::Rev; + } + ///State transition - sets the `member` field to Set + pub struct SetMember(PhantomData St>); + impl sealed::Sealed for SetMember {} + impl State for SetMember { + type ConvoId = St::ConvoId; + type Member = Set; + type Rev = St::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type ConvoId = St::ConvoId; + type Member = St::Member; + type Rev = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `member` field + pub struct member(()); + ///Marker type for the `rev` field + pub struct rev(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogRejectJoinRequestBuilder< + S: BosStr, + St: log_reject_join_request_state::State, +> { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogRejectJoinRequest { + /// Create a new builder for this type. + pub fn new() -> LogRejectJoinRequestBuilder< + S, + log_reject_join_request_state::Empty, + > { + LogRejectJoinRequestBuilder::new() + } +} + +impl LogRejectJoinRequestBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogRejectJoinRequestBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogRejectJoinRequestBuilder +where + St: log_reject_join_request_state::State, + St::ConvoId: log_reject_join_request_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogRejectJoinRequestBuilder> { + self._fields.0 = Option::Some(value.into()); + LogRejectJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRejectJoinRequestBuilder +where + St: log_reject_join_request_state::State, + St::Member: log_reject_join_request_state::IsUnset, +{ + /// Set the `member` field (required) + pub fn member( + mut self, + value: impl Into>, + ) -> LogRejectJoinRequestBuilder> { + self._fields.1 = Option::Some(value.into()); + LogRejectJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRejectJoinRequestBuilder +where + St: log_reject_join_request_state::State, + St::Rev: log_reject_join_request_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogRejectJoinRequestBuilder> { + self._fields.2 = Option::Some(value.into()); + LogRejectJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRejectJoinRequestBuilder +where + St: log_reject_join_request_state::State, + St::ConvoId: log_reject_join_request_state::IsSet, + St::Member: log_reject_join_request_state::IsSet, + St::Rev: log_reject_join_request_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogRejectJoinRequest { + LogRejectJoinRequest { + convo_id: self._fields.0.unwrap(), + member: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogRejectJoinRequest { + LogRejectJoinRequest { + convo_id: self._fields.0.unwrap(), + member: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_remove_member_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Rev; + type RelatedProfiles; + type ConvoId; + type Message; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Rev = Unset; + type RelatedProfiles = Unset; + type ConvoId = Unset; + type Message = Unset; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Rev = Set; + type RelatedProfiles = St::RelatedProfiles; + type ConvoId = St::ConvoId; + type Message = St::Message; + } + ///State transition - sets the `related_profiles` field to Set + pub struct SetRelatedProfiles(PhantomData St>); + impl sealed::Sealed for SetRelatedProfiles {} + impl State for SetRelatedProfiles { + type Rev = St::Rev; + type RelatedProfiles = Set; + type ConvoId = St::ConvoId; + type Message = St::Message; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Rev = St::Rev; + type RelatedProfiles = St::RelatedProfiles; + type ConvoId = Set; + type Message = St::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Rev = St::Rev; + type RelatedProfiles = St::RelatedProfiles; + type ConvoId = St::ConvoId; + type Message = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `related_profiles` field + pub struct related_profiles(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogRemoveMemberBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>>, + Option, + ), + _type: PhantomData S>, +} + +impl LogRemoveMember { + /// Create a new builder for this type. + pub fn new() -> LogRemoveMemberBuilder { + LogRemoveMemberBuilder::new() + } +} + +impl LogRemoveMemberBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogRemoveMemberBuilder { + _state: PhantomData, + _fields: (None, None, None, None), + _type: PhantomData, + } + } +} + +impl LogRemoveMemberBuilder +where + St: log_remove_member_state::State, + St::ConvoId: log_remove_member_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogRemoveMemberBuilder> { + self._fields.0 = Option::Some(value.into()); + LogRemoveMemberBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRemoveMemberBuilder +where + St: log_remove_member_state::State, + St::Message: log_remove_member_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogRemoveMemberBuilder> { + self._fields.1 = Option::Some(value.into()); + LogRemoveMemberBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRemoveMemberBuilder +where + St: log_remove_member_state::State, + St::RelatedProfiles: log_remove_member_state::IsUnset, +{ + /// Set the `relatedProfiles` field (required) + pub fn related_profiles( + mut self, + value: impl Into>>, + ) -> LogRemoveMemberBuilder> { + self._fields.2 = Option::Some(value.into()); + LogRemoveMemberBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRemoveMemberBuilder +where + St: log_remove_member_state::State, + St::Rev: log_remove_member_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogRemoveMemberBuilder> { + self._fields.3 = Option::Some(value.into()); + LogRemoveMemberBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRemoveMemberBuilder +where + St: log_remove_member_state::State, + St::Rev: log_remove_member_state::IsSet, + St::RelatedProfiles: log_remove_member_state::IsSet, + St::ConvoId: log_remove_member_state::IsSet, + St::Message: log_remove_member_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogRemoveMember { + LogRemoveMember { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogRemoveMember { + LogRemoveMember { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_remove_reaction_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type ConvoId; + type Message; + type Reaction; + type Rev; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type ConvoId = Unset; + type Message = Unset; + type Reaction = Unset; + type Rev = Unset; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type ConvoId = Set; + type Message = St::Message; + type Reaction = St::Reaction; + type Rev = St::Rev; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type ConvoId = St::ConvoId; + type Message = Set; + type Reaction = St::Reaction; + type Rev = St::Rev; + } + ///State transition - sets the `reaction` field to Set + pub struct SetReaction(PhantomData St>); + impl sealed::Sealed for SetReaction {} + impl State for SetReaction { + type ConvoId = St::ConvoId; + type Message = St::Message; + type Reaction = Set; + type Rev = St::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type ConvoId = St::ConvoId; + type Message = St::Message; + type Reaction = St::Reaction; + type Rev = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `reaction` field + pub struct reaction(()); + ///Marker type for the `rev` field + pub struct rev(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogRemoveReactionBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>, + Option>>, + Option, + ), + _type: PhantomData S>, +} + +impl LogRemoveReaction { + /// Create a new builder for this type. + pub fn new() -> LogRemoveReactionBuilder { + LogRemoveReactionBuilder::new() + } +} + +impl LogRemoveReactionBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogRemoveReactionBuilder { + _state: PhantomData, + _fields: (None, None, None, None, None), + _type: PhantomData, + } + } +} + +impl LogRemoveReactionBuilder +where + St: log_remove_reaction_state::State, + St::ConvoId: log_remove_reaction_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogRemoveReactionBuilder> { + self._fields.0 = Option::Some(value.into()); + LogRemoveReactionBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRemoveReactionBuilder +where + St: log_remove_reaction_state::State, + St::Message: log_remove_reaction_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogRemoveReactionBuilder> { + self._fields.1 = Option::Some(value.into()); + LogRemoveReactionBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRemoveReactionBuilder +where + St: log_remove_reaction_state::State, + St::Reaction: log_remove_reaction_state::IsUnset, +{ + /// Set the `reaction` field (required) + pub fn reaction( + mut self, + value: impl Into>, + ) -> LogRemoveReactionBuilder> { + self._fields.2 = Option::Some(value.into()); + LogRemoveReactionBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRemoveReactionBuilder { + /// Set the `relatedProfiles` field (optional) + pub fn related_profiles( + mut self, + value: impl Into>>>, + ) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `relatedProfiles` field to an Option value (optional) + pub fn maybe_related_profiles( + mut self, + value: Option>>, + ) -> Self { + self._fields.3 = value; + self + } +} + +impl LogRemoveReactionBuilder +where + St: log_remove_reaction_state::State, + St::Rev: log_remove_reaction_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogRemoveReactionBuilder> { + self._fields.4 = Option::Some(value.into()); + LogRemoveReactionBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogRemoveReactionBuilder +where + St: log_remove_reaction_state::State, + St::ConvoId: log_remove_reaction_state::IsSet, + St::Message: log_remove_reaction_state::IsSet, + St::Reaction: log_remove_reaction_state::IsSet, + St::Rev: log_remove_reaction_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogRemoveReaction { + LogRemoveReaction { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + reaction: self._fields.2.unwrap(), + related_profiles: self._fields.3, + rev: self._fields.4.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogRemoveReaction { + LogRemoveReaction { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + reaction: self._fields.2.unwrap(), + related_profiles: self._fields.3, + rev: self._fields.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_unlock_convo_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Message; + type RelatedProfiles; + type Rev; + type ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Message = Unset; + type RelatedProfiles = Unset; + type Rev = Unset; + type ConvoId = Unset; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; + type RelatedProfiles = St::RelatedProfiles; + type Rev = St::Rev; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `related_profiles` field to Set + pub struct SetRelatedProfiles(PhantomData St>); + impl sealed::Sealed for SetRelatedProfiles {} + impl State for SetRelatedProfiles { + type Message = St::Message; + type RelatedProfiles = Set; + type Rev = St::Rev; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Message = St::Message; + type RelatedProfiles = St::RelatedProfiles; + type Rev = Set; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Message = St::Message; + type RelatedProfiles = St::RelatedProfiles; + type Rev = St::Rev; + type ConvoId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `related_profiles` field + pub struct related_profiles(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogUnlockConvoBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option>>, + Option, + ), + _type: PhantomData S>, +} + +impl LogUnlockConvo { + /// Create a new builder for this type. + pub fn new() -> LogUnlockConvoBuilder { + LogUnlockConvoBuilder::new() + } +} + +impl LogUnlockConvoBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogUnlockConvoBuilder { + _state: PhantomData, + _fields: (None, None, None, None), + _type: PhantomData, + } + } +} + +impl LogUnlockConvoBuilder +where + St: log_unlock_convo_state::State, + St::ConvoId: log_unlock_convo_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogUnlockConvoBuilder> { + self._fields.0 = Option::Some(value.into()); + LogUnlockConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogUnlockConvoBuilder +where + St: log_unlock_convo_state::State, + St::Message: log_unlock_convo_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> LogUnlockConvoBuilder> { + self._fields.1 = Option::Some(value.into()); + LogUnlockConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogUnlockConvoBuilder +where + St: log_unlock_convo_state::State, + St::RelatedProfiles: log_unlock_convo_state::IsUnset, +{ + /// Set the `relatedProfiles` field (required) + pub fn related_profiles( + mut self, + value: impl Into>>, + ) -> LogUnlockConvoBuilder> { + self._fields.2 = Option::Some(value.into()); + LogUnlockConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogUnlockConvoBuilder +where + St: log_unlock_convo_state::State, + St::Rev: log_unlock_convo_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogUnlockConvoBuilder> { + self._fields.3 = Option::Some(value.into()); + LogUnlockConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogUnlockConvoBuilder +where + St: log_unlock_convo_state::State, + St::Message: log_unlock_convo_state::IsSet, + St::RelatedProfiles: log_unlock_convo_state::IsSet, + St::Rev: log_unlock_convo_state::IsSet, + St::ConvoId: log_unlock_convo_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogUnlockConvo { + LogUnlockConvo { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogUnlockConvo { + LogUnlockConvo { + convo_id: self._fields.0.unwrap(), + message: self._fields.1.unwrap(), + related_profiles: self._fields.2.unwrap(), + rev: self._fields.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod log_withdraw_incoming_join_request_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Rev; + type ConvoId; + type Member; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Rev = Unset; + type ConvoId = Unset; + type Member = Unset; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Rev = Set; + type ConvoId = St::ConvoId; + type Member = St::Member; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Rev = St::Rev; + type ConvoId = Set; + type Member = St::Member; + } + ///State transition - sets the `member` field to Set + pub struct SetMember(PhantomData St>); + impl sealed::Sealed for SetMember {} + impl State for SetMember { + type Rev = St::Rev; + type ConvoId = St::ConvoId; + type Member = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `member` field + pub struct member(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct LogWithdrawIncomingJoinRequestBuilder< + S: BosStr, + St: log_withdraw_incoming_join_request_state::State, +> { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl LogWithdrawIncomingJoinRequest { + /// Create a new builder for this type. + pub fn new() -> LogWithdrawIncomingJoinRequestBuilder< + S, + log_withdraw_incoming_join_request_state::Empty, + > { + LogWithdrawIncomingJoinRequestBuilder::new() + } +} + +impl< + S: BosStr, +> LogWithdrawIncomingJoinRequestBuilder< + S, + log_withdraw_incoming_join_request_state::Empty, +> { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + LogWithdrawIncomingJoinRequestBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl LogWithdrawIncomingJoinRequestBuilder +where + St: log_withdraw_incoming_join_request_state::State, + St::ConvoId: log_withdraw_incoming_join_request_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> LogWithdrawIncomingJoinRequestBuilder< + S, + log_withdraw_incoming_join_request_state::SetConvoId, + > { + self._fields.0 = Option::Some(value.into()); + LogWithdrawIncomingJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogWithdrawIncomingJoinRequestBuilder +where + St: log_withdraw_incoming_join_request_state::State, + St::Member: log_withdraw_incoming_join_request_state::IsUnset, +{ + /// Set the `member` field (required) + pub fn member( + mut self, + value: impl Into>, + ) -> LogWithdrawIncomingJoinRequestBuilder< + S, + log_withdraw_incoming_join_request_state::SetMember, + > { + self._fields.1 = Option::Some(value.into()); + LogWithdrawIncomingJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogWithdrawIncomingJoinRequestBuilder +where + St: log_withdraw_incoming_join_request_state::State, + St::Rev: log_withdraw_incoming_join_request_state::IsUnset, +{ + /// Set the `rev` field (required) + pub fn rev( + mut self, + value: impl Into, + ) -> LogWithdrawIncomingJoinRequestBuilder< + S, + log_withdraw_incoming_join_request_state::SetRev, + > { + self._fields.2 = Option::Some(value.into()); + LogWithdrawIncomingJoinRequestBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl LogWithdrawIncomingJoinRequestBuilder +where + St: log_withdraw_incoming_join_request_state::State, + St::Rev: log_withdraw_incoming_join_request_state::IsSet, + St::ConvoId: log_withdraw_incoming_join_request_state::IsSet, + St::Member: log_withdraw_incoming_join_request_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> LogWithdrawIncomingJoinRequest { + LogWithdrawIncomingJoinRequest { + convo_id: self._fields.0.unwrap(), + member: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> LogWithdrawIncomingJoinRequest { + LogWithdrawIncomingJoinRequest { + convo_id: self._fields.0.unwrap(), + member: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod message_and_reaction_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Message; + type Reaction; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Message = Unset; + type Reaction = Unset; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData St>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; + type Reaction = St::Reaction; + } + ///State transition - sets the `reaction` field to Set + pub struct SetReaction(PhantomData St>); + impl sealed::Sealed for SetReaction {} + impl State for SetReaction { + type Message = St::Message; + type Reaction = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `message` field + pub struct message(()); + ///Marker type for the `reaction` field + pub struct reaction(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct MessageAndReactionViewBuilder< + S: BosStr, + St: message_and_reaction_view_state::State, +> { + _state: PhantomData St>, + _fields: (Option>, Option>), + _type: PhantomData S>, +} + +impl MessageAndReactionView { + /// Create a new builder for this type. + pub fn new() -> MessageAndReactionViewBuilder< + S, + message_and_reaction_view_state::Empty, + > { + MessageAndReactionViewBuilder::new() + } +} + +impl< + S: BosStr, +> MessageAndReactionViewBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + MessageAndReactionViewBuilder { + _state: PhantomData, + _fields: (None, None), + _type: PhantomData, + } + } +} + +impl MessageAndReactionViewBuilder +where + St: message_and_reaction_view_state::State, + St::Message: message_and_reaction_view_state::IsUnset, +{ + /// Set the `message` field (required) + pub fn message( + mut self, + value: impl Into>, + ) -> MessageAndReactionViewBuilder< + S, + message_and_reaction_view_state::SetMessage, + > { + self._fields.0 = Option::Some(value.into()); + MessageAndReactionViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl MessageAndReactionViewBuilder +where + St: message_and_reaction_view_state::State, + St::Reaction: message_and_reaction_view_state::IsUnset, +{ + /// Set the `reaction` field (required) + pub fn reaction( + mut self, + value: impl Into>, + ) -> MessageAndReactionViewBuilder< + S, + message_and_reaction_view_state::SetReaction, + > { + self._fields.1 = Option::Some(value.into()); + MessageAndReactionViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl MessageAndReactionViewBuilder +where + St: message_and_reaction_view_state::State, + St::Message: message_and_reaction_view_state::IsSet, + St::Reaction: message_and_reaction_view_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> MessageAndReactionView { + MessageAndReactionView { + message: self._fields.0.unwrap(), + reaction: self._fields.1.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> MessageAndReactionView { + MessageAndReactionView { + message: self._fields.0.unwrap(), + reaction: self._fields.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod message_ref_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Did; + type MessageId; + type ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + type MessageId = Unset; + type ConvoId = Unset; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; + type MessageId = St::MessageId; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `message_id` field to Set + pub struct SetMessageId(PhantomData St>); + impl sealed::Sealed for SetMessageId {} + impl State for SetMessageId { + type Did = St::Did; + type MessageId = Set; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Did = St::Did; + type MessageId = St::MessageId; + type ConvoId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `message_id` field + pub struct message_id(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct MessageRefBuilder { + _state: PhantomData St>, + _fields: (Option, Option>, Option), + _type: PhantomData S>, +} + +impl MessageRef { + /// Create a new builder for this type. + pub fn new() -> MessageRefBuilder { + MessageRefBuilder::new() + } +} + +impl MessageRefBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + MessageRefBuilder { + _state: PhantomData, + _fields: (None, None, None), + _type: PhantomData, + } + } +} + +impl MessageRefBuilder +where + St: message_ref_state::State, + St::ConvoId: message_ref_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> MessageRefBuilder> { + self._fields.0 = Option::Some(value.into()); + MessageRefBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl MessageRefBuilder +where + St: message_ref_state::State, + St::Did: message_ref_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> MessageRefBuilder> { + self._fields.1 = Option::Some(value.into()); + MessageRefBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl MessageRefBuilder +where + St: message_ref_state::State, + St::MessageId: message_ref_state::IsUnset, +{ + /// Set the `messageId` field (required) + pub fn message_id( + mut self, + value: impl Into, + ) -> MessageRefBuilder> { + self._fields.2 = Option::Some(value.into()); + MessageRefBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl MessageRefBuilder +where + St: message_ref_state::State, + St::Did: message_ref_state::IsSet, + St::MessageId: message_ref_state::IsSet, + St::ConvoId: message_ref_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> MessageRef { + MessageRef { + convo_id: self._fields.0.unwrap(), + did: self._fields.1.unwrap(), + message_id: self._fields.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> MessageRef { + MessageRef { + convo_id: self._fields.0.unwrap(), + did: self._fields.1.unwrap(), + message_id: self._fields.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod message_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -1761,112 +9988,161 @@ pub mod deleted_message_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; type Rev; + type Text; type Sender; + type Id; type SentAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; type Rev = Unset; + type Text = Unset; type Sender = Unset; + type Id = Unset; type SentAt = Unset; } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData St>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type Rev = St::Rev; - type Sender = St::Sender; - type SentAt = St::SentAt; - } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData St>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Id = St::Id; type Rev = Set; + type Text = St::Text; + type Sender = St::Sender; + type Id = St::Id; + type SentAt = St::SentAt; + } + ///State transition - sets the `text` field to Set + pub struct SetText(PhantomData St>); + impl sealed::Sealed for SetText {} + impl State for SetText { + type Rev = St::Rev; + type Text = Set; type Sender = St::Sender; + type Id = St::Id; type SentAt = St::SentAt; } ///State transition - sets the `sender` field to Set pub struct SetSender(PhantomData St>); impl sealed::Sealed for SetSender {} impl State for SetSender { - type Id = St::Id; type Rev = St::Rev; + type Text = St::Text; type Sender = Set; + type Id = St::Id; + type SentAt = St::SentAt; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData St>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Rev = St::Rev; + type Text = St::Text; + type Sender = St::Sender; + type Id = Set; type SentAt = St::SentAt; } ///State transition - sets the `sent_at` field to Set pub struct SetSentAt(PhantomData St>); impl sealed::Sealed for SetSentAt {} impl State for SetSentAt { - type Id = St::Id; type Rev = St::Rev; + type Text = St::Text; type Sender = St::Sender; + type Id = St::Id; type SentAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `id` field - pub struct id(()); ///Marker type for the `rev` field pub struct rev(()); + ///Marker type for the `text` field + pub struct text(()); ///Marker type for the `sender` field pub struct sender(()); + ///Marker type for the `id` field + pub struct id(()); ///Marker type for the `sent_at` field pub struct sent_at(()); } } /// Builder for constructing an instance of this type. -pub struct DeletedMessageViewBuilder { +pub struct MessageViewBuilder { _state: PhantomData St>, _fields: ( + Option>, + Option>>, Option, + Option>>, + Option>, Option, Option>, Option, + Option, ), _type: PhantomData S>, } -impl DeletedMessageView { +impl MessageView { /// Create a new builder for this type. - pub fn new() -> DeletedMessageViewBuilder { - DeletedMessageViewBuilder::new() + pub fn new() -> MessageViewBuilder { + MessageViewBuilder::new() } } -impl DeletedMessageViewBuilder { +impl MessageViewBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - DeletedMessageViewBuilder { + MessageViewBuilder { _state: PhantomData, - _fields: (None, None, None, None), + _fields: (None, None, None, None, None, None, None, None, None), _type: PhantomData, } } } -impl DeletedMessageViewBuilder +impl MessageViewBuilder { + /// Set the `embed` field (optional) + pub fn embed(mut self, value: impl Into>>) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `embed` field to an Option value (optional) + pub fn maybe_embed(mut self, value: Option>) -> Self { + self._fields.0 = value; + self + } +} + +impl MessageViewBuilder { + /// Set the `facets` field (optional) + pub fn facets(mut self, value: impl Into>>>) -> Self { + self._fields.1 = value.into(); + self + } + /// Set the `facets` field to an Option value (optional) + pub fn maybe_facets(mut self, value: Option>>) -> Self { + self._fields.1 = value; + self + } +} + +impl MessageViewBuilder where - St: deleted_message_view_state::State, - St::Id: deleted_message_view_state::IsUnset, + St: message_view_state::State, + St::Id: message_view_state::IsUnset, { /// Set the `id` field (required) pub fn id( mut self, value: impl Into, - ) -> DeletedMessageViewBuilder> { - self._fields.0 = Option::Some(value.into()); - DeletedMessageViewBuilder { + ) -> MessageViewBuilder> { + self._fields.2 = Option::Some(value.into()); + MessageViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -1874,18 +10150,50 @@ where } } -impl DeletedMessageViewBuilder +impl MessageViewBuilder { + /// Set the `reactions` field (optional) + pub fn reactions( + mut self, + value: impl Into>>>, + ) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `reactions` field to an Option value (optional) + pub fn maybe_reactions( + mut self, + value: Option>>, + ) -> Self { + self._fields.3 = value; + self + } +} + +impl MessageViewBuilder { + /// Set the `replyTo` field (optional) + pub fn reply_to(mut self, value: impl Into>>) -> Self { + self._fields.4 = value.into(); + self + } + /// Set the `replyTo` field to an Option value (optional) + pub fn maybe_reply_to(mut self, value: Option>) -> Self { + self._fields.4 = value; + self + } +} + +impl MessageViewBuilder where - St: deleted_message_view_state::State, - St::Rev: deleted_message_view_state::IsUnset, + St: message_view_state::State, + St::Rev: message_view_state::IsUnset, { /// Set the `rev` field (required) pub fn rev( mut self, value: impl Into, - ) -> DeletedMessageViewBuilder> { - self._fields.1 = Option::Some(value.into()); - DeletedMessageViewBuilder { + ) -> MessageViewBuilder> { + self._fields.5 = Option::Some(value.into()); + MessageViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -1893,18 +10201,18 @@ where } } -impl DeletedMessageViewBuilder +impl MessageViewBuilder where - St: deleted_message_view_state::State, - St::Sender: deleted_message_view_state::IsUnset, + St: message_view_state::State, + St::Sender: message_view_state::IsUnset, { /// Set the `sender` field (required) pub fn sender( mut self, value: impl Into>, - ) -> DeletedMessageViewBuilder> { - self._fields.2 = Option::Some(value.into()); - DeletedMessageViewBuilder { + ) -> MessageViewBuilder> { + self._fields.6 = Option::Some(value.into()); + MessageViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -1912,18 +10220,37 @@ where } } -impl DeletedMessageViewBuilder +impl MessageViewBuilder where - St: deleted_message_view_state::State, - St::SentAt: deleted_message_view_state::IsUnset, + St: message_view_state::State, + St::SentAt: message_view_state::IsUnset, +{ + /// Set the `sentAt` field (required) + pub fn sent_at( + mut self, + value: impl Into, + ) -> MessageViewBuilder> { + self._fields.7 = Option::Some(value.into()); + MessageViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl MessageViewBuilder +where + St: message_view_state::State, + St::Text: message_view_state::IsUnset, { - /// Set the `sentAt` field (required) - pub fn sent_at( + /// Set the `text` field (required) + pub fn text( mut self, - value: impl Into, - ) -> DeletedMessageViewBuilder> { - self._fields.3 = Option::Some(value.into()); - DeletedMessageViewBuilder { + value: impl Into, + ) -> MessageViewBuilder> { + self._fields.8 = Option::Some(value.into()); + MessageViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -1931,21 +10258,27 @@ where } } -impl DeletedMessageViewBuilder +impl MessageViewBuilder where - St: deleted_message_view_state::State, - St::Id: deleted_message_view_state::IsSet, - St::Rev: deleted_message_view_state::IsSet, - St::Sender: deleted_message_view_state::IsSet, - St::SentAt: deleted_message_view_state::IsSet, + St: message_view_state::State, + St::Rev: message_view_state::IsSet, + St::Text: message_view_state::IsSet, + St::Sender: message_view_state::IsSet, + St::Id: message_view_state::IsSet, + St::SentAt: message_view_state::IsSet, { /// Build the final struct. - pub fn build(self) -> DeletedMessageView { - DeletedMessageView { - id: self._fields.0.unwrap(), - rev: self._fields.1.unwrap(), - sender: self._fields.2.unwrap(), - sent_at: self._fields.3.unwrap(), + pub fn build(self) -> MessageView { + MessageView { + embed: self._fields.0, + facets: self._fields.1, + id: self._fields.2.unwrap(), + reactions: self._fields.3, + reply_to: self._fields.4, + rev: self._fields.5.unwrap(), + sender: self._fields.6.unwrap(), + sent_at: self._fields.7.unwrap(), + text: self._fields.8.unwrap(), extra_data: Default::default(), } } @@ -1953,18 +10286,23 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> DeletedMessageView { - DeletedMessageView { - id: self._fields.0.unwrap(), - rev: self._fields.1.unwrap(), - sender: self._fields.2.unwrap(), - sent_at: self._fields.3.unwrap(), + ) -> MessageView { + MessageView { + embed: self._fields.0, + facets: self._fields.1, + id: self._fields.2.unwrap(), + reactions: self._fields.3, + reply_to: self._fields.4, + rev: self._fields.5.unwrap(), + sender: self._fields.6.unwrap(), + sent_at: self._fields.7.unwrap(), + text: self._fields.8.unwrap(), extra_data: Some(extra_data), } } } -pub mod log_add_reaction_state { +pub mod message_view_sender_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -1974,169 +10312,65 @@ pub mod log_add_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ConvoId; - type Message; - type Reaction; - type Rev; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ConvoId = Unset; - type Message = Unset; - type Reaction = Unset; - type Rev = Unset; - } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData St>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type ConvoId = Set; - type Message = St::Message; - type Reaction = St::Reaction; - type Rev = St::Rev; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData St>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type ConvoId = St::ConvoId; - type Message = Set; - type Reaction = St::Reaction; - type Rev = St::Rev; - } - ///State transition - sets the `reaction` field to Set - pub struct SetReaction(PhantomData St>); - impl sealed::Sealed for SetReaction {} - impl State for SetReaction { - type ConvoId = St::ConvoId; - type Message = St::Message; - type Reaction = Set; - type Rev = St::Rev; + type Did = Unset; } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData St>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type ConvoId = St::ConvoId; - type Message = St::Message; - type Reaction = St::Reaction; - type Rev = Set; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `convo_id` field - pub struct convo_id(()); - ///Marker type for the `message` field - pub struct message(()); - ///Marker type for the `reaction` field - pub struct reaction(()); - ///Marker type for the `rev` field - pub struct rev(()); + ///Marker type for the `did` field + pub struct did(()); } } /// Builder for constructing an instance of this type. -pub struct LogAddReactionBuilder { +pub struct MessageViewSenderBuilder { _state: PhantomData St>, - _fields: ( - Option, - Option>, - Option>, - Option, - ), + _fields: (Option>,), _type: PhantomData S>, } -impl LogAddReaction { +impl MessageViewSender { /// Create a new builder for this type. - pub fn new() -> LogAddReactionBuilder { - LogAddReactionBuilder::new() + pub fn new() -> MessageViewSenderBuilder { + MessageViewSenderBuilder::new() } } -impl LogAddReactionBuilder { +impl MessageViewSenderBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - LogAddReactionBuilder { + MessageViewSenderBuilder { _state: PhantomData, - _fields: (None, None, None, None), + _fields: (None,), _type: PhantomData, } } } -impl LogAddReactionBuilder +impl MessageViewSenderBuilder where - St: log_add_reaction_state::State, - St::ConvoId: log_add_reaction_state::IsUnset, + St: message_view_sender_state::State, + St::Did: message_view_sender_state::IsUnset, { - /// Set the `convoId` field (required) - pub fn convo_id( + /// Set the `did` field (required) + pub fn did( mut self, - value: impl Into, - ) -> LogAddReactionBuilder> { + value: impl Into>, + ) -> MessageViewSenderBuilder> { self._fields.0 = Option::Some(value.into()); - LogAddReactionBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } - } -} - -impl LogAddReactionBuilder -where - St: log_add_reaction_state::State, - St::Message: log_add_reaction_state::IsUnset, -{ - /// Set the `message` field (required) - pub fn message( - mut self, - value: impl Into>, - ) -> LogAddReactionBuilder> { - self._fields.1 = Option::Some(value.into()); - LogAddReactionBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } - } -} - -impl LogAddReactionBuilder -where - St: log_add_reaction_state::State, - St::Reaction: log_add_reaction_state::IsUnset, -{ - /// Set the `reaction` field (required) - pub fn reaction( - mut self, - value: impl Into>, - ) -> LogAddReactionBuilder> { - self._fields.2 = Option::Some(value.into()); - LogAddReactionBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } - } -} - -impl LogAddReactionBuilder -where - St: log_add_reaction_state::State, - St::Rev: log_add_reaction_state::IsUnset, -{ - /// Set the `rev` field (required) - pub fn rev( - mut self, - value: impl Into, - ) -> LogAddReactionBuilder> { - self._fields.3 = Option::Some(value.into()); - LogAddReactionBuilder { + MessageViewSenderBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2144,21 +10378,15 @@ where } } -impl LogAddReactionBuilder +impl MessageViewSenderBuilder where - St: log_add_reaction_state::State, - St::ConvoId: log_add_reaction_state::IsSet, - St::Message: log_add_reaction_state::IsSet, - St::Reaction: log_add_reaction_state::IsSet, - St::Rev: log_add_reaction_state::IsSet, + St: message_view_sender_state::State, + St::Did: message_view_sender_state::IsSet, { /// Build the final struct. - pub fn build(self) -> LogAddReaction { - LogAddReaction { - convo_id: self._fields.0.unwrap(), - message: self._fields.1.unwrap(), - reaction: self._fields.2.unwrap(), - rev: self._fields.3.unwrap(), + pub fn build(self) -> MessageViewSender { + MessageViewSender { + did: self._fields.0.unwrap(), extra_data: Default::default(), } } @@ -2166,18 +10394,15 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> LogAddReaction { - LogAddReaction { - convo_id: self._fields.0.unwrap(), - message: self._fields.1.unwrap(), - reaction: self._fields.2.unwrap(), - rev: self._fields.3.unwrap(), + ) -> MessageViewSender { + MessageViewSender { + did: self._fields.0.unwrap(), extra_data: Some(extra_data), } } } -pub mod log_create_message_state { +pub mod reaction_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -2187,72 +10412,72 @@ pub mod log_create_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ConvoId; - type Message; - type Rev; + type CreatedAt; + type Value; + type Sender; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ConvoId = Unset; - type Message = Unset; - type Rev = Unset; - } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData St>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type ConvoId = Set; - type Message = St::Message; - type Rev = St::Rev; + type CreatedAt = Unset; + type Value = Unset; + type Sender = Unset; } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData St>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type ConvoId = St::ConvoId; - type Message = Set; - type Rev = St::Rev; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Value = St::Value; + type Sender = St::Sender; } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData St>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type ConvoId = St::ConvoId; - type Message = St::Message; - type Rev = Set; + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData St>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type CreatedAt = St::CreatedAt; + type Value = Set; + type Sender = St::Sender; + } + ///State transition - sets the `sender` field to Set + pub struct SetSender(PhantomData St>); + impl sealed::Sealed for SetSender {} + impl State for SetSender { + type CreatedAt = St::CreatedAt; + type Value = St::Value; + type Sender = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `convo_id` field - pub struct convo_id(()); - ///Marker type for the `message` field - pub struct message(()); - ///Marker type for the `rev` field - pub struct rev(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `value` field + pub struct value(()); + ///Marker type for the `sender` field + pub struct sender(()); } } /// Builder for constructing an instance of this type. -pub struct LogCreateMessageBuilder { +pub struct ReactionViewBuilder { _state: PhantomData St>, - _fields: (Option, Option>, Option), + _fields: (Option, Option>, Option), _type: PhantomData S>, } -impl LogCreateMessage { +impl ReactionView { /// Create a new builder for this type. - pub fn new() -> LogCreateMessageBuilder { - LogCreateMessageBuilder::new() + pub fn new() -> ReactionViewBuilder { + ReactionViewBuilder::new() } } -impl LogCreateMessageBuilder { +impl ReactionViewBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - LogCreateMessageBuilder { + ReactionViewBuilder { _state: PhantomData, _fields: (None, None, None), _type: PhantomData, @@ -2260,18 +10485,18 @@ impl LogCreateMessageBuilder { } } -impl LogCreateMessageBuilder +impl ReactionViewBuilder where - St: log_create_message_state::State, - St::ConvoId: log_create_message_state::IsUnset, + St: reaction_view_state::State, + St::CreatedAt: reaction_view_state::IsUnset, { - /// Set the `convoId` field (required) - pub fn convo_id( + /// Set the `createdAt` field (required) + pub fn created_at( mut self, - value: impl Into, - ) -> LogCreateMessageBuilder> { + value: impl Into, + ) -> ReactionViewBuilder> { self._fields.0 = Option::Some(value.into()); - LogCreateMessageBuilder { + ReactionViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2279,18 +10504,18 @@ where } } -impl LogCreateMessageBuilder +impl ReactionViewBuilder where - St: log_create_message_state::State, - St::Message: log_create_message_state::IsUnset, + St: reaction_view_state::State, + St::Sender: reaction_view_state::IsUnset, { - /// Set the `message` field (required) - pub fn message( + /// Set the `sender` field (required) + pub fn sender( mut self, - value: impl Into>, - ) -> LogCreateMessageBuilder> { + value: impl Into>, + ) -> ReactionViewBuilder> { self._fields.1 = Option::Some(value.into()); - LogCreateMessageBuilder { + ReactionViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2298,18 +10523,18 @@ where } } -impl LogCreateMessageBuilder +impl ReactionViewBuilder where - St: log_create_message_state::State, - St::Rev: log_create_message_state::IsUnset, + St: reaction_view_state::State, + St::Value: reaction_view_state::IsUnset, { - /// Set the `rev` field (required) - pub fn rev( + /// Set the `value` field (required) + pub fn value( mut self, value: impl Into, - ) -> LogCreateMessageBuilder> { + ) -> ReactionViewBuilder> { self._fields.2 = Option::Some(value.into()); - LogCreateMessageBuilder { + ReactionViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2317,19 +10542,19 @@ where } } -impl LogCreateMessageBuilder +impl ReactionViewBuilder where - St: log_create_message_state::State, - St::ConvoId: log_create_message_state::IsSet, - St::Message: log_create_message_state::IsSet, - St::Rev: log_create_message_state::IsSet, + St: reaction_view_state::State, + St::CreatedAt: reaction_view_state::IsSet, + St::Value: reaction_view_state::IsSet, + St::Sender: reaction_view_state::IsSet, { /// Build the final struct. - pub fn build(self) -> LogCreateMessage { - LogCreateMessage { - convo_id: self._fields.0.unwrap(), - message: self._fields.1.unwrap(), - rev: self._fields.2.unwrap(), + pub fn build(self) -> ReactionView { + ReactionView { + created_at: self._fields.0.unwrap(), + sender: self._fields.1.unwrap(), + value: self._fields.2.unwrap(), extra_data: Default::default(), } } @@ -2337,17 +10562,17 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> LogCreateMessage { - LogCreateMessage { - convo_id: self._fields.0.unwrap(), - message: self._fields.1.unwrap(), - rev: self._fields.2.unwrap(), + ) -> ReactionView { + ReactionView { + created_at: self._fields.0.unwrap(), + sender: self._fields.1.unwrap(), + value: self._fields.2.unwrap(), extra_data: Some(extra_data), } } } -pub mod log_delete_message_state { +pub mod reaction_view_sender_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -2357,129 +10582,65 @@ pub mod log_delete_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ConvoId; - type Message; - type Rev; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ConvoId = Unset; - type Message = Unset; - type Rev = Unset; - } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData St>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type ConvoId = Set; - type Message = St::Message; - type Rev = St::Rev; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData St>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type ConvoId = St::ConvoId; - type Message = Set; - type Rev = St::Rev; + type Did = Unset; } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData St>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type ConvoId = St::ConvoId; - type Message = St::Message; - type Rev = Set; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `convo_id` field - pub struct convo_id(()); - ///Marker type for the `message` field - pub struct message(()); - ///Marker type for the `rev` field - pub struct rev(()); + ///Marker type for the `did` field + pub struct did(()); } } /// Builder for constructing an instance of this type. -pub struct LogDeleteMessageBuilder { +pub struct ReactionViewSenderBuilder { _state: PhantomData St>, - _fields: (Option, Option>, Option), + _fields: (Option>,), _type: PhantomData S>, } -impl LogDeleteMessage { +impl ReactionViewSender { /// Create a new builder for this type. - pub fn new() -> LogDeleteMessageBuilder { - LogDeleteMessageBuilder::new() + pub fn new() -> ReactionViewSenderBuilder { + ReactionViewSenderBuilder::new() } } -impl LogDeleteMessageBuilder { +impl ReactionViewSenderBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - LogDeleteMessageBuilder { + ReactionViewSenderBuilder { _state: PhantomData, - _fields: (None, None, None), + _fields: (None,), _type: PhantomData, } } } -impl LogDeleteMessageBuilder +impl ReactionViewSenderBuilder where - St: log_delete_message_state::State, - St::ConvoId: log_delete_message_state::IsUnset, + St: reaction_view_sender_state::State, + St::Did: reaction_view_sender_state::IsUnset, { - /// Set the `convoId` field (required) - pub fn convo_id( + /// Set the `did` field (required) + pub fn did( mut self, - value: impl Into, - ) -> LogDeleteMessageBuilder> { + value: impl Into>, + ) -> ReactionViewSenderBuilder> { self._fields.0 = Option::Some(value.into()); - LogDeleteMessageBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } - } -} - -impl LogDeleteMessageBuilder -where - St: log_delete_message_state::State, - St::Message: log_delete_message_state::IsUnset, -{ - /// Set the `message` field (required) - pub fn message( - mut self, - value: impl Into>, - ) -> LogDeleteMessageBuilder> { - self._fields.1 = Option::Some(value.into()); - LogDeleteMessageBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } - } -} - -impl LogDeleteMessageBuilder -where - St: log_delete_message_state::State, - St::Rev: log_delete_message_state::IsUnset, -{ - /// Set the `rev` field (required) - pub fn rev( - mut self, - value: impl Into, - ) -> LogDeleteMessageBuilder> { - self._fields.2 = Option::Some(value.into()); - LogDeleteMessageBuilder { + ReactionViewSenderBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2487,19 +10648,15 @@ where } } -impl LogDeleteMessageBuilder +impl ReactionViewSenderBuilder where - St: log_delete_message_state::State, - St::ConvoId: log_delete_message_state::IsSet, - St::Message: log_delete_message_state::IsSet, - St::Rev: log_delete_message_state::IsSet, + St: reaction_view_sender_state::State, + St::Did: reaction_view_sender_state::IsSet, { /// Build the final struct. - pub fn build(self) -> LogDeleteMessage { - LogDeleteMessage { - convo_id: self._fields.0.unwrap(), - message: self._fields.1.unwrap(), - rev: self._fields.2.unwrap(), + pub fn build(self) -> ReactionViewSender { + ReactionViewSender { + did: self._fields.0.unwrap(), extra_data: Default::default(), } } @@ -2507,17 +10664,15 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> LogDeleteMessage { - LogDeleteMessage { - convo_id: self._fields.0.unwrap(), - message: self._fields.1.unwrap(), - rev: self._fields.2.unwrap(), + ) -> ReactionViewSender { + ReactionViewSender { + did: self._fields.0.unwrap(), extra_data: Some(extra_data), } } } -pub mod log_read_message_state { +pub mod system_message_data_add_member_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -2527,72 +10682,84 @@ pub mod log_read_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ConvoId; - type Message; - type Rev; + type Role; + type Member; + type AddedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ConvoId = Unset; - type Message = Unset; - type Rev = Unset; - } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData St>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type ConvoId = Set; - type Message = St::Message; - type Rev = St::Rev; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData St>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type ConvoId = St::ConvoId; - type Message = Set; - type Rev = St::Rev; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData St>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type ConvoId = St::ConvoId; - type Message = St::Message; - type Rev = Set; + type Role = Unset; + type Member = Unset; + type AddedBy = Unset; + } + ///State transition - sets the `role` field to Set + pub struct SetRole(PhantomData St>); + impl sealed::Sealed for SetRole {} + impl State for SetRole { + type Role = Set; + type Member = St::Member; + type AddedBy = St::AddedBy; + } + ///State transition - sets the `member` field to Set + pub struct SetMember(PhantomData St>); + impl sealed::Sealed for SetMember {} + impl State for SetMember { + type Role = St::Role; + type Member = Set; + type AddedBy = St::AddedBy; + } + ///State transition - sets the `added_by` field to Set + pub struct SetAddedBy(PhantomData St>); + impl sealed::Sealed for SetAddedBy {} + impl State for SetAddedBy { + type Role = St::Role; + type Member = St::Member; + type AddedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `convo_id` field - pub struct convo_id(()); - ///Marker type for the `message` field - pub struct message(()); - ///Marker type for the `rev` field - pub struct rev(()); + ///Marker type for the `role` field + pub struct role(()); + ///Marker type for the `member` field + pub struct member(()); + ///Marker type for the `added_by` field + pub struct added_by(()); } } /// Builder for constructing an instance of this type. -pub struct LogReadMessageBuilder { +pub struct SystemMessageDataAddMemberBuilder< + S: BosStr, + St: system_message_data_add_member_state::State, +> { _state: PhantomData St>, - _fields: (Option, Option>, Option), + _fields: ( + Option>, + Option>, + Option>, + ), _type: PhantomData S>, } -impl LogReadMessage { +impl SystemMessageDataAddMember { /// Create a new builder for this type. - pub fn new() -> LogReadMessageBuilder { - LogReadMessageBuilder::new() + pub fn new() -> SystemMessageDataAddMemberBuilder< + S, + system_message_data_add_member_state::Empty, + > { + SystemMessageDataAddMemberBuilder::new() } } -impl LogReadMessageBuilder { +impl< + S: BosStr, +> SystemMessageDataAddMemberBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - LogReadMessageBuilder { + SystemMessageDataAddMemberBuilder { _state: PhantomData, _fields: (None, None, None), _type: PhantomData, @@ -2600,18 +10767,21 @@ impl LogReadMessageBuilder { } } -impl LogReadMessageBuilder +impl SystemMessageDataAddMemberBuilder where - St: log_read_message_state::State, - St::ConvoId: log_read_message_state::IsUnset, + St: system_message_data_add_member_state::State, + St::AddedBy: system_message_data_add_member_state::IsUnset, { - /// Set the `convoId` field (required) - pub fn convo_id( + /// Set the `addedBy` field (required) + pub fn added_by( mut self, - value: impl Into, - ) -> LogReadMessageBuilder> { + value: impl Into>, + ) -> SystemMessageDataAddMemberBuilder< + S, + system_message_data_add_member_state::SetAddedBy, + > { self._fields.0 = Option::Some(value.into()); - LogReadMessageBuilder { + SystemMessageDataAddMemberBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2619,18 +10789,21 @@ where } } -impl LogReadMessageBuilder +impl SystemMessageDataAddMemberBuilder where - St: log_read_message_state::State, - St::Message: log_read_message_state::IsUnset, + St: system_message_data_add_member_state::State, + St::Member: system_message_data_add_member_state::IsUnset, { - /// Set the `message` field (required) - pub fn message( + /// Set the `member` field (required) + pub fn member( mut self, - value: impl Into>, - ) -> LogReadMessageBuilder> { + value: impl Into>, + ) -> SystemMessageDataAddMemberBuilder< + S, + system_message_data_add_member_state::SetMember, + > { self._fields.1 = Option::Some(value.into()); - LogReadMessageBuilder { + SystemMessageDataAddMemberBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2638,18 +10811,21 @@ where } } -impl LogReadMessageBuilder +impl SystemMessageDataAddMemberBuilder where - St: log_read_message_state::State, - St::Rev: log_read_message_state::IsUnset, + St: system_message_data_add_member_state::State, + St::Role: system_message_data_add_member_state::IsUnset, { - /// Set the `rev` field (required) - pub fn rev( + /// Set the `role` field (required) + pub fn role( mut self, - value: impl Into, - ) -> LogReadMessageBuilder> { + value: impl Into>, + ) -> SystemMessageDataAddMemberBuilder< + S, + system_message_data_add_member_state::SetRole, + > { self._fields.2 = Option::Some(value.into()); - LogReadMessageBuilder { + SystemMessageDataAddMemberBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2657,19 +10833,19 @@ where } } -impl LogReadMessageBuilder +impl SystemMessageDataAddMemberBuilder where - St: log_read_message_state::State, - St::ConvoId: log_read_message_state::IsSet, - St::Message: log_read_message_state::IsSet, - St::Rev: log_read_message_state::IsSet, + St: system_message_data_add_member_state::State, + St::Role: system_message_data_add_member_state::IsSet, + St::Member: system_message_data_add_member_state::IsSet, + St::AddedBy: system_message_data_add_member_state::IsSet, { /// Build the final struct. - pub fn build(self) -> LogReadMessage { - LogReadMessage { - convo_id: self._fields.0.unwrap(), - message: self._fields.1.unwrap(), - rev: self._fields.2.unwrap(), + pub fn build(self) -> SystemMessageDataAddMember { + SystemMessageDataAddMember { + added_by: self._fields.0.unwrap(), + member: self._fields.1.unwrap(), + role: self._fields.2.unwrap(), extra_data: Default::default(), } } @@ -2677,17 +10853,17 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> LogReadMessage { - LogReadMessage { - convo_id: self._fields.0.unwrap(), - message: self._fields.1.unwrap(), - rev: self._fields.2.unwrap(), + ) -> SystemMessageDataAddMember { + SystemMessageDataAddMember { + added_by: self._fields.0.unwrap(), + member: self._fields.1.unwrap(), + role: self._fields.2.unwrap(), extra_data: Some(extra_data), } } } -pub mod log_remove_reaction_state { +pub mod system_message_data_lock_convo_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -2697,112 +10873,76 @@ pub mod log_remove_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ConvoId; - type Message; - type Reaction; - type Rev; + type LockedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ConvoId = Unset; - type Message = Unset; - type Reaction = Unset; - type Rev = Unset; + type LockedBy = Unset; } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData St>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type ConvoId = Set; - type Message = St::Message; - type Reaction = St::Reaction; - type Rev = St::Rev; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData St>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type ConvoId = St::ConvoId; - type Message = Set; - type Reaction = St::Reaction; - type Rev = St::Rev; - } - ///State transition - sets the `reaction` field to Set - pub struct SetReaction(PhantomData St>); - impl sealed::Sealed for SetReaction {} - impl State for SetReaction { - type ConvoId = St::ConvoId; - type Message = St::Message; - type Reaction = Set; - type Rev = St::Rev; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData St>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type ConvoId = St::ConvoId; - type Message = St::Message; - type Reaction = St::Reaction; - type Rev = Set; + ///State transition - sets the `locked_by` field to Set + pub struct SetLockedBy(PhantomData St>); + impl sealed::Sealed for SetLockedBy {} + impl State for SetLockedBy { + type LockedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `convo_id` field - pub struct convo_id(()); - ///Marker type for the `message` field - pub struct message(()); - ///Marker type for the `reaction` field - pub struct reaction(()); - ///Marker type for the `rev` field - pub struct rev(()); + ///Marker type for the `locked_by` field + pub struct locked_by(()); } } /// Builder for constructing an instance of this type. -pub struct LogRemoveReactionBuilder { +pub struct SystemMessageDataLockConvoBuilder< + S: BosStr, + St: system_message_data_lock_convo_state::State, +> { _state: PhantomData St>, - _fields: ( - Option, - Option>, - Option>, - Option, - ), + _fields: (Option>,), _type: PhantomData S>, } -impl LogRemoveReaction { +impl SystemMessageDataLockConvo { /// Create a new builder for this type. - pub fn new() -> LogRemoveReactionBuilder { - LogRemoveReactionBuilder::new() + pub fn new() -> SystemMessageDataLockConvoBuilder< + S, + system_message_data_lock_convo_state::Empty, + > { + SystemMessageDataLockConvoBuilder::new() } } -impl LogRemoveReactionBuilder { +impl< + S: BosStr, +> SystemMessageDataLockConvoBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - LogRemoveReactionBuilder { + SystemMessageDataLockConvoBuilder { _state: PhantomData, - _fields: (None, None, None, None), + _fields: (None,), _type: PhantomData, } } } -impl LogRemoveReactionBuilder +impl SystemMessageDataLockConvoBuilder where - St: log_remove_reaction_state::State, - St::ConvoId: log_remove_reaction_state::IsUnset, + St: system_message_data_lock_convo_state::State, + St::LockedBy: system_message_data_lock_convo_state::IsUnset, { - /// Set the `convoId` field (required) - pub fn convo_id( + /// Set the `lockedBy` field (required) + pub fn locked_by( mut self, - value: impl Into, - ) -> LogRemoveReactionBuilder> { + value: impl Into>, + ) -> SystemMessageDataLockConvoBuilder< + S, + system_message_data_lock_convo_state::SetLockedBy, + > { self._fields.0 = Option::Some(value.into()); - LogRemoveReactionBuilder { + SystemMessageDataLockConvoBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2810,56 +10950,113 @@ where } } -impl LogRemoveReactionBuilder +impl SystemMessageDataLockConvoBuilder where - St: log_remove_reaction_state::State, - St::Message: log_remove_reaction_state::IsUnset, + St: system_message_data_lock_convo_state::State, + St::LockedBy: system_message_data_lock_convo_state::IsSet, { - /// Set the `message` field (required) - pub fn message( - mut self, - value: impl Into>, - ) -> LogRemoveReactionBuilder> { - self._fields.1 = Option::Some(value.into()); - LogRemoveReactionBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, + /// Build the final struct. + pub fn build(self) -> SystemMessageDataLockConvo { + SystemMessageDataLockConvo { + locked_by: self._fields.0.unwrap(), + extra_data: Default::default(), } } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> SystemMessageDataLockConvo { + SystemMessageDataLockConvo { + locked_by: self._fields.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod system_message_data_lock_convo_permanently_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type LockedBy; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type LockedBy = Unset; + } + ///State transition - sets the `locked_by` field to Set + pub struct SetLockedBy(PhantomData St>); + impl sealed::Sealed for SetLockedBy {} + impl State for SetLockedBy { + type LockedBy = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `locked_by` field + pub struct locked_by(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct SystemMessageDataLockConvoPermanentlyBuilder< + S: BosStr, + St: system_message_data_lock_convo_permanently_state::State, +> { + _state: PhantomData St>, + _fields: (Option>,), + _type: PhantomData S>, +} + +impl SystemMessageDataLockConvoPermanently { + /// Create a new builder for this type. + pub fn new() -> SystemMessageDataLockConvoPermanentlyBuilder< + S, + system_message_data_lock_convo_permanently_state::Empty, + > { + SystemMessageDataLockConvoPermanentlyBuilder::new() + } } -impl LogRemoveReactionBuilder -where - St: log_remove_reaction_state::State, - St::Reaction: log_remove_reaction_state::IsUnset, -{ - /// Set the `reaction` field (required) - pub fn reaction( - mut self, - value: impl Into>, - ) -> LogRemoveReactionBuilder> { - self._fields.2 = Option::Some(value.into()); - LogRemoveReactionBuilder { +impl< + S: BosStr, +> SystemMessageDataLockConvoPermanentlyBuilder< + S, + system_message_data_lock_convo_permanently_state::Empty, +> { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + SystemMessageDataLockConvoPermanentlyBuilder { _state: PhantomData, - _fields: self._fields, + _fields: (None,), _type: PhantomData, } } } -impl LogRemoveReactionBuilder +impl SystemMessageDataLockConvoPermanentlyBuilder where - St: log_remove_reaction_state::State, - St::Rev: log_remove_reaction_state::IsUnset, + St: system_message_data_lock_convo_permanently_state::State, + St::LockedBy: system_message_data_lock_convo_permanently_state::IsUnset, { - /// Set the `rev` field (required) - pub fn rev( + /// Set the `lockedBy` field (required) + pub fn locked_by( mut self, - value: impl Into, - ) -> LogRemoveReactionBuilder> { - self._fields.3 = Option::Some(value.into()); - LogRemoveReactionBuilder { + value: impl Into>, + ) -> SystemMessageDataLockConvoPermanentlyBuilder< + S, + system_message_data_lock_convo_permanently_state::SetLockedBy, + > { + self._fields.0 = Option::Some(value.into()); + SystemMessageDataLockConvoPermanentlyBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2867,21 +11064,15 @@ where } } -impl LogRemoveReactionBuilder +impl SystemMessageDataLockConvoPermanentlyBuilder where - St: log_remove_reaction_state::State, - St::ConvoId: log_remove_reaction_state::IsSet, - St::Message: log_remove_reaction_state::IsSet, - St::Reaction: log_remove_reaction_state::IsSet, - St::Rev: log_remove_reaction_state::IsSet, + St: system_message_data_lock_convo_permanently_state::State, + St::LockedBy: system_message_data_lock_convo_permanently_state::IsSet, { /// Build the final struct. - pub fn build(self) -> LogRemoveReaction { - LogRemoveReaction { - convo_id: self._fields.0.unwrap(), - message: self._fields.1.unwrap(), - reaction: self._fields.2.unwrap(), - rev: self._fields.3.unwrap(), + pub fn build(self) -> SystemMessageDataLockConvoPermanently { + SystemMessageDataLockConvoPermanently { + locked_by: self._fields.0.unwrap(), extra_data: Default::default(), } } @@ -2889,18 +11080,15 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> LogRemoveReaction { - LogRemoveReaction { - convo_id: self._fields.0.unwrap(), - message: self._fields.1.unwrap(), - reaction: self._fields.2.unwrap(), - rev: self._fields.3.unwrap(), + ) -> SystemMessageDataLockConvoPermanently { + SystemMessageDataLockConvoPermanently { + locked_by: self._fields.0.unwrap(), extra_data: Some(extra_data), } } } -pub mod message_and_reaction_view_state { +pub mod system_message_data_member_join_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -2910,88 +11098,114 @@ pub mod message_and_reaction_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Message; - type Reaction; + type Role; + type Member; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Message = Unset; - type Reaction = Unset; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData St>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type Message = Set; - type Reaction = St::Reaction; - } - ///State transition - sets the `reaction` field to Set - pub struct SetReaction(PhantomData St>); - impl sealed::Sealed for SetReaction {} - impl State for SetReaction { - type Message = St::Message; - type Reaction = Set; + type Role = Unset; + type Member = Unset; + } + ///State transition - sets the `role` field to Set + pub struct SetRole(PhantomData St>); + impl sealed::Sealed for SetRole {} + impl State for SetRole { + type Role = Set; + type Member = St::Member; + } + ///State transition - sets the `member` field to Set + pub struct SetMember(PhantomData St>); + impl sealed::Sealed for SetMember {} + impl State for SetMember { + type Role = St::Role; + type Member = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `message` field - pub struct message(()); - ///Marker type for the `reaction` field - pub struct reaction(()); + ///Marker type for the `role` field + pub struct role(()); + ///Marker type for the `member` field + pub struct member(()); } } /// Builder for constructing an instance of this type. -pub struct MessageAndReactionViewBuilder< +pub struct SystemMessageDataMemberJoinBuilder< S: BosStr, - St: message_and_reaction_view_state::State, + St: system_message_data_member_join_state::State, > { _state: PhantomData St>, - _fields: (Option>, Option>), + _fields: ( + Option>, + Option>, + Option>, + ), _type: PhantomData S>, } -impl MessageAndReactionView { +impl SystemMessageDataMemberJoin { /// Create a new builder for this type. - pub fn new() -> MessageAndReactionViewBuilder< + pub fn new() -> SystemMessageDataMemberJoinBuilder< S, - message_and_reaction_view_state::Empty, + system_message_data_member_join_state::Empty, > { - MessageAndReactionViewBuilder::new() + SystemMessageDataMemberJoinBuilder::new() } } impl< S: BosStr, -> MessageAndReactionViewBuilder { +> SystemMessageDataMemberJoinBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - MessageAndReactionViewBuilder { + SystemMessageDataMemberJoinBuilder { _state: PhantomData, - _fields: (None, None), + _fields: (None, None, None), _type: PhantomData, } } } -impl MessageAndReactionViewBuilder +impl< + S: BosStr, + St: system_message_data_member_join_state::State, +> SystemMessageDataMemberJoinBuilder { + /// Set the `approvedBy` field (optional) + pub fn approved_by( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `approvedBy` field to an Option value (optional) + pub fn maybe_approved_by( + mut self, + value: Option>, + ) -> Self { + self._fields.0 = value; + self + } +} + +impl SystemMessageDataMemberJoinBuilder where - St: message_and_reaction_view_state::State, - St::Message: message_and_reaction_view_state::IsUnset, + St: system_message_data_member_join_state::State, + St::Member: system_message_data_member_join_state::IsUnset, { - /// Set the `message` field (required) - pub fn message( + /// Set the `member` field (required) + pub fn member( mut self, - value: impl Into>, - ) -> MessageAndReactionViewBuilder< + value: impl Into>, + ) -> SystemMessageDataMemberJoinBuilder< S, - message_and_reaction_view_state::SetMessage, + system_message_data_member_join_state::SetMember, > { - self._fields.0 = Option::Some(value.into()); - MessageAndReactionViewBuilder { + self._fields.1 = Option::Some(value.into()); + SystemMessageDataMemberJoinBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -2999,21 +11213,21 @@ where } } -impl MessageAndReactionViewBuilder +impl SystemMessageDataMemberJoinBuilder where - St: message_and_reaction_view_state::State, - St::Reaction: message_and_reaction_view_state::IsUnset, + St: system_message_data_member_join_state::State, + St::Role: system_message_data_member_join_state::IsUnset, { - /// Set the `reaction` field (required) - pub fn reaction( + /// Set the `role` field (required) + pub fn role( mut self, - value: impl Into>, - ) -> MessageAndReactionViewBuilder< + value: impl Into>, + ) -> SystemMessageDataMemberJoinBuilder< S, - message_and_reaction_view_state::SetReaction, + system_message_data_member_join_state::SetRole, > { - self._fields.1 = Option::Some(value.into()); - MessageAndReactionViewBuilder { + self._fields.2 = Option::Some(value.into()); + SystemMessageDataMemberJoinBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -3021,17 +11235,18 @@ where } } -impl MessageAndReactionViewBuilder +impl SystemMessageDataMemberJoinBuilder where - St: message_and_reaction_view_state::State, - St::Message: message_and_reaction_view_state::IsSet, - St::Reaction: message_and_reaction_view_state::IsSet, + St: system_message_data_member_join_state::State, + St::Role: system_message_data_member_join_state::IsSet, + St::Member: system_message_data_member_join_state::IsSet, { /// Build the final struct. - pub fn build(self) -> MessageAndReactionView { - MessageAndReactionView { - message: self._fields.0.unwrap(), - reaction: self._fields.1.unwrap(), + pub fn build(self) -> SystemMessageDataMemberJoin { + SystemMessageDataMemberJoin { + approved_by: self._fields.0, + member: self._fields.1.unwrap(), + role: self._fields.2.unwrap(), extra_data: Default::default(), } } @@ -3039,16 +11254,17 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> MessageAndReactionView { - MessageAndReactionView { - message: self._fields.0.unwrap(), - reaction: self._fields.1.unwrap(), + ) -> SystemMessageDataMemberJoin { + SystemMessageDataMemberJoin { + approved_by: self._fields.0, + member: self._fields.1.unwrap(), + role: self._fields.2.unwrap(), extra_data: Some(extra_data), } } } -pub mod message_ref_state { +pub mod system_message_data_member_leave_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -3058,129 +11274,76 @@ pub mod message_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ConvoId; - type Did; - type MessageId; + type Member; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ConvoId = Unset; - type Did = Unset; - type MessageId = Unset; - } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData St>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type ConvoId = Set; - type Did = St::Did; - type MessageId = St::MessageId; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type ConvoId = St::ConvoId; - type Did = Set; - type MessageId = St::MessageId; + type Member = Unset; } - ///State transition - sets the `message_id` field to Set - pub struct SetMessageId(PhantomData St>); - impl sealed::Sealed for SetMessageId {} - impl State for SetMessageId { - type ConvoId = St::ConvoId; - type Did = St::Did; - type MessageId = Set; + ///State transition - sets the `member` field to Set + pub struct SetMember(PhantomData St>); + impl sealed::Sealed for SetMember {} + impl State for SetMember { + type Member = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `convo_id` field - pub struct convo_id(()); - ///Marker type for the `did` field - pub struct did(()); - ///Marker type for the `message_id` field - pub struct message_id(()); + ///Marker type for the `member` field + pub struct member(()); } } /// Builder for constructing an instance of this type. -pub struct MessageRefBuilder { +pub struct SystemMessageDataMemberLeaveBuilder< + S: BosStr, + St: system_message_data_member_leave_state::State, +> { _state: PhantomData St>, - _fields: (Option, Option>, Option), + _fields: (Option>,), _type: PhantomData S>, } -impl MessageRef { +impl SystemMessageDataMemberLeave { /// Create a new builder for this type. - pub fn new() -> MessageRefBuilder { - MessageRefBuilder::new() + pub fn new() -> SystemMessageDataMemberLeaveBuilder< + S, + system_message_data_member_leave_state::Empty, + > { + SystemMessageDataMemberLeaveBuilder::new() } } -impl MessageRefBuilder { +impl< + S: BosStr, +> SystemMessageDataMemberLeaveBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - MessageRefBuilder { + SystemMessageDataMemberLeaveBuilder { _state: PhantomData, - _fields: (None, None, None), + _fields: (None,), _type: PhantomData, } } } -impl MessageRefBuilder +impl SystemMessageDataMemberLeaveBuilder where - St: message_ref_state::State, - St::ConvoId: message_ref_state::IsUnset, + St: system_message_data_member_leave_state::State, + St::Member: system_message_data_member_leave_state::IsUnset, { - /// Set the `convoId` field (required) - pub fn convo_id( + /// Set the `member` field (required) + pub fn member( mut self, - value: impl Into, - ) -> MessageRefBuilder> { + value: impl Into>, + ) -> SystemMessageDataMemberLeaveBuilder< + S, + system_message_data_member_leave_state::SetMember, + > { self._fields.0 = Option::Some(value.into()); - MessageRefBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } - } -} - -impl MessageRefBuilder -where - St: message_ref_state::State, - St::Did: message_ref_state::IsUnset, -{ - /// Set the `did` field (required) - pub fn did( - mut self, - value: impl Into>, - ) -> MessageRefBuilder> { - self._fields.1 = Option::Some(value.into()); - MessageRefBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } - } -} - -impl MessageRefBuilder -where - St: message_ref_state::State, - St::MessageId: message_ref_state::IsUnset, -{ - /// Set the `messageId` field (required) - pub fn message_id( - mut self, - value: impl Into, - ) -> MessageRefBuilder> { - self._fields.2 = Option::Some(value.into()); - MessageRefBuilder { + SystemMessageDataMemberLeaveBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -3188,19 +11351,15 @@ where } } -impl MessageRefBuilder +impl SystemMessageDataMemberLeaveBuilder where - St: message_ref_state::State, - St::ConvoId: message_ref_state::IsSet, - St::Did: message_ref_state::IsSet, - St::MessageId: message_ref_state::IsSet, + St: system_message_data_member_leave_state::State, + St::Member: system_message_data_member_leave_state::IsSet, { /// Build the final struct. - pub fn build(self) -> MessageRef { - MessageRef { - convo_id: self._fields.0.unwrap(), - did: self._fields.1.unwrap(), - message_id: self._fields.2.unwrap(), + pub fn build(self) -> SystemMessageDataMemberLeave { + SystemMessageDataMemberLeave { + member: self._fields.0.unwrap(), extra_data: Default::default(), } } @@ -3208,17 +11367,15 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> MessageRef { - MessageRef { - convo_id: self._fields.0.unwrap(), - did: self._fields.1.unwrap(), - message_id: self._fields.2.unwrap(), + ) -> SystemMessageDataMemberLeave { + SystemMessageDataMemberLeave { + member: self._fields.0.unwrap(), extra_data: Some(extra_data), } } } -pub mod message_view_state { +pub mod system_message_data_remove_member_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -3227,161 +11384,95 @@ pub mod message_view_state { pub trait Sealed {} } /// State trait tracking which required fields have been set - pub trait State: sealed::Sealed { - type Id; - type Rev; - type Sender; - type SentAt; - type Text; + pub trait State: sealed::Sealed { + type Member; + type RemovedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; - type Rev = Unset; - type Sender = Unset; - type SentAt = Unset; - type Text = Unset; - } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData St>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type Rev = St::Rev; - type Sender = St::Sender; - type SentAt = St::SentAt; - type Text = St::Text; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData St>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Id = St::Id; - type Rev = Set; - type Sender = St::Sender; - type SentAt = St::SentAt; - type Text = St::Text; - } - ///State transition - sets the `sender` field to Set - pub struct SetSender(PhantomData St>); - impl sealed::Sealed for SetSender {} - impl State for SetSender { - type Id = St::Id; - type Rev = St::Rev; - type Sender = Set; - type SentAt = St::SentAt; - type Text = St::Text; - } - ///State transition - sets the `sent_at` field to Set - pub struct SetSentAt(PhantomData St>); - impl sealed::Sealed for SetSentAt {} - impl State for SetSentAt { - type Id = St::Id; - type Rev = St::Rev; - type Sender = St::Sender; - type SentAt = Set; - type Text = St::Text; - } - ///State transition - sets the `text` field to Set - pub struct SetText(PhantomData St>); - impl sealed::Sealed for SetText {} - impl State for SetText { - type Id = St::Id; - type Rev = St::Rev; - type Sender = St::Sender; - type SentAt = St::SentAt; - type Text = Set; + type Member = Unset; + type RemovedBy = Unset; + } + ///State transition - sets the `member` field to Set + pub struct SetMember(PhantomData St>); + impl sealed::Sealed for SetMember {} + impl State for SetMember { + type Member = Set; + type RemovedBy = St::RemovedBy; + } + ///State transition - sets the `removed_by` field to Set + pub struct SetRemovedBy(PhantomData St>); + impl sealed::Sealed for SetRemovedBy {} + impl State for SetRemovedBy { + type Member = St::Member; + type RemovedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `id` field - pub struct id(()); - ///Marker type for the `rev` field - pub struct rev(()); - ///Marker type for the `sender` field - pub struct sender(()); - ///Marker type for the `sent_at` field - pub struct sent_at(()); - ///Marker type for the `text` field - pub struct text(()); + ///Marker type for the `member` field + pub struct member(()); + ///Marker type for the `removed_by` field + pub struct removed_by(()); } } /// Builder for constructing an instance of this type. -pub struct MessageViewBuilder { +pub struct SystemMessageDataRemoveMemberBuilder< + S: BosStr, + St: system_message_data_remove_member_state::State, +> { _state: PhantomData St>, _fields: ( - Option>, - Option>>, - Option, - Option>>, - Option, - Option>, - Option, - Option, + Option>, + Option>, ), _type: PhantomData S>, } -impl MessageView { +impl SystemMessageDataRemoveMember { /// Create a new builder for this type. - pub fn new() -> MessageViewBuilder { - MessageViewBuilder::new() + pub fn new() -> SystemMessageDataRemoveMemberBuilder< + S, + system_message_data_remove_member_state::Empty, + > { + SystemMessageDataRemoveMemberBuilder::new() } } -impl MessageViewBuilder { +impl< + S: BosStr, +> SystemMessageDataRemoveMemberBuilder< + S, + system_message_data_remove_member_state::Empty, +> { /// Create a new builder with all fields unset. pub fn new() -> Self { - MessageViewBuilder { + SystemMessageDataRemoveMemberBuilder { _state: PhantomData, - _fields: (None, None, None, None, None, None, None, None), + _fields: (None, None), _type: PhantomData, } } } -impl MessageViewBuilder { - /// Set the `embed` field (optional) - pub fn embed(mut self, value: impl Into>>) -> Self { - self._fields.0 = value.into(); - self - } - /// Set the `embed` field to an Option value (optional) - pub fn maybe_embed(mut self, value: Option>) -> Self { - self._fields.0 = value; - self - } -} - -impl MessageViewBuilder { - /// Set the `facets` field (optional) - pub fn facets(mut self, value: impl Into>>>) -> Self { - self._fields.1 = value.into(); - self - } - /// Set the `facets` field to an Option value (optional) - pub fn maybe_facets(mut self, value: Option>>) -> Self { - self._fields.1 = value; - self - } -} - -impl MessageViewBuilder +impl SystemMessageDataRemoveMemberBuilder where - St: message_view_state::State, - St::Id: message_view_state::IsUnset, + St: system_message_data_remove_member_state::State, + St::Member: system_message_data_remove_member_state::IsUnset, { - /// Set the `id` field (required) - pub fn id( + /// Set the `member` field (required) + pub fn member( mut self, - value: impl Into, - ) -> MessageViewBuilder> { - self._fields.2 = Option::Some(value.into()); - MessageViewBuilder { + value: impl Into>, + ) -> SystemMessageDataRemoveMemberBuilder< + S, + system_message_data_remove_member_state::SetMember, + > { + self._fields.0 = Option::Some(value.into()); + SystemMessageDataRemoveMemberBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -3389,37 +11480,21 @@ where } } -impl MessageViewBuilder { - /// Set the `reactions` field (optional) - pub fn reactions( - mut self, - value: impl Into>>>, - ) -> Self { - self._fields.3 = value.into(); - self - } - /// Set the `reactions` field to an Option value (optional) - pub fn maybe_reactions( - mut self, - value: Option>>, - ) -> Self { - self._fields.3 = value; - self - } -} - -impl MessageViewBuilder +impl SystemMessageDataRemoveMemberBuilder where - St: message_view_state::State, - St::Rev: message_view_state::IsUnset, + St: system_message_data_remove_member_state::State, + St::RemovedBy: system_message_data_remove_member_state::IsUnset, { - /// Set the `rev` field (required) - pub fn rev( + /// Set the `removedBy` field (required) + pub fn removed_by( mut self, - value: impl Into, - ) -> MessageViewBuilder> { - self._fields.4 = Option::Some(value.into()); - MessageViewBuilder { + value: impl Into>, + ) -> SystemMessageDataRemoveMemberBuilder< + S, + system_message_data_remove_member_state::SetRemovedBy, + > { + self._fields.1 = Option::Some(value.into()); + SystemMessageDataRemoveMemberBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -3427,56 +11502,113 @@ where } } -impl MessageViewBuilder +impl SystemMessageDataRemoveMemberBuilder where - St: message_view_state::State, - St::Sender: message_view_state::IsUnset, + St: system_message_data_remove_member_state::State, + St::Member: system_message_data_remove_member_state::IsSet, + St::RemovedBy: system_message_data_remove_member_state::IsSet, { - /// Set the `sender` field (required) - pub fn sender( - mut self, - value: impl Into>, - ) -> MessageViewBuilder> { - self._fields.5 = Option::Some(value.into()); - MessageViewBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, + /// Build the final struct. + pub fn build(self) -> SystemMessageDataRemoveMember { + SystemMessageDataRemoveMember { + member: self._fields.0.unwrap(), + removed_by: self._fields.1.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> SystemMessageDataRemoveMember { + SystemMessageDataRemoveMember { + member: self._fields.0.unwrap(), + removed_by: self._fields.1.unwrap(), + extra_data: Some(extra_data), } } } -impl MessageViewBuilder -where - St: message_view_state::State, - St::SentAt: message_view_state::IsUnset, -{ - /// Set the `sentAt` field (required) - pub fn sent_at( - mut self, - value: impl Into, - ) -> MessageViewBuilder> { - self._fields.6 = Option::Some(value.into()); - MessageViewBuilder { +pub mod system_message_data_unlock_convo_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type UnlockedBy; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type UnlockedBy = Unset; + } + ///State transition - sets the `unlocked_by` field to Set + pub struct SetUnlockedBy(PhantomData St>); + impl sealed::Sealed for SetUnlockedBy {} + impl State for SetUnlockedBy { + type UnlockedBy = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `unlocked_by` field + pub struct unlocked_by(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct SystemMessageDataUnlockConvoBuilder< + S: BosStr, + St: system_message_data_unlock_convo_state::State, +> { + _state: PhantomData St>, + _fields: (Option>,), + _type: PhantomData S>, +} + +impl SystemMessageDataUnlockConvo { + /// Create a new builder for this type. + pub fn new() -> SystemMessageDataUnlockConvoBuilder< + S, + system_message_data_unlock_convo_state::Empty, + > { + SystemMessageDataUnlockConvoBuilder::new() + } +} + +impl< + S: BosStr, +> SystemMessageDataUnlockConvoBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + SystemMessageDataUnlockConvoBuilder { _state: PhantomData, - _fields: self._fields, + _fields: (None,), _type: PhantomData, } } } -impl MessageViewBuilder +impl SystemMessageDataUnlockConvoBuilder where - St: message_view_state::State, - St::Text: message_view_state::IsUnset, + St: system_message_data_unlock_convo_state::State, + St::UnlockedBy: system_message_data_unlock_convo_state::IsUnset, { - /// Set the `text` field (required) - pub fn text( + /// Set the `unlockedBy` field (required) + pub fn unlocked_by( mut self, - value: impl Into, - ) -> MessageViewBuilder> { - self._fields.7 = Option::Some(value.into()); - MessageViewBuilder { + value: impl Into>, + ) -> SystemMessageDataUnlockConvoBuilder< + S, + system_message_data_unlock_convo_state::SetUnlockedBy, + > { + self._fields.0 = Option::Some(value.into()); + SystemMessageDataUnlockConvoBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -3484,26 +11616,15 @@ where } } -impl MessageViewBuilder +impl SystemMessageDataUnlockConvoBuilder where - St: message_view_state::State, - St::Id: message_view_state::IsSet, - St::Rev: message_view_state::IsSet, - St::Sender: message_view_state::IsSet, - St::SentAt: message_view_state::IsSet, - St::Text: message_view_state::IsSet, + St: system_message_data_unlock_convo_state::State, + St::UnlockedBy: system_message_data_unlock_convo_state::IsSet, { - /// Build the final struct. - pub fn build(self) -> MessageView { - MessageView { - embed: self._fields.0, - facets: self._fields.1, - id: self._fields.2.unwrap(), - reactions: self._fields.3, - rev: self._fields.4.unwrap(), - sender: self._fields.5.unwrap(), - sent_at: self._fields.6.unwrap(), - text: self._fields.7.unwrap(), + /// Build the final struct. + pub fn build(self) -> SystemMessageDataUnlockConvo { + SystemMessageDataUnlockConvo { + unlocked_by: self._fields.0.unwrap(), extra_data: Default::default(), } } @@ -3511,22 +11632,15 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> MessageView { - MessageView { - embed: self._fields.0, - facets: self._fields.1, - id: self._fields.2.unwrap(), - reactions: self._fields.3, - rev: self._fields.4.unwrap(), - sender: self._fields.5.unwrap(), - sent_at: self._fields.6.unwrap(), - text: self._fields.7.unwrap(), + ) -> SystemMessageDataUnlockConvo { + SystemMessageDataUnlockConvo { + unlocked_by: self._fields.0.unwrap(), extra_data: Some(extra_data), } } } -pub mod message_view_sender_state { +pub mod system_message_referred_user_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -3559,23 +11673,31 @@ pub mod message_view_sender_state { } /// Builder for constructing an instance of this type. -pub struct MessageViewSenderBuilder { +pub struct SystemMessageReferredUserBuilder< + S: BosStr, + St: system_message_referred_user_state::State, +> { _state: PhantomData St>, _fields: (Option>,), _type: PhantomData S>, } -impl MessageViewSender { +impl SystemMessageReferredUser { /// Create a new builder for this type. - pub fn new() -> MessageViewSenderBuilder { - MessageViewSenderBuilder::new() + pub fn new() -> SystemMessageReferredUserBuilder< + S, + system_message_referred_user_state::Empty, + > { + SystemMessageReferredUserBuilder::new() } } -impl MessageViewSenderBuilder { +impl< + S: BosStr, +> SystemMessageReferredUserBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - MessageViewSenderBuilder { + SystemMessageReferredUserBuilder { _state: PhantomData, _fields: (None,), _type: PhantomData, @@ -3583,18 +11705,21 @@ impl MessageViewSenderBuilder { } } -impl MessageViewSenderBuilder +impl SystemMessageReferredUserBuilder where - St: message_view_sender_state::State, - St::Did: message_view_sender_state::IsUnset, + St: system_message_referred_user_state::State, + St::Did: system_message_referred_user_state::IsUnset, { /// Set the `did` field (required) pub fn did( mut self, value: impl Into>, - ) -> MessageViewSenderBuilder> { + ) -> SystemMessageReferredUserBuilder< + S, + system_message_referred_user_state::SetDid, + > { self._fields.0 = Option::Some(value.into()); - MessageViewSenderBuilder { + SystemMessageReferredUserBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -3602,14 +11727,14 @@ where } } -impl MessageViewSenderBuilder +impl SystemMessageReferredUserBuilder where - St: message_view_sender_state::State, - St::Did: message_view_sender_state::IsSet, + St: system_message_referred_user_state::State, + St::Did: system_message_referred_user_state::IsSet, { /// Build the final struct. - pub fn build(self) -> MessageViewSender { - MessageViewSender { + pub fn build(self) -> SystemMessageReferredUser { + SystemMessageReferredUser { did: self._fields.0.unwrap(), extra_data: Default::default(), } @@ -3618,15 +11743,15 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> MessageViewSender { - MessageViewSender { + ) -> SystemMessageReferredUser { + SystemMessageReferredUser { did: self._fields.0.unwrap(), extra_data: Some(extra_data), } } } -pub mod reaction_view_state { +pub mod system_message_view_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; #[allow(unused)] @@ -3636,91 +11761,107 @@ pub mod reaction_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; - type Sender; - type Value; + type Id; + type Data; + type SentAt; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; - type Sender = Unset; - type Value = Unset; + type Id = Unset; + type Data = Unset; + type SentAt = Unset; + type Rev = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Sender = St::Sender; - type Value = St::Value; + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData St>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Id = Set; + type Data = St::Data; + type SentAt = St::SentAt; + type Rev = St::Rev; } - ///State transition - sets the `sender` field to Set - pub struct SetSender(PhantomData St>); - impl sealed::Sealed for SetSender {} - impl State for SetSender { - type CreatedAt = St::CreatedAt; - type Sender = Set; - type Value = St::Value; + ///State transition - sets the `data` field to Set + pub struct SetData(PhantomData St>); + impl sealed::Sealed for SetData {} + impl State for SetData { + type Id = St::Id; + type Data = Set; + type SentAt = St::SentAt; + type Rev = St::Rev; } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData St>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type CreatedAt = St::CreatedAt; - type Sender = St::Sender; - type Value = Set; + ///State transition - sets the `sent_at` field to Set + pub struct SetSentAt(PhantomData St>); + impl sealed::Sealed for SetSentAt {} + impl State for SetSentAt { + type Id = St::Id; + type Data = St::Data; + type SentAt = Set; + type Rev = St::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData St>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Id = St::Id; + type Data = St::Data; + type SentAt = St::SentAt; + type Rev = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `sender` field - pub struct sender(()); - ///Marker type for the `value` field - pub struct value(()); + ///Marker type for the `id` field + pub struct id(()); + ///Marker type for the `data` field + pub struct data(()); + ///Marker type for the `sent_at` field + pub struct sent_at(()); + ///Marker type for the `rev` field + pub struct rev(()); } } /// Builder for constructing an instance of this type. -pub struct ReactionViewBuilder { +pub struct SystemMessageViewBuilder { _state: PhantomData St>, - _fields: (Option, Option>, Option), + _fields: (Option>, Option, Option, Option), _type: PhantomData S>, } -impl ReactionView { +impl SystemMessageView { /// Create a new builder for this type. - pub fn new() -> ReactionViewBuilder { - ReactionViewBuilder::new() + pub fn new() -> SystemMessageViewBuilder { + SystemMessageViewBuilder::new() } } -impl ReactionViewBuilder { +impl SystemMessageViewBuilder { /// Create a new builder with all fields unset. pub fn new() -> Self { - ReactionViewBuilder { + SystemMessageViewBuilder { _state: PhantomData, - _fields: (None, None, None), + _fields: (None, None, None, None), _type: PhantomData, } } } -impl ReactionViewBuilder +impl SystemMessageViewBuilder where - St: reaction_view_state::State, - St::CreatedAt: reaction_view_state::IsUnset, + St: system_message_view_state::State, + St::Data: system_message_view_state::IsUnset, { - /// Set the `createdAt` field (required) - pub fn created_at( + /// Set the `data` field (required) + pub fn data( mut self, - value: impl Into, - ) -> ReactionViewBuilder> { + value: impl Into>, + ) -> SystemMessageViewBuilder> { self._fields.0 = Option::Some(value.into()); - ReactionViewBuilder { + SystemMessageViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -3728,18 +11869,18 @@ where } } -impl ReactionViewBuilder +impl SystemMessageViewBuilder where - St: reaction_view_state::State, - St::Sender: reaction_view_state::IsUnset, + St: system_message_view_state::State, + St::Id: system_message_view_state::IsUnset, { - /// Set the `sender` field (required) - pub fn sender( + /// Set the `id` field (required) + pub fn id( mut self, - value: impl Into>, - ) -> ReactionViewBuilder> { + value: impl Into, + ) -> SystemMessageViewBuilder> { self._fields.1 = Option::Some(value.into()); - ReactionViewBuilder { + SystemMessageViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -3747,18 +11888,18 @@ where } } -impl ReactionViewBuilder +impl SystemMessageViewBuilder where - St: reaction_view_state::State, - St::Value: reaction_view_state::IsUnset, + St: system_message_view_state::State, + St::Rev: system_message_view_state::IsUnset, { - /// Set the `value` field (required) - pub fn value( + /// Set the `rev` field (required) + pub fn rev( mut self, value: impl Into, - ) -> ReactionViewBuilder> { + ) -> SystemMessageViewBuilder> { self._fields.2 = Option::Some(value.into()); - ReactionViewBuilder { + SystemMessageViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -3766,105 +11907,18 @@ where } } -impl ReactionViewBuilder -where - St: reaction_view_state::State, - St::CreatedAt: reaction_view_state::IsSet, - St::Sender: reaction_view_state::IsSet, - St::Value: reaction_view_state::IsSet, -{ - /// Build the final struct. - pub fn build(self) -> ReactionView { - ReactionView { - created_at: self._fields.0.unwrap(), - sender: self._fields.1.unwrap(), - value: self._fields.2.unwrap(), - extra_data: Default::default(), - } - } - /// Build the final struct with custom extra_data. - pub fn build_with_data( - self, - extra_data: BTreeMap>, - ) -> ReactionView { - ReactionView { - created_at: self._fields.0.unwrap(), - sender: self._fields.1.unwrap(), - value: self._fields.2.unwrap(), - extra_data: Some(extra_data), - } - } -} - -pub mod reaction_view_sender_state { - - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; - #[allow(unused)] - use ::core::marker::PhantomData; - mod sealed { - pub trait Sealed {} - } - /// State trait tracking which required fields have been set - pub trait State: sealed::Sealed { - type Did; - } - /// Empty state - all required fields are unset - pub struct Empty(()); - impl sealed::Sealed for Empty {} - impl State for Empty { - type Did = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - } - /// Marker types for field names - #[allow(non_camel_case_types)] - pub mod members { - ///Marker type for the `did` field - pub struct did(()); - } -} - -/// Builder for constructing an instance of this type. -pub struct ReactionViewSenderBuilder { - _state: PhantomData St>, - _fields: (Option>,), - _type: PhantomData S>, -} - -impl ReactionViewSender { - /// Create a new builder for this type. - pub fn new() -> ReactionViewSenderBuilder { - ReactionViewSenderBuilder::new() - } -} - -impl ReactionViewSenderBuilder { - /// Create a new builder with all fields unset. - pub fn new() -> Self { - ReactionViewSenderBuilder { - _state: PhantomData, - _fields: (None,), - _type: PhantomData, - } - } -} - -impl ReactionViewSenderBuilder +impl SystemMessageViewBuilder where - St: reaction_view_sender_state::State, - St::Did: reaction_view_sender_state::IsUnset, + St: system_message_view_state::State, + St::SentAt: system_message_view_state::IsUnset, { - /// Set the `did` field (required) - pub fn did( + /// Set the `sentAt` field (required) + pub fn sent_at( mut self, - value: impl Into>, - ) -> ReactionViewSenderBuilder> { - self._fields.0 = Option::Some(value.into()); - ReactionViewSenderBuilder { + value: impl Into, + ) -> SystemMessageViewBuilder> { + self._fields.3 = Option::Some(value.into()); + SystemMessageViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -3872,15 +11926,21 @@ where } } -impl ReactionViewSenderBuilder +impl SystemMessageViewBuilder where - St: reaction_view_sender_state::State, - St::Did: reaction_view_sender_state::IsSet, + St: system_message_view_state::State, + St::Id: system_message_view_state::IsSet, + St::Data: system_message_view_state::IsSet, + St::SentAt: system_message_view_state::IsSet, + St::Rev: system_message_view_state::IsSet, { /// Build the final struct. - pub fn build(self) -> ReactionViewSender { - ReactionViewSender { - did: self._fields.0.unwrap(), + pub fn build(self) -> SystemMessageView { + SystemMessageView { + data: self._fields.0.unwrap(), + id: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + sent_at: self._fields.3.unwrap(), extra_data: Default::default(), } } @@ -3888,9 +11948,12 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> ReactionViewSender { - ReactionViewSender { - did: self._fields.0.unwrap(), + ) -> SystemMessageView { + SystemMessageView { + data: self._fields.0.unwrap(), + id: self._fields.1.unwrap(), + rev: self._fields.2.unwrap(), + sent_at: self._fields.3.unwrap(), extra_data: Some(extra_data), } } diff --git a/services/types/src/chat_bsky/convo/accept_convo.rs b/services/types/src/chat_bsky/convo/accept_convo.rs index d87d247..0e7e227 100644 --- a/services/types/src/chat_bsky/convo/accept_convo.rs +++ b/services/types/src/chat_bsky/convo/accept_convo.rs @@ -13,7 +13,7 @@ use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] @@ -35,13 +35,55 @@ pub struct AcceptConvoOutput { pub extra_data: Option>>, } + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum AcceptConvoError { + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for AcceptConvoError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + /// Response type for chat.bsky.convo.acceptConvo pub struct AcceptConvoResponse; impl jacquard_common::xrpc::XrpcResp for AcceptConvoResponse { const NSID: &'static str = "chat.bsky.convo.acceptConvo"; const ENCODING: &'static str = "application/json"; type Output = AcceptConvoOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = AcceptConvoError; } impl jacquard_common::xrpc::XrpcRequest for AcceptConvo { diff --git a/services/types/src/chat_bsky/convo/add_reaction.rs b/services/types/src/chat_bsky/convo/add_reaction.rs index 903505e..483dba4 100644 --- a/services/types/src/chat_bsky/convo/add_reaction.rs +++ b/services/types/src/chat_bsky/convo/add_reaction.rs @@ -50,6 +50,11 @@ pub struct AddReactionOutput { #[serde(tag = "error", content = "message")] pub enum AddReactionError { + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + /// Indicates that reactions are not allowed on this message, e.g. because it is a system message. + #[serde(rename = "ReactionNotAllowed")] + ReactionNotAllowed(Option), /// Indicates that the message has been deleted and reactions can no longer be added/removed. #[serde(rename = "ReactionMessageDeleted")] ReactionMessageDeleted(Option), @@ -67,6 +72,20 @@ pub enum AddReactionError { impl core::fmt::Display for AddReactionError { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ReactionNotAllowed(msg) => { + write!(f, "ReactionNotAllowed")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } Self::ReactionMessageDeleted(msg) => { write!(f, "ReactionMessageDeleted")?; if let Some(msg) = msg { diff --git a/services/types/src/chat_bsky/convo/delete_message_for_self.rs b/services/types/src/chat_bsky/convo/delete_message_for_self.rs index a745275..0c6540d 100644 --- a/services/types/src/chat_bsky/convo/delete_message_for_self.rs +++ b/services/types/src/chat_bsky/convo/delete_message_for_self.rs @@ -13,7 +13,7 @@ use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; use crate::chat_bsky::convo::DeletedMessageView; @@ -36,13 +36,65 @@ pub struct DeleteMessageForSelfOutput { pub extra_data: Option>>, } + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum DeleteMessageForSelfError { + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + /// Indicates that this message cannot be deleted, e.g. because it is a system message. + #[serde(rename = "MessageDeleteNotAllowed")] + MessageDeleteNotAllowed(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for DeleteMessageForSelfError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::MessageDeleteNotAllowed(msg) => { + write!(f, "MessageDeleteNotAllowed")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + /// Response type for chat.bsky.convo.deleteMessageForSelf pub struct DeleteMessageForSelfResponse; impl jacquard_common::xrpc::XrpcResp for DeleteMessageForSelfResponse { const NSID: &'static str = "chat.bsky.convo.deleteMessageForSelf"; const ENCODING: &'static str = "application/json"; type Output = DeleteMessageForSelfOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = DeleteMessageForSelfError; } impl jacquard_common::xrpc::XrpcRequest for DeleteMessageForSelf { diff --git a/services/types/src/chat_bsky/convo/get_convo.rs b/services/types/src/chat_bsky/convo/get_convo.rs index 2dc189e..efd419d 100644 --- a/services/types/src/chat_bsky/convo/get_convo.rs +++ b/services/types/src/chat_bsky/convo/get_convo.rs @@ -13,7 +13,7 @@ use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; use crate::chat_bsky::convo::ConvoView; @@ -32,13 +32,55 @@ pub struct GetConvoOutput { pub extra_data: Option>>, } + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum GetConvoError { + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for GetConvoError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + /// Response type for chat.bsky.convo.getConvo pub struct GetConvoResponse; impl jacquard_common::xrpc::XrpcResp for GetConvoResponse { const NSID: &'static str = "chat.bsky.convo.getConvo"; const ENCODING: &'static str = "application/json"; type Output = GetConvoOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = GetConvoError; } impl jacquard_common::xrpc::XrpcRequest for GetConvo { diff --git a/services/types/src/chat_bsky/convo/get_convo_for_members.rs b/services/types/src/chat_bsky/convo/get_convo_for_members.rs index 136acf7..92a93ce 100644 --- a/services/types/src/chat_bsky/convo/get_convo_for_members.rs +++ b/services/types/src/chat_bsky/convo/get_convo_for_members.rs @@ -10,11 +10,11 @@ use alloc::collections::BTreeMap; #[allow(unused_imports)] use core::marker::PhantomData; -use jacquard_common::{BosStr, DefaultStr, FromStaticStr}; +use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::string::Did; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; use crate::chat_bsky::convo::ConvoView; @@ -33,13 +33,100 @@ pub struct GetConvoForMembersOutput { pub extra_data: Option>>, } + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum GetConvoForMembersError { + #[serde(rename = "AccountSuspended")] + AccountSuspended(Option), + #[serde(rename = "BlockedActor")] + BlockedActor(Option), + #[serde(rename = "BlockedSubject")] + BlockedSubject(Option), + #[serde(rename = "MessagesDisabled")] + MessagesDisabled(Option), + #[serde(rename = "NotFollowedBySender")] + NotFollowedBySender(Option), + #[serde(rename = "RecipientNotFound")] + RecipientNotFound(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for GetConvoForMembersError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::AccountSuspended(msg) => { + write!(f, "AccountSuspended")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::BlockedActor(msg) => { + write!(f, "BlockedActor")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::BlockedSubject(msg) => { + write!(f, "BlockedSubject")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::MessagesDisabled(msg) => { + write!(f, "MessagesDisabled")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::NotFollowedBySender(msg) => { + write!(f, "NotFollowedBySender")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::RecipientNotFound(msg) => { + write!(f, "RecipientNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + /// Response type for chat.bsky.convo.getConvoForMembers pub struct GetConvoForMembersResponse; impl jacquard_common::xrpc::XrpcResp for GetConvoForMembersResponse { const NSID: &'static str = "chat.bsky.convo.getConvoForMembers"; const ENCODING: &'static str = "application/json"; type Output = GetConvoForMembersOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = GetConvoForMembersError; } impl jacquard_common::xrpc::XrpcRequest for GetConvoForMembers { diff --git a/services/types/src/chat_bsky/convo/get_log.rs b/services/types/src/chat_bsky/convo/get_log.rs index 52872bb..f9474d2 100644 --- a/services/types/src/chat_bsky/convo/get_log.rs +++ b/services/types/src/chat_bsky/convo/get_log.rs @@ -16,15 +16,35 @@ use jacquard_common::types::value::Data; use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; use crate::chat_bsky::convo::LogAcceptConvo; +use crate::chat_bsky::convo::LogAddMember; use crate::chat_bsky::convo::LogAddReaction; +use crate::chat_bsky::convo::LogApproveJoinRequest; use crate::chat_bsky::convo::LogBeginConvo; +use crate::chat_bsky::convo::LogCreateJoinLink; use crate::chat_bsky::convo::LogCreateMessage; use crate::chat_bsky::convo::LogDeleteMessage; +use crate::chat_bsky::convo::LogDisableJoinLink; +use crate::chat_bsky::convo::LogEditGroup; +use crate::chat_bsky::convo::LogEditJoinLink; +use crate::chat_bsky::convo::LogEnableJoinLink; +use crate::chat_bsky::convo::LogIncomingJoinRequest; use crate::chat_bsky::convo::LogLeaveConvo; +use crate::chat_bsky::convo::LogLockConvo; +use crate::chat_bsky::convo::LogLockConvoPermanently; +use crate::chat_bsky::convo::LogMemberJoin; +use crate::chat_bsky::convo::LogMemberLeave; use crate::chat_bsky::convo::LogMuteConvo; +use crate::chat_bsky::convo::LogOutgoingJoinRequest; +use crate::chat_bsky::convo::LogReadConvo; +use crate::chat_bsky::convo::LogReadJoinRequests; use crate::chat_bsky::convo::LogReadMessage; +use crate::chat_bsky::convo::LogRejectJoinRequest; +use crate::chat_bsky::convo::LogRemoveMember; use crate::chat_bsky::convo::LogRemoveReaction; +use crate::chat_bsky::convo::LogUnlockConvo; use crate::chat_bsky::convo::LogUnmuteConvo; +use crate::chat_bsky::convo::LogWithdrawIncomingJoinRequest; +use crate::chat_bsky::convo::LogWithdrawOutgoingJoinRequest; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -69,6 +89,46 @@ pub enum GetLogOutputLogsItem { LogAddReaction(Box>), #[serde(rename = "chat.bsky.convo.defs#logRemoveReaction")] LogRemoveReaction(Box>), + #[serde(rename = "chat.bsky.convo.defs#logReadConvo")] + LogReadConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#logAddMember")] + LogAddMember(Box>), + #[serde(rename = "chat.bsky.convo.defs#logRemoveMember")] + LogRemoveMember(Box>), + #[serde(rename = "chat.bsky.convo.defs#logMemberJoin")] + LogMemberJoin(Box>), + #[serde(rename = "chat.bsky.convo.defs#logMemberLeave")] + LogMemberLeave(Box>), + #[serde(rename = "chat.bsky.convo.defs#logLockConvo")] + LogLockConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#logUnlockConvo")] + LogUnlockConvo(Box>), + #[serde(rename = "chat.bsky.convo.defs#logLockConvoPermanently")] + LogLockConvoPermanently(Box>), + #[serde(rename = "chat.bsky.convo.defs#logEditGroup")] + LogEditGroup(Box>), + #[serde(rename = "chat.bsky.convo.defs#logCreateJoinLink")] + LogCreateJoinLink(Box>), + #[serde(rename = "chat.bsky.convo.defs#logEditJoinLink")] + LogEditJoinLink(Box>), + #[serde(rename = "chat.bsky.convo.defs#logEnableJoinLink")] + LogEnableJoinLink(Box>), + #[serde(rename = "chat.bsky.convo.defs#logDisableJoinLink")] + LogDisableJoinLink(Box>), + #[serde(rename = "chat.bsky.convo.defs#logIncomingJoinRequest")] + LogIncomingJoinRequest(Box>), + #[serde(rename = "chat.bsky.convo.defs#logApproveJoinRequest")] + LogApproveJoinRequest(Box>), + #[serde(rename = "chat.bsky.convo.defs#logRejectJoinRequest")] + LogRejectJoinRequest(Box>), + #[serde(rename = "chat.bsky.convo.defs#logOutgoingJoinRequest")] + LogOutgoingJoinRequest(Box>), + #[serde(rename = "chat.bsky.convo.defs#logWithdrawIncomingJoinRequest")] + LogWithdrawIncomingJoinRequest(Box>), + #[serde(rename = "chat.bsky.convo.defs#logWithdrawOutgoingJoinRequest")] + LogWithdrawOutgoingJoinRequest(Box>), + #[serde(rename = "chat.bsky.convo.defs#logReadJoinRequests")] + LogReadJoinRequests(Box>), } /// Response type for chat.bsky.convo.getLog diff --git a/services/types/src/chat_bsky/convo/get_messages.rs b/services/types/src/chat_bsky/convo/get_messages.rs index 8c5515a..1af8d96 100644 --- a/services/types/src/chat_bsky/convo/get_messages.rs +++ b/services/types/src/chat_bsky/convo/get_messages.rs @@ -15,8 +15,10 @@ use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; +use crate::chat_bsky::actor::ProfileViewBasic; use crate::chat_bsky::convo::DeletedMessageView; use crate::chat_bsky::convo::MessageView; +use crate::chat_bsky::convo::SystemMessageView; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -37,6 +39,9 @@ pub struct GetMessagesOutput { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, pub messages: Vec>, + ///Set of all members who authored or reacted to the returned messages. Members referred to by system messages are also included. + #[serde(skip_serializing_if = "Option::is_none")] + pub related_profiles: Option>>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } @@ -50,6 +55,50 @@ pub enum GetMessagesOutputMessagesItem { MessageView(Box>), #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] DeletedMessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageView")] + SystemMessageView(Box>), +} + + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum GetMessagesError { + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for GetMessagesError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } } /// Response type for chat.bsky.convo.getMessages @@ -58,7 +107,7 @@ impl jacquard_common::xrpc::XrpcResp for GetMessagesResponse { const NSID: &'static str = "chat.bsky.convo.getMessages"; const ENCODING: &'static str = "application/json"; type Output = GetMessagesOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = GetMessagesError; } impl jacquard_common::xrpc::XrpcRequest for GetMessages { diff --git a/services/types/src/chat_bsky/convo/leave_convo.rs b/services/types/src/chat_bsky/convo/leave_convo.rs index 8d451e8..4e73eaa 100644 --- a/services/types/src/chat_bsky/convo/leave_convo.rs +++ b/services/types/src/chat_bsky/convo/leave_convo.rs @@ -13,7 +13,7 @@ use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] @@ -34,13 +34,65 @@ pub struct LeaveConvoOutput { pub extra_data: Option>>, } + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum LeaveConvoError { + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + /// The owner of a group conversation cannot leave before locking the group. + #[serde(rename = "OwnerCannotLeave")] + OwnerCannotLeave(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for LeaveConvoError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::OwnerCannotLeave(msg) => { + write!(f, "OwnerCannotLeave")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + /// Response type for chat.bsky.convo.leaveConvo pub struct LeaveConvoResponse; impl jacquard_common::xrpc::XrpcResp for LeaveConvoResponse { const NSID: &'static str = "chat.bsky.convo.leaveConvo"; const ENCODING: &'static str = "application/json"; type Output = LeaveConvoOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = LeaveConvoError; } impl jacquard_common::xrpc::XrpcRequest for LeaveConvo { diff --git a/services/types/src/chat_bsky/convo/list_convos.rs b/services/types/src/chat_bsky/convo/list_convos.rs index 5439fae..82d6529 100644 --- a/services/types/src/chat_bsky/convo/list_convos.rs +++ b/services/types/src/chat_bsky/convo/list_convos.rs @@ -22,11 +22,15 @@ use crate::chat_bsky::convo::ConvoView; pub struct ListConvos { #[serde(skip_serializing_if = "Option::is_none")] pub cursor: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option, ///Defaults to `50`. Min: 1. Max: 100. #[serde(default = "_default_limit")] #[serde(skip_serializing_if = "Option::is_none")] pub limit: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub lock_status: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub read_state: Option, #[serde(skip_serializing_if = "Option::is_none")] pub status: Option, @@ -93,7 +97,7 @@ pub mod list_convos_state { /// Builder for constructing an instance of this type. pub struct ListConvosBuilder { _state: PhantomData St>, - _fields: (Option, Option, Option, Option), + _fields: (Option, Option, Option, Option, Option, Option), _type: PhantomData S>, } @@ -109,7 +113,7 @@ impl ListConvosBuilder { pub fn new() -> Self { ListConvosBuilder { _state: PhantomData, - _fields: (None, None, None, None), + _fields: (None, None, None, None, None, None), _type: PhantomData, } } @@ -128,15 +132,41 @@ impl ListConvosBuilder { } } +impl ListConvosBuilder { + /// Set the `kind` field (optional) + pub fn kind(mut self, value: impl Into>) -> Self { + self._fields.1 = value.into(); + self + } + /// Set the `kind` field to an Option value (optional) + pub fn maybe_kind(mut self, value: Option) -> Self { + self._fields.1 = value; + self + } +} + impl ListConvosBuilder { /// Set the `limit` field (optional) pub fn limit(mut self, value: impl Into>) -> Self { - self._fields.1 = value.into(); + self._fields.2 = value.into(); self } /// Set the `limit` field to an Option value (optional) pub fn maybe_limit(mut self, value: Option) -> Self { - self._fields.1 = value; + self._fields.2 = value; + self + } +} + +impl ListConvosBuilder { + /// Set the `lockStatus` field (optional) + pub fn lock_status(mut self, value: impl Into>) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `lockStatus` field to an Option value (optional) + pub fn maybe_lock_status(mut self, value: Option) -> Self { + self._fields.3 = value; self } } @@ -144,12 +174,12 @@ impl ListConvosBuilder { impl ListConvosBuilder { /// Set the `readState` field (optional) pub fn read_state(mut self, value: impl Into>) -> Self { - self._fields.2 = value.into(); + self._fields.4 = value.into(); self } /// Set the `readState` field to an Option value (optional) pub fn maybe_read_state(mut self, value: Option) -> Self { - self._fields.2 = value; + self._fields.4 = value; self } } @@ -157,12 +187,12 @@ impl ListConvosBuilder { impl ListConvosBuilder { /// Set the `status` field (optional) pub fn status(mut self, value: impl Into>) -> Self { - self._fields.3 = value.into(); + self._fields.5 = value.into(); self } /// Set the `status` field to an Option value (optional) pub fn maybe_status(mut self, value: Option) -> Self { - self._fields.3 = value; + self._fields.5 = value; self } } @@ -175,9 +205,11 @@ where pub fn build(self) -> ListConvos { ListConvos { cursor: self._fields.0, - limit: self._fields.1, - read_state: self._fields.2, - status: self._fields.3, + kind: self._fields.1, + limit: self._fields.2, + lock_status: self._fields.3, + read_state: self._fields.4, + status: self._fields.5, } } } \ No newline at end of file diff --git a/services/types/src/chat_bsky/convo/mute_convo.rs b/services/types/src/chat_bsky/convo/mute_convo.rs index d1a5ee8..a7f44fc 100644 --- a/services/types/src/chat_bsky/convo/mute_convo.rs +++ b/services/types/src/chat_bsky/convo/mute_convo.rs @@ -13,7 +13,7 @@ use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; use crate::chat_bsky::convo::ConvoView; @@ -34,13 +34,55 @@ pub struct MuteConvoOutput { pub extra_data: Option>>, } + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum MuteConvoError { + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for MuteConvoError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + /// Response type for chat.bsky.convo.muteConvo pub struct MuteConvoResponse; impl jacquard_common::xrpc::XrpcResp for MuteConvoResponse { const NSID: &'static str = "chat.bsky.convo.muteConvo"; const ENCODING: &'static str = "application/json"; type Output = MuteConvoOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = MuteConvoError; } impl jacquard_common::xrpc::XrpcRequest for MuteConvo { diff --git a/services/types/src/chat_bsky/convo/remove_reaction.rs b/services/types/src/chat_bsky/convo/remove_reaction.rs index 84ce10a..defd687 100644 --- a/services/types/src/chat_bsky/convo/remove_reaction.rs +++ b/services/types/src/chat_bsky/convo/remove_reaction.rs @@ -50,6 +50,11 @@ pub struct RemoveReactionOutput { #[serde(tag = "error", content = "message")] pub enum RemoveReactionError { + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + /// Indicates that reactions are not allowed on this message, e.g. because it is a system message. + #[serde(rename = "ReactionNotAllowed")] + ReactionNotAllowed(Option), /// Indicates that the message has been deleted and reactions can no longer be added/removed. #[serde(rename = "ReactionMessageDeleted")] ReactionMessageDeleted(Option), @@ -64,6 +69,20 @@ pub enum RemoveReactionError { impl core::fmt::Display for RemoveReactionError { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { match self { + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ReactionNotAllowed(msg) => { + write!(f, "ReactionNotAllowed")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } Self::ReactionMessageDeleted(msg) => { write!(f, "ReactionMessageDeleted")?; if let Some(msg) = msg { diff --git a/services/types/src/chat_bsky/convo/send_message.rs b/services/types/src/chat_bsky/convo/send_message.rs index 4ca0303..7cf9602 100644 --- a/services/types/src/chat_bsky/convo/send_message.rs +++ b/services/types/src/chat_bsky/convo/send_message.rs @@ -13,7 +13,7 @@ use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; use crate::chat_bsky::convo::MessageInput; use crate::chat_bsky::convo::MessageView; @@ -37,13 +37,73 @@ pub struct SendMessageOutput { pub extra_data: Option>>, } + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum SendMessageError { + #[serde(rename = "ConvoLocked")] + ConvoLocked(Option), + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + #[serde(rename = "ReplyTargetNotFound")] + ReplyTargetNotFound(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for SendMessageError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::ConvoLocked(msg) => { + write!(f, "ConvoLocked")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ReplyTargetNotFound(msg) => { + write!(f, "ReplyTargetNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + /// Response type for chat.bsky.convo.sendMessage pub struct SendMessageResponse; impl jacquard_common::xrpc::XrpcResp for SendMessageResponse { const NSID: &'static str = "chat.bsky.convo.sendMessage"; const ENCODING: &'static str = "application/json"; type Output = SendMessageOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = SendMessageError; } impl jacquard_common::xrpc::XrpcRequest for SendMessage { diff --git a/services/types/src/chat_bsky/convo/send_message_batch.rs b/services/types/src/chat_bsky/convo/send_message_batch.rs index f85ec87..1ee0fcb 100644 --- a/services/types/src/chat_bsky/convo/send_message_batch.rs +++ b/services/types/src/chat_bsky/convo/send_message_batch.rs @@ -16,7 +16,7 @@ use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use jacquard_lexicon::lexicon::LexiconDoc; use jacquard_lexicon::schema::LexiconSchema; @@ -54,6 +54,66 @@ pub struct SendMessageBatchOutput { pub extra_data: Option>>, } + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum SendMessageBatchError { + #[serde(rename = "ConvoLocked")] + ConvoLocked(Option), + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + #[serde(rename = "ReplyTargetNotFound")] + ReplyTargetNotFound(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for SendMessageBatchError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::ConvoLocked(msg) => { + write!(f, "ConvoLocked")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ReplyTargetNotFound(msg) => { + write!(f, "ReplyTargetNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + impl LexiconSchema for BatchItem { fn nsid() -> &'static str { "chat.bsky.convo.sendMessageBatch" @@ -75,7 +135,7 @@ impl jacquard_common::xrpc::XrpcResp for SendMessageBatchResponse { const NSID: &'static str = "chat.bsky.convo.sendMessageBatch"; const ENCODING: &'static str = "application/json"; type Output = SendMessageBatchOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = SendMessageBatchError; } impl jacquard_common::xrpc::XrpcRequest for SendMessageBatch { diff --git a/services/types/src/chat_bsky/convo/unmute_convo.rs b/services/types/src/chat_bsky/convo/unmute_convo.rs index 250a702..eedca5d 100644 --- a/services/types/src/chat_bsky/convo/unmute_convo.rs +++ b/services/types/src/chat_bsky/convo/unmute_convo.rs @@ -13,7 +13,7 @@ use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; use crate::chat_bsky::convo::ConvoView; @@ -34,13 +34,55 @@ pub struct UnmuteConvoOutput { pub extra_data: Option>>, } + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum UnmuteConvoError { + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for UnmuteConvoError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + /// Response type for chat.bsky.convo.unmuteConvo pub struct UnmuteConvoResponse; impl jacquard_common::xrpc::XrpcResp for UnmuteConvoResponse { const NSID: &'static str = "chat.bsky.convo.unmuteConvo"; const ENCODING: &'static str = "application/json"; type Output = UnmuteConvoOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = UnmuteConvoError; } impl jacquard_common::xrpc::XrpcRequest for UnmuteConvo { diff --git a/services/types/src/chat_bsky/convo/update_read.rs b/services/types/src/chat_bsky/convo/update_read.rs index 7310d67..b6eb738 100644 --- a/services/types/src/chat_bsky/convo/update_read.rs +++ b/services/types/src/chat_bsky/convo/update_read.rs @@ -13,7 +13,7 @@ use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; use crate::chat_bsky::convo::ConvoView; @@ -36,13 +36,55 @@ pub struct UpdateReadOutput { pub extra_data: Option>>, } + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum UpdateReadError { + #[serde(rename = "InvalidConvo")] + InvalidConvo(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for UpdateReadError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::InvalidConvo(msg) => { + write!(f, "InvalidConvo")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + /// Response type for chat.bsky.convo.updateRead pub struct UpdateReadResponse; impl jacquard_common::xrpc::XrpcResp for UpdateReadResponse { const NSID: &'static str = "chat.bsky.convo.updateRead"; const ENCODING: &'static str = "application/json"; type Output = UpdateReadOutput; - type Err = jacquard_common::xrpc::GenericError; + type Err = UpdateReadError; } impl jacquard_common::xrpc::XrpcRequest for UpdateRead { diff --git a/services/types/src/chat_bsky/moderation.rs b/services/types/src/chat_bsky/moderation.rs index 6b847c8..f37c25d 100644 --- a/services/types/src/chat_bsky/moderation.rs +++ b/services/types/src/chat_bsky/moderation.rs @@ -1,8 +1,634 @@ // @generated by jacquard-lexicon. DO NOT EDIT. // +// Lexicon: chat.bsky.moderation.defs +// // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. pub mod get_actor_metadata; +pub mod get_convo; +pub mod get_convo_members; +pub mod get_convos; pub mod get_message_context; -pub mod update_actor_access; \ No newline at end of file + + +#[cfg(feature = "streaming")] +pub mod subscribe_mod_events; +pub mod update_actor_access; + + +#[allow(unused_imports)] +use alloc::collections::BTreeMap; + +#[allow(unused_imports)] +use core::marker::PhantomData; +use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; + +#[allow(unused_imports)] +use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation; +use jacquard_common::deps::smol_str::SmolStr; +use jacquard_common::types::string::Datetime; +use jacquard_common::types::value::Data; +use jacquard_derive::{IntoStatic, open_union}; +use jacquard_lexicon::lexicon::LexiconDoc; +use jacquard_lexicon::schema::LexiconSchema; + +#[allow(unused_imports)] +use jacquard_lexicon::validation::{ConstraintError, ValidationPath}; +use serde::{Serialize, Deserialize}; +use crate::chat_bsky::convo::ConvoLockStatus; +use crate::chat_bsky::group::JoinLinkView; +use crate::chat_bsky::moderation; +/// A view of a conversation for moderation purposes. Unlike chat.bsky.convo.defs#convoView, it does not include viewer-specific data (such as muted, unreadCount, status, lastMessage, lastReaction), since the requester is a moderator and not a member of the conversation. The member list is not included; use chat.bsky.moderation.getConvoMembers to list members. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ConvoView { + pub id: S, + ///Union field that has data specific to different kinds of convos. + #[serde(skip_serializing_if = "Option::is_none")] + pub kind: Option>, + pub rev: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[open_union] +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(tag = "$type", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub enum ConvoViewKind { + #[serde(rename = "chat.bsky.moderation.defs#directConvo")] + DirectConvo(Box>), + #[serde(rename = "chat.bsky.moderation.defs#groupConvo")] + GroupConvo(Box>), +} + +/// Data specific to a direct conversation, for moderation purposes. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct DirectConvo { + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Data specific to a group conversation, for moderation purposes. Unlike chat.bsky.convo.defs#groupConvo, it does not include viewer-specific data (such as unreadJoinRequestCount), since the requester is a moderator and not a member of the conversation. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct GroupConvo { + pub created_at: Datetime, + #[serde(skip_serializing_if = "Option::is_none")] + pub join_link: Option>, + ///The total number of pending join requests for the group conversation. This information is only visible to the owner and to moderators. Capped at 21. + pub join_request_count: i64, + ///The lock status of the conversation. + pub lock_status: ConvoLockStatus, + ///The total number of members in the group conversation. + pub member_count: i64, + ///The maximum number of members allowed in the group conversation. + pub member_limit: i64, + ///The display name of the group conversation. + pub name: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +impl LexiconSchema for ConvoView { + fn nsid() -> &'static str { + "chat.bsky.moderation.defs" + } + fn def_name() -> &'static str { + "convoView" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_moderation_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for DirectConvo { + fn nsid() -> &'static str { + "chat.bsky.moderation.defs" + } + fn def_name() -> &'static str { + "directConvo" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_moderation_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for GroupConvo { + fn nsid() -> &'static str { + "chat.bsky.moderation.defs" + } + fn def_name() -> &'static str { + "groupConvo" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_chat_bsky_moderation_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + { + let value = &self.name; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 500usize { + return Err(ConstraintError::MaxLength { + path: ValidationPath::from_field("name"), + max: 500usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.name; + { + let count = UnicodeSegmentation::graphemes(value.as_ref(), true).count(); + if count > 50usize { + return Err(ConstraintError::MaxGraphemes { + path: ValidationPath::from_field("name"), + max: 50usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +fn lexicon_doc_chat_bsky_moderation_defs() -> LexiconDoc<'static> { + #[allow(unused_imports)] + use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType}; + use jacquard_lexicon::lexicon::*; + use alloc::collections::BTreeMap; + LexiconDoc { + lexicon: Lexicon::Lexicon1, + id: CowStr::new_static("chat.bsky.moderation.defs"), + defs: { + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoView"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "A view of a conversation for moderation purposes. Unlike chat.bsky.convo.defs#convoView, it does not include viewer-specific data (such as muted, unreadCount, status, lastMessage, lastReaction), since the requester is a moderator and not a member of the conversation. The member list is not included; use chat.bsky.moderation.getConvoMembers to list members.", + ), + ), + required: Some( + vec![SmolStr::new_static("id"), SmolStr::new_static("rev")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("id"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("kind"), + LexObjectProperty::Union(LexRefUnion { + description: Some( + CowStr::new_static( + "Union field that has data specific to different kinds of convos.", + ), + ), + refs: vec![ + CowStr::new_static("#directConvo"), + CowStr::new_static("#groupConvo") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("rev"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("directConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Data specific to a direct conversation, for moderation purposes.", + ), + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("groupConvo"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Data specific to a group conversation, for moderation purposes. Unlike chat.bsky.convo.defs#groupConvo, it does not include viewer-specific data (such as unreadJoinRequestCount), since the requester is a moderator and not a member of the conversation.", + ), + ), + required: Some( + vec![ + SmolStr::new_static("createdAt"), + SmolStr::new_static("joinRequestCount"), + SmolStr::new_static("lockStatus"), + SmolStr::new_static("memberCount"), + SmolStr::new_static("memberLimit"), + SmolStr::new_static("name") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("createdAt"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("joinLink"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.group.defs#joinLinkView", + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("joinRequestCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("lockStatus"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "chat.bsky.convo.defs#convoLockStatus", + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("memberCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("memberLimit"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("name"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "The display name of the group conversation.", + ), + ), + max_length: Some(500usize), + max_graphemes: Some(50usize), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map + }, + ..Default::default() + } +} + +pub mod group_convo_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type JoinRequestCount; + type MemberLimit; + type MemberCount; + type Name; + type CreatedAt; + type LockStatus; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type JoinRequestCount = Unset; + type MemberLimit = Unset; + type MemberCount = Unset; + type Name = Unset; + type CreatedAt = Unset; + type LockStatus = Unset; + } + ///State transition - sets the `join_request_count` field to Set + pub struct SetJoinRequestCount(PhantomData St>); + impl sealed::Sealed for SetJoinRequestCount {} + impl State for SetJoinRequestCount { + type JoinRequestCount = Set; + type MemberLimit = St::MemberLimit; + type MemberCount = St::MemberCount; + type Name = St::Name; + type CreatedAt = St::CreatedAt; + type LockStatus = St::LockStatus; + } + ///State transition - sets the `member_limit` field to Set + pub struct SetMemberLimit(PhantomData St>); + impl sealed::Sealed for SetMemberLimit {} + impl State for SetMemberLimit { + type JoinRequestCount = St::JoinRequestCount; + type MemberLimit = Set; + type MemberCount = St::MemberCount; + type Name = St::Name; + type CreatedAt = St::CreatedAt; + type LockStatus = St::LockStatus; + } + ///State transition - sets the `member_count` field to Set + pub struct SetMemberCount(PhantomData St>); + impl sealed::Sealed for SetMemberCount {} + impl State for SetMemberCount { + type JoinRequestCount = St::JoinRequestCount; + type MemberLimit = St::MemberLimit; + type MemberCount = Set; + type Name = St::Name; + type CreatedAt = St::CreatedAt; + type LockStatus = St::LockStatus; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData St>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type JoinRequestCount = St::JoinRequestCount; + type MemberLimit = St::MemberLimit; + type MemberCount = St::MemberCount; + type Name = Set; + type CreatedAt = St::CreatedAt; + type LockStatus = St::LockStatus; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type JoinRequestCount = St::JoinRequestCount; + type MemberLimit = St::MemberLimit; + type MemberCount = St::MemberCount; + type Name = St::Name; + type CreatedAt = Set; + type LockStatus = St::LockStatus; + } + ///State transition - sets the `lock_status` field to Set + pub struct SetLockStatus(PhantomData St>); + impl sealed::Sealed for SetLockStatus {} + impl State for SetLockStatus { + type JoinRequestCount = St::JoinRequestCount; + type MemberLimit = St::MemberLimit; + type MemberCount = St::MemberCount; + type Name = St::Name; + type CreatedAt = St::CreatedAt; + type LockStatus = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `join_request_count` field + pub struct join_request_count(()); + ///Marker type for the `member_limit` field + pub struct member_limit(()); + ///Marker type for the `member_count` field + pub struct member_count(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `lock_status` field + pub struct lock_status(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct GroupConvoBuilder { + _state: PhantomData St>, + _fields: ( + Option, + Option>, + Option, + Option>, + Option, + Option, + Option, + ), + _type: PhantomData S>, +} + +impl GroupConvo { + /// Create a new builder for this type. + pub fn new() -> GroupConvoBuilder { + GroupConvoBuilder::new() + } +} + +impl GroupConvoBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + GroupConvoBuilder { + _state: PhantomData, + _fields: (None, None, None, None, None, None, None), + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::CreatedAt: group_convo_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> GroupConvoBuilder> { + self._fields.0 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder { + /// Set the `joinLink` field (optional) + pub fn join_link(mut self, value: impl Into>>) -> Self { + self._fields.1 = value.into(); + self + } + /// Set the `joinLink` field to an Option value (optional) + pub fn maybe_join_link(mut self, value: Option>) -> Self { + self._fields.1 = value; + self + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::JoinRequestCount: group_convo_state::IsUnset, +{ + /// Set the `joinRequestCount` field (required) + pub fn join_request_count( + mut self, + value: impl Into, + ) -> GroupConvoBuilder> { + self._fields.2 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::LockStatus: group_convo_state::IsUnset, +{ + /// Set the `lockStatus` field (required) + pub fn lock_status( + mut self, + value: impl Into>, + ) -> GroupConvoBuilder> { + self._fields.3 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::MemberCount: group_convo_state::IsUnset, +{ + /// Set the `memberCount` field (required) + pub fn member_count( + mut self, + value: impl Into, + ) -> GroupConvoBuilder> { + self._fields.4 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::MemberLimit: group_convo_state::IsUnset, +{ + /// Set the `memberLimit` field (required) + pub fn member_limit( + mut self, + value: impl Into, + ) -> GroupConvoBuilder> { + self._fields.5 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::Name: group_convo_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into, + ) -> GroupConvoBuilder> { + self._fields.6 = Option::Some(value.into()); + GroupConvoBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl GroupConvoBuilder +where + St: group_convo_state::State, + St::JoinRequestCount: group_convo_state::IsSet, + St::MemberLimit: group_convo_state::IsSet, + St::MemberCount: group_convo_state::IsSet, + St::Name: group_convo_state::IsSet, + St::CreatedAt: group_convo_state::IsSet, + St::LockStatus: group_convo_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> GroupConvo { + GroupConvo { + created_at: self._fields.0.unwrap(), + join_link: self._fields.1, + join_request_count: self._fields.2.unwrap(), + lock_status: self._fields.3.unwrap(), + member_count: self._fields.4.unwrap(), + member_limit: self._fields.5.unwrap(), + name: self._fields.6.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> GroupConvo { + GroupConvo { + created_at: self._fields.0.unwrap(), + join_link: self._fields.1, + join_request_count: self._fields.2.unwrap(), + lock_status: self._fields.3.unwrap(), + member_count: self._fields.4.unwrap(), + member_limit: self._fields.5.unwrap(), + name: self._fields.6.unwrap(), + extra_data: Some(extra_data), + } + } +} \ No newline at end of file diff --git a/services/types/src/chat_bsky/moderation/get_actor_metadata.rs b/services/types/src/chat_bsky/moderation/get_actor_metadata.rs index acd7d27..e688101 100644 --- a/services/types/src/chat_bsky/moderation/get_actor_metadata.rs +++ b/services/types/src/chat_bsky/moderation/get_actor_metadata.rs @@ -193,67 +193,67 @@ pub mod metadata_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Convos; - type ConvosStarted; type MessagesReceived; type MessagesSent; + type Convos; + type ConvosStarted; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Convos = Unset; - type ConvosStarted = Unset; type MessagesReceived = Unset; type MessagesSent = Unset; - } - ///State transition - sets the `convos` field to Set - pub struct SetConvos(PhantomData St>); - impl sealed::Sealed for SetConvos {} - impl State for SetConvos { - type Convos = Set; - type ConvosStarted = St::ConvosStarted; - type MessagesReceived = St::MessagesReceived; - type MessagesSent = St::MessagesSent; - } - ///State transition - sets the `convos_started` field to Set - pub struct SetConvosStarted(PhantomData St>); - impl sealed::Sealed for SetConvosStarted {} - impl State for SetConvosStarted { - type Convos = St::Convos; - type ConvosStarted = Set; - type MessagesReceived = St::MessagesReceived; - type MessagesSent = St::MessagesSent; + type Convos = Unset; + type ConvosStarted = Unset; } ///State transition - sets the `messages_received` field to Set pub struct SetMessagesReceived(PhantomData St>); impl sealed::Sealed for SetMessagesReceived {} impl State for SetMessagesReceived { - type Convos = St::Convos; - type ConvosStarted = St::ConvosStarted; type MessagesReceived = Set; type MessagesSent = St::MessagesSent; + type Convos = St::Convos; + type ConvosStarted = St::ConvosStarted; } ///State transition - sets the `messages_sent` field to Set pub struct SetMessagesSent(PhantomData St>); impl sealed::Sealed for SetMessagesSent {} impl State for SetMessagesSent { + type MessagesReceived = St::MessagesReceived; + type MessagesSent = Set; type Convos = St::Convos; type ConvosStarted = St::ConvosStarted; + } + ///State transition - sets the `convos` field to Set + pub struct SetConvos(PhantomData St>); + impl sealed::Sealed for SetConvos {} + impl State for SetConvos { type MessagesReceived = St::MessagesReceived; - type MessagesSent = Set; + type MessagesSent = St::MessagesSent; + type Convos = Set; + type ConvosStarted = St::ConvosStarted; + } + ///State transition - sets the `convos_started` field to Set + pub struct SetConvosStarted(PhantomData St>); + impl sealed::Sealed for SetConvosStarted {} + impl State for SetConvosStarted { + type MessagesReceived = St::MessagesReceived; + type MessagesSent = St::MessagesSent; + type Convos = St::Convos; + type ConvosStarted = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `convos` field - pub struct convos(()); - ///Marker type for the `convos_started` field - pub struct convos_started(()); ///Marker type for the `messages_received` field pub struct messages_received(()); ///Marker type for the `messages_sent` field pub struct messages_sent(()); + ///Marker type for the `convos` field + pub struct convos(()); + ///Marker type for the `convos_started` field + pub struct convos_started(()); } } @@ -361,10 +361,10 @@ where impl MetadataBuilder where St: metadata_state::State, - St::Convos: metadata_state::IsSet, - St::ConvosStarted: metadata_state::IsSet, St::MessagesReceived: metadata_state::IsSet, St::MessagesSent: metadata_state::IsSet, + St::Convos: metadata_state::IsSet, + St::ConvosStarted: metadata_state::IsSet, { /// Build the final struct. pub fn build(self) -> Metadata { diff --git a/services/types/src/chat_bsky/moderation/get_message_context.rs b/services/types/src/chat_bsky/moderation/get_message_context.rs index 5ebb15d..00c013a 100644 --- a/services/types/src/chat_bsky/moderation/get_message_context.rs +++ b/services/types/src/chat_bsky/moderation/get_message_context.rs @@ -15,8 +15,8 @@ use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; -use crate::chat_bsky::convo::DeletedMessageView; use crate::chat_bsky::convo::MessageView; +use crate::chat_bsky::convo::SystemMessageView; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -31,6 +31,10 @@ pub struct GetMessageContext { pub before: Option, #[serde(skip_serializing_if = "Option::is_none")] pub convo_id: Option, + ///Defaults to `10`. Min: 0. Max: 1000. + #[serde(default = "_default_max_interleaved_system_messages")] + #[serde(skip_serializing_if = "Option::is_none")] + pub max_interleaved_system_messages: Option, pub message_id: S, } @@ -50,8 +54,8 @@ pub struct GetMessageContextOutput { pub enum GetMessageContextOutputMessagesItem { #[serde(rename = "chat.bsky.convo.defs#messageView")] MessageView(Box>), - #[serde(rename = "chat.bsky.convo.defs#deletedMessageView")] - DeletedMessageView(Box>), + #[serde(rename = "chat.bsky.convo.defs#systemMessageView")] + SystemMessageView(Box>), } /// Response type for chat.bsky.moderation.getMessageContext @@ -86,6 +90,10 @@ fn _default_before() -> Option { Some(5i64) } +fn _default_max_interleaved_system_messages() -> Option { + Some(10i64) +} + pub mod get_message_context_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; @@ -121,7 +129,7 @@ pub mod get_message_context_state { /// Builder for constructing an instance of this type. pub struct GetMessageContextBuilder { _state: PhantomData St>, - _fields: (Option, Option, Option, Option), + _fields: (Option, Option, Option, Option, Option), _type: PhantomData S>, } @@ -137,7 +145,7 @@ impl GetMessageContextBuilder { pub fn new() -> Self { GetMessageContextBuilder { _state: PhantomData, - _fields: (None, None, None, None), + _fields: (None, None, None, None, None), _type: PhantomData, } } @@ -182,6 +190,22 @@ impl GetMessageContextBuilder GetMessageContextBuilder { + /// Set the `maxInterleavedSystemMessages` field (optional) + pub fn max_interleaved_system_messages( + mut self, + value: impl Into>, + ) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `maxInterleavedSystemMessages` field to an Option value (optional) + pub fn maybe_max_interleaved_system_messages(mut self, value: Option) -> Self { + self._fields.3 = value; + self + } +} + impl GetMessageContextBuilder where St: get_message_context_state::State, @@ -192,7 +216,7 @@ where mut self, value: impl Into, ) -> GetMessageContextBuilder> { - self._fields.3 = Option::Some(value.into()); + self._fields.4 = Option::Some(value.into()); GetMessageContextBuilder { _state: PhantomData, _fields: self._fields, @@ -212,7 +236,8 @@ where after: self._fields.0, before: self._fields.1, convo_id: self._fields.2, - message_id: self._fields.3.unwrap(), + max_interleaved_system_messages: self._fields.3, + message_id: self._fields.4.unwrap(), } } } \ No newline at end of file diff --git a/services/types/src/chat_bsky/moderation/update_actor_access.rs b/services/types/src/chat_bsky/moderation/update_actor_access.rs index 63f31d7..54b27dd 100644 --- a/services/types/src/chat_bsky/moderation/update_actor_access.rs +++ b/services/types/src/chat_bsky/moderation/update_actor_access.rs @@ -66,37 +66,37 @@ pub mod update_actor_access_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Actor; type AllowAccess; + type Actor; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Actor = Unset; type AllowAccess = Unset; - } - ///State transition - sets the `actor` field to Set - pub struct SetActor(PhantomData St>); - impl sealed::Sealed for SetActor {} - impl State for SetActor { - type Actor = Set; - type AllowAccess = St::AllowAccess; + type Actor = Unset; } ///State transition - sets the `allow_access` field to Set pub struct SetAllowAccess(PhantomData St>); impl sealed::Sealed for SetAllowAccess {} impl State for SetAllowAccess { - type Actor = St::Actor; type AllowAccess = Set; + type Actor = St::Actor; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData St>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type AllowAccess = St::AllowAccess; + type Actor = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `actor` field - pub struct actor(()); ///Marker type for the `allow_access` field pub struct allow_access(()); + ///Marker type for the `actor` field + pub struct actor(()); } } @@ -179,8 +179,8 @@ impl UpdateActorAccessBuilder UpdateActorAccessBuilder where St: update_actor_access_state::State, - St::Actor: update_actor_access_state::IsSet, St::AllowAccess: update_actor_access_state::IsSet, + St::Actor: update_actor_access_state::IsSet, { /// Build the final struct. pub fn build(self) -> UpdateActorAccess { diff --git a/services/types/src/com_atproto/admin.rs b/services/types/src/com_atproto/admin.rs index afde944..3617f52 100644 --- a/services/types/src/com_atproto/admin.rs +++ b/services/types/src/com_atproto/admin.rs @@ -199,51 +199,51 @@ pub mod account_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type IndexedAt; type Did; type Handle; - type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type IndexedAt = Unset; type Did = Unset; type Handle = Unset; - type IndexedAt = Unset; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData St>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; + type Did = St::Did; + type Handle = St::Handle; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { + type IndexedAt = St::IndexedAt; type Did = Set; type Handle = St::Handle; - type IndexedAt = St::IndexedAt; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData St>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Did = St::Did; - type Handle = Set; type IndexedAt = St::IndexedAt; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData St>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { type Did = St::Did; - type Handle = St::Handle; - type IndexedAt = Set; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); } } @@ -481,9 +481,9 @@ impl AccountViewBuilder { impl AccountViewBuilder where St: account_view_state::State, + St::IndexedAt: account_view_state::IsSet, St::Did: account_view_state::IsSet, St::Handle: account_view_state::IsSet, - St::IndexedAt: account_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> AccountView { @@ -758,37 +758,37 @@ pub mod repo_blob_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Did; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Did = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Did = St::Did; + type Cid = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Cid = St::Cid; type Did = Set; + type Cid = St::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Did = St::Did; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -871,8 +871,8 @@ impl RepoBlobRefBuilder { impl RepoBlobRefBuilder where St: repo_blob_ref_state::State, - St::Cid: repo_blob_ref_state::IsSet, St::Did: repo_blob_ref_state::IsSet, + St::Cid: repo_blob_ref_state::IsSet, { /// Build the final struct. pub fn build(self) -> RepoBlobRef { diff --git a/services/types/src/com_atproto/admin/update_account_handle.rs b/services/types/src/com_atproto/admin/update_account_handle.rs index 6027cdb..383d9c0 100644 --- a/services/types/src/com_atproto/admin/update_account_handle.rs +++ b/services/types/src/com_atproto/admin/update_account_handle.rs @@ -64,37 +64,37 @@ pub mod update_account_handle_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Handle; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Handle = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Handle = St::Handle; + type Did = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData St>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Did = St::Did; type Handle = Set; + type Did = St::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = St::Handle; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -167,8 +167,8 @@ where impl UpdateAccountHandleBuilder where St: update_account_handle_state::State, - St::Did: update_account_handle_state::IsSet, St::Handle: update_account_handle_state::IsSet, + St::Did: update_account_handle_state::IsSet, { /// Build the final struct. pub fn build(self) -> UpdateAccountHandle { diff --git a/services/types/src/com_atproto/admin/update_account_password.rs b/services/types/src/com_atproto/admin/update_account_password.rs index 479b10e..6961ad8 100644 --- a/services/types/src/com_atproto/admin/update_account_password.rs +++ b/services/types/src/com_atproto/admin/update_account_password.rs @@ -64,37 +64,37 @@ pub mod update_account_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Password; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Password = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Password = St::Password; + type Did = Unset; } ///State transition - sets the `password` field to Set pub struct SetPassword(PhantomData St>); impl sealed::Sealed for SetPassword {} impl State for SetPassword { - type Did = St::Did; type Password = Set; + type Did = St::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Password = St::Password; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `password` field pub struct password(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -173,8 +173,8 @@ where impl UpdateAccountPasswordBuilder where St: update_account_password_state::State, - St::Did: update_account_password_state::IsSet, St::Password: update_account_password_state::IsSet, + St::Did: update_account_password_state::IsSet, { /// Build the final struct. pub fn build(self) -> UpdateAccountPassword { diff --git a/services/types/src/com_atproto/identity.rs b/services/types/src/com_atproto/identity.rs index ee04094..11b0c2d 100644 --- a/services/types/src/com_atproto/identity.rs +++ b/services/types/src/com_atproto/identity.rs @@ -73,51 +73,51 @@ pub mod identity_info_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; - type DidDoc; type Handle; + type DidDoc; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; - type DidDoc = Unset; type Handle = Unset; + type DidDoc = Unset; + type Did = Unset; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData St>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Handle = Set; type DidDoc = St::DidDoc; - type Handle = St::Handle; + type Did = St::Did; } ///State transition - sets the `did_doc` field to Set pub struct SetDidDoc(PhantomData St>); impl sealed::Sealed for SetDidDoc {} impl State for SetDidDoc { - type Did = St::Did; - type DidDoc = Set; type Handle = St::Handle; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData St>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { + type DidDoc = Set; type Did = St::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = St::Handle; type DidDoc = St::DidDoc; - type Handle = Set; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); - ///Marker type for the `did_doc` field - pub struct did_doc(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did_doc` field + pub struct did_doc(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -206,9 +206,9 @@ where impl IdentityInfoBuilder where St: identity_info_state::State, - St::Did: identity_info_state::IsSet, - St::DidDoc: identity_info_state::IsSet, St::Handle: identity_info_state::IsSet, + St::DidDoc: identity_info_state::IsSet, + St::Did: identity_info_state::IsSet, { /// Build the final struct. pub fn build(self) -> IdentityInfo { diff --git a/services/types/src/com_atproto/label.rs b/services/types/src/com_atproto/label.rs index a51c696..3df4750 100644 --- a/services/types/src/com_atproto/label.rs +++ b/services/types/src/com_atproto/label.rs @@ -70,16 +70,13 @@ pub struct Label { #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum LabelValue { Hide, - NoPromote, Warn, NoUnauthenticated, - DmcaViolation, - Doxxing, Porn, Sexual, Nudity, - Nsfl, - Gore, + GraphicMedia, + Bot, Other(S), } @@ -87,16 +84,13 @@ impl LabelValue { pub fn as_str(&self) -> &str { match self { Self::Hide => "!hide", - Self::NoPromote => "!no-promote", Self::Warn => "!warn", Self::NoUnauthenticated => "!no-unauthenticated", - Self::DmcaViolation => "dmca-violation", - Self::Doxxing => "doxxing", Self::Porn => "porn", Self::Sexual => "sexual", Self::Nudity => "nudity", - Self::Nsfl => "nsfl", - Self::Gore => "gore", + Self::GraphicMedia => "graphic-media", + Self::Bot => "bot", Self::Other(s) => s.as_ref(), } } @@ -104,16 +98,13 @@ impl LabelValue { pub fn from_value(s: S) -> Self { match s.as_ref() { "!hide" => Self::Hide, - "!no-promote" => Self::NoPromote, "!warn" => Self::Warn, "!no-unauthenticated" => Self::NoUnauthenticated, - "dmca-violation" => Self::DmcaViolation, - "doxxing" => Self::Doxxing, "porn" => Self::Porn, "sexual" => Self::Sexual, "nudity" => Self::Nudity, - "nsfl" => Self::Nsfl, - "gore" => Self::Gore, + "graphic-media" => Self::GraphicMedia, + "bot" => Self::Bot, _ => Self::Other(s), } } @@ -159,16 +150,13 @@ where fn into_static(self) -> Self::Output { match self { LabelValue::Hide => LabelValue::Hide, - LabelValue::NoPromote => LabelValue::NoPromote, LabelValue::Warn => LabelValue::Warn, LabelValue::NoUnauthenticated => LabelValue::NoUnauthenticated, - LabelValue::DmcaViolation => LabelValue::DmcaViolation, - LabelValue::Doxxing => LabelValue::Doxxing, LabelValue::Porn => LabelValue::Porn, LabelValue::Sexual => LabelValue::Sexual, LabelValue::Nudity => LabelValue::Nudity, - LabelValue::Nsfl => LabelValue::Nsfl, - LabelValue::Gore => LabelValue::Gore, + LabelValue::GraphicMedia => LabelValue::GraphicMedia, + LabelValue::Bot => LabelValue::Bot, LabelValue::Other(v) => LabelValue::Other(v.into_static()), } } @@ -687,8 +675,8 @@ pub mod label_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Cts; - type Src; type Uri; + type Src; type Val; } /// Empty state - all required fields are unset @@ -696,8 +684,8 @@ pub mod label_state { impl sealed::Sealed for Empty {} impl State for Empty { type Cts = Unset; - type Src = Unset; type Uri = Unset; + type Src = Unset; type Val = Unset; } ///State transition - sets the `cts` field to Set @@ -705,17 +693,8 @@ pub mod label_state { impl sealed::Sealed for SetCts {} impl State for SetCts { type Cts = Set; - type Src = St::Src; - type Uri = St::Uri; - type Val = St::Val; - } - ///State transition - sets the `src` field to Set - pub struct SetSrc(PhantomData St>); - impl sealed::Sealed for SetSrc {} - impl State for SetSrc { - type Cts = St::Cts; - type Src = Set; type Uri = St::Uri; + type Src = St::Src; type Val = St::Val; } ///State transition - sets the `uri` field to Set @@ -723,8 +702,17 @@ pub mod label_state { impl sealed::Sealed for SetUri {} impl State for SetUri { type Cts = St::Cts; - type Src = St::Src; type Uri = Set; + type Src = St::Src; + type Val = St::Val; + } + ///State transition - sets the `src` field to Set + pub struct SetSrc(PhantomData St>); + impl sealed::Sealed for SetSrc {} + impl State for SetSrc { + type Cts = St::Cts; + type Uri = St::Uri; + type Src = Set; type Val = St::Val; } ///State transition - sets the `val` field to Set @@ -732,8 +720,8 @@ pub mod label_state { impl sealed::Sealed for SetVal {} impl State for SetVal { type Cts = St::Cts; - type Src = St::Src; type Uri = St::Uri; + type Src = St::Src; type Val = Set; } /// Marker types for field names @@ -741,10 +729,10 @@ pub mod label_state { pub mod members { ///Marker type for the `cts` field pub struct cts(()); - ///Marker type for the `src` field - pub struct src(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `src` field + pub struct src(()); ///Marker type for the `val` field pub struct val(()); } @@ -930,8 +918,8 @@ impl LabelBuilder where St: label_state::State, St::Cts: label_state::IsSet, - St::Src: label_state::IsSet, St::Uri: label_state::IsSet, + St::Src: label_state::IsSet, St::Val: label_state::IsSet, { /// Build the final struct. @@ -1304,67 +1292,67 @@ pub mod label_value_definition_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Blurs; + type Severity; type Identifier; + type Blurs; type Locales; - type Severity; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Blurs = Unset; + type Severity = Unset; type Identifier = Unset; + type Blurs = Unset; type Locales = Unset; - type Severity = Unset; } - ///State transition - sets the `blurs` field to Set - pub struct SetBlurs(PhantomData St>); - impl sealed::Sealed for SetBlurs {} - impl State for SetBlurs { - type Blurs = Set; + ///State transition - sets the `severity` field to Set + pub struct SetSeverity(PhantomData St>); + impl sealed::Sealed for SetSeverity {} + impl State for SetSeverity { + type Severity = Set; type Identifier = St::Identifier; + type Blurs = St::Blurs; type Locales = St::Locales; - type Severity = St::Severity; } ///State transition - sets the `identifier` field to Set pub struct SetIdentifier(PhantomData St>); impl sealed::Sealed for SetIdentifier {} impl State for SetIdentifier { - type Blurs = St::Blurs; + type Severity = St::Severity; type Identifier = Set; + type Blurs = St::Blurs; type Locales = St::Locales; + } + ///State transition - sets the `blurs` field to Set + pub struct SetBlurs(PhantomData St>); + impl sealed::Sealed for SetBlurs {} + impl State for SetBlurs { type Severity = St::Severity; + type Identifier = St::Identifier; + type Blurs = Set; + type Locales = St::Locales; } ///State transition - sets the `locales` field to Set pub struct SetLocales(PhantomData St>); impl sealed::Sealed for SetLocales {} impl State for SetLocales { - type Blurs = St::Blurs; - type Identifier = St::Identifier; - type Locales = Set; type Severity = St::Severity; - } - ///State transition - sets the `severity` field to Set - pub struct SetSeverity(PhantomData St>); - impl sealed::Sealed for SetSeverity {} - impl State for SetSeverity { - type Blurs = St::Blurs; type Identifier = St::Identifier; - type Locales = St::Locales; - type Severity = Set; + type Blurs = St::Blurs; + type Locales = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `blurs` field - pub struct blurs(()); + ///Marker type for the `severity` field + pub struct severity(()); ///Marker type for the `identifier` field pub struct identifier(()); + ///Marker type for the `blurs` field + pub struct blurs(()); ///Marker type for the `locales` field pub struct locales(()); - ///Marker type for the `severity` field - pub struct severity(()); } } @@ -1523,10 +1511,10 @@ where impl LabelValueDefinitionBuilder where St: label_value_definition_state::State, - St::Blurs: label_value_definition_state::IsSet, + St::Severity: label_value_definition_state::IsSet, St::Identifier: label_value_definition_state::IsSet, + St::Blurs: label_value_definition_state::IsSet, St::Locales: label_value_definition_state::IsSet, - St::Severity: label_value_definition_state::IsSet, { /// Build the final struct. pub fn build(self) -> LabelValueDefinition { diff --git a/services/types/src/com_atproto/lexicon.rs b/services/types/src/com_atproto/lexicon.rs index afe0ab6..409f66b 100644 --- a/services/types/src/com_atproto/lexicon.rs +++ b/services/types/src/com_atproto/lexicon.rs @@ -3,4 +3,5 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. +pub mod resolve_lexicon; pub mod schema; \ No newline at end of file diff --git a/services/types/src/com_atproto/moderation.rs b/services/types/src/com_atproto/moderation.rs index 2da04db..cd68e0c 100644 --- a/services/types/src/com_atproto/moderation.rs +++ b/services/types/src/com_atproto/moderation.rs @@ -10,7 +10,7 @@ pub mod create_report; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_derive::IntoStatic; use serde::{Serialize, Deserialize}; -/// Appeal: appeal a previously taken moderation action +/// Appeal a previously taken moderation action #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)] pub struct ReasonAppeal; @@ -20,7 +20,7 @@ impl core::fmt::Display for ReasonAppeal { } } -/// Misleading identity, affiliation, or content +/// Misleading identity, affiliation, or content. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingOther`. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)] pub struct ReasonMisleading; @@ -30,7 +30,7 @@ impl core::fmt::Display for ReasonMisleading { } } -/// Other: reports not falling under another report category +/// Reports not falling under another report category. Prefer new lexicon definition `tools.ozone.report.defs#reasonOther`. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)] pub struct ReasonOther; @@ -40,7 +40,7 @@ impl core::fmt::Display for ReasonOther { } } -/// Rude, harassing, explicit, or otherwise unwelcoming behavior +/// Rude, harassing, explicit, or otherwise unwelcoming behavior. Prefer new lexicon definition `tools.ozone.report.defs#reasonHarassmentOther`. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)] pub struct ReasonRude; @@ -50,7 +50,7 @@ impl core::fmt::Display for ReasonRude { } } -/// Unwanted or mislabeled sexual content +/// Unwanted or mislabeled sexual content. Prefer new lexicon definition `tools.ozone.report.defs#reasonSexualUnlabeled`. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)] pub struct ReasonSexual; @@ -60,7 +60,7 @@ impl core::fmt::Display for ReasonSexual { } } -/// Spam: frequent unwanted promotion, replies, mentions +/// Spam: frequent unwanted promotion, replies, mentions. Prefer new lexicon definition `tools.ozone.report.defs#reasonMisleadingSpam`. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)] pub struct ReasonSpam; @@ -80,6 +80,46 @@ pub enum ReasonType { ComAtprotoModerationDefsReasonRude, ComAtprotoModerationDefsReasonOther, ComAtprotoModerationDefsReasonAppeal, + ToolsOzoneReportDefsReasonAppeal, + ToolsOzoneReportDefsReasonOther, + ToolsOzoneReportDefsReasonViolenceAnimal, + ToolsOzoneReportDefsReasonViolenceThreats, + ToolsOzoneReportDefsReasonViolenceGraphicContent, + ToolsOzoneReportDefsReasonViolenceGlorification, + ToolsOzoneReportDefsReasonViolenceExtremistContent, + ToolsOzoneReportDefsReasonViolenceTrafficking, + ToolsOzoneReportDefsReasonViolenceOther, + ToolsOzoneReportDefsReasonSexualAbuseContent, + ToolsOzoneReportDefsReasonSexualNcii, + ToolsOzoneReportDefsReasonSexualDeepfake, + ToolsOzoneReportDefsReasonSexualAnimal, + ToolsOzoneReportDefsReasonSexualUnlabeled, + ToolsOzoneReportDefsReasonSexualOther, + ToolsOzoneReportDefsReasonChildSafetyCsam, + ToolsOzoneReportDefsReasonChildSafetyGroom, + ToolsOzoneReportDefsReasonChildSafetyPrivacy, + ToolsOzoneReportDefsReasonChildSafetyHarassment, + ToolsOzoneReportDefsReasonChildSafetyOther, + ToolsOzoneReportDefsReasonHarassmentTroll, + ToolsOzoneReportDefsReasonHarassmentTargeted, + ToolsOzoneReportDefsReasonHarassmentHateSpeech, + ToolsOzoneReportDefsReasonHarassmentDoxxing, + ToolsOzoneReportDefsReasonHarassmentOther, + ToolsOzoneReportDefsReasonMisleadingBot, + ToolsOzoneReportDefsReasonMisleadingImpersonation, + ToolsOzoneReportDefsReasonMisleadingSpam, + ToolsOzoneReportDefsReasonMisleadingScam, + ToolsOzoneReportDefsReasonMisleadingElections, + ToolsOzoneReportDefsReasonMisleadingOther, + ToolsOzoneReportDefsReasonRuleSiteSecurity, + ToolsOzoneReportDefsReasonRuleProhibitedSales, + ToolsOzoneReportDefsReasonRuleBanEvasion, + ToolsOzoneReportDefsReasonRuleOther, + ToolsOzoneReportDefsReasonSelfHarmContent, + ToolsOzoneReportDefsReasonSelfHarmEd, + ToolsOzoneReportDefsReasonSelfHarmStunts, + ToolsOzoneReportDefsReasonSelfHarmSubstances, + ToolsOzoneReportDefsReasonSelfHarmOther, Other(S), } @@ -107,6 +147,126 @@ impl ReasonType { Self::ComAtprotoModerationDefsReasonAppeal => { "com.atproto.moderation.defs#reasonAppeal" } + Self::ToolsOzoneReportDefsReasonAppeal => { + "tools.ozone.report.defs#reasonAppeal" + } + Self::ToolsOzoneReportDefsReasonOther => { + "tools.ozone.report.defs#reasonOther" + } + Self::ToolsOzoneReportDefsReasonViolenceAnimal => { + "tools.ozone.report.defs#reasonViolenceAnimal" + } + Self::ToolsOzoneReportDefsReasonViolenceThreats => { + "tools.ozone.report.defs#reasonViolenceThreats" + } + Self::ToolsOzoneReportDefsReasonViolenceGraphicContent => { + "tools.ozone.report.defs#reasonViolenceGraphicContent" + } + Self::ToolsOzoneReportDefsReasonViolenceGlorification => { + "tools.ozone.report.defs#reasonViolenceGlorification" + } + Self::ToolsOzoneReportDefsReasonViolenceExtremistContent => { + "tools.ozone.report.defs#reasonViolenceExtremistContent" + } + Self::ToolsOzoneReportDefsReasonViolenceTrafficking => { + "tools.ozone.report.defs#reasonViolenceTrafficking" + } + Self::ToolsOzoneReportDefsReasonViolenceOther => { + "tools.ozone.report.defs#reasonViolenceOther" + } + Self::ToolsOzoneReportDefsReasonSexualAbuseContent => { + "tools.ozone.report.defs#reasonSexualAbuseContent" + } + Self::ToolsOzoneReportDefsReasonSexualNcii => { + "tools.ozone.report.defs#reasonSexualNCII" + } + Self::ToolsOzoneReportDefsReasonSexualDeepfake => { + "tools.ozone.report.defs#reasonSexualDeepfake" + } + Self::ToolsOzoneReportDefsReasonSexualAnimal => { + "tools.ozone.report.defs#reasonSexualAnimal" + } + Self::ToolsOzoneReportDefsReasonSexualUnlabeled => { + "tools.ozone.report.defs#reasonSexualUnlabeled" + } + Self::ToolsOzoneReportDefsReasonSexualOther => { + "tools.ozone.report.defs#reasonSexualOther" + } + Self::ToolsOzoneReportDefsReasonChildSafetyCsam => { + "tools.ozone.report.defs#reasonChildSafetyCSAM" + } + Self::ToolsOzoneReportDefsReasonChildSafetyGroom => { + "tools.ozone.report.defs#reasonChildSafetyGroom" + } + Self::ToolsOzoneReportDefsReasonChildSafetyPrivacy => { + "tools.ozone.report.defs#reasonChildSafetyPrivacy" + } + Self::ToolsOzoneReportDefsReasonChildSafetyHarassment => { + "tools.ozone.report.defs#reasonChildSafetyHarassment" + } + Self::ToolsOzoneReportDefsReasonChildSafetyOther => { + "tools.ozone.report.defs#reasonChildSafetyOther" + } + Self::ToolsOzoneReportDefsReasonHarassmentTroll => { + "tools.ozone.report.defs#reasonHarassmentTroll" + } + Self::ToolsOzoneReportDefsReasonHarassmentTargeted => { + "tools.ozone.report.defs#reasonHarassmentTargeted" + } + Self::ToolsOzoneReportDefsReasonHarassmentHateSpeech => { + "tools.ozone.report.defs#reasonHarassmentHateSpeech" + } + Self::ToolsOzoneReportDefsReasonHarassmentDoxxing => { + "tools.ozone.report.defs#reasonHarassmentDoxxing" + } + Self::ToolsOzoneReportDefsReasonHarassmentOther => { + "tools.ozone.report.defs#reasonHarassmentOther" + } + Self::ToolsOzoneReportDefsReasonMisleadingBot => { + "tools.ozone.report.defs#reasonMisleadingBot" + } + Self::ToolsOzoneReportDefsReasonMisleadingImpersonation => { + "tools.ozone.report.defs#reasonMisleadingImpersonation" + } + Self::ToolsOzoneReportDefsReasonMisleadingSpam => { + "tools.ozone.report.defs#reasonMisleadingSpam" + } + Self::ToolsOzoneReportDefsReasonMisleadingScam => { + "tools.ozone.report.defs#reasonMisleadingScam" + } + Self::ToolsOzoneReportDefsReasonMisleadingElections => { + "tools.ozone.report.defs#reasonMisleadingElections" + } + Self::ToolsOzoneReportDefsReasonMisleadingOther => { + "tools.ozone.report.defs#reasonMisleadingOther" + } + Self::ToolsOzoneReportDefsReasonRuleSiteSecurity => { + "tools.ozone.report.defs#reasonRuleSiteSecurity" + } + Self::ToolsOzoneReportDefsReasonRuleProhibitedSales => { + "tools.ozone.report.defs#reasonRuleProhibitedSales" + } + Self::ToolsOzoneReportDefsReasonRuleBanEvasion => { + "tools.ozone.report.defs#reasonRuleBanEvasion" + } + Self::ToolsOzoneReportDefsReasonRuleOther => { + "tools.ozone.report.defs#reasonRuleOther" + } + Self::ToolsOzoneReportDefsReasonSelfHarmContent => { + "tools.ozone.report.defs#reasonSelfHarmContent" + } + Self::ToolsOzoneReportDefsReasonSelfHarmEd => { + "tools.ozone.report.defs#reasonSelfHarmED" + } + Self::ToolsOzoneReportDefsReasonSelfHarmStunts => { + "tools.ozone.report.defs#reasonSelfHarmStunts" + } + Self::ToolsOzoneReportDefsReasonSelfHarmSubstances => { + "tools.ozone.report.defs#reasonSelfHarmSubstances" + } + Self::ToolsOzoneReportDefsReasonSelfHarmOther => { + "tools.ozone.report.defs#reasonSelfHarmOther" + } Self::Other(s) => s.as_ref(), } } @@ -134,6 +294,126 @@ impl ReasonType { "com.atproto.moderation.defs#reasonAppeal" => { Self::ComAtprotoModerationDefsReasonAppeal } + "tools.ozone.report.defs#reasonAppeal" => { + Self::ToolsOzoneReportDefsReasonAppeal + } + "tools.ozone.report.defs#reasonOther" => { + Self::ToolsOzoneReportDefsReasonOther + } + "tools.ozone.report.defs#reasonViolenceAnimal" => { + Self::ToolsOzoneReportDefsReasonViolenceAnimal + } + "tools.ozone.report.defs#reasonViolenceThreats" => { + Self::ToolsOzoneReportDefsReasonViolenceThreats + } + "tools.ozone.report.defs#reasonViolenceGraphicContent" => { + Self::ToolsOzoneReportDefsReasonViolenceGraphicContent + } + "tools.ozone.report.defs#reasonViolenceGlorification" => { + Self::ToolsOzoneReportDefsReasonViolenceGlorification + } + "tools.ozone.report.defs#reasonViolenceExtremistContent" => { + Self::ToolsOzoneReportDefsReasonViolenceExtremistContent + } + "tools.ozone.report.defs#reasonViolenceTrafficking" => { + Self::ToolsOzoneReportDefsReasonViolenceTrafficking + } + "tools.ozone.report.defs#reasonViolenceOther" => { + Self::ToolsOzoneReportDefsReasonViolenceOther + } + "tools.ozone.report.defs#reasonSexualAbuseContent" => { + Self::ToolsOzoneReportDefsReasonSexualAbuseContent + } + "tools.ozone.report.defs#reasonSexualNCII" => { + Self::ToolsOzoneReportDefsReasonSexualNcii + } + "tools.ozone.report.defs#reasonSexualDeepfake" => { + Self::ToolsOzoneReportDefsReasonSexualDeepfake + } + "tools.ozone.report.defs#reasonSexualAnimal" => { + Self::ToolsOzoneReportDefsReasonSexualAnimal + } + "tools.ozone.report.defs#reasonSexualUnlabeled" => { + Self::ToolsOzoneReportDefsReasonSexualUnlabeled + } + "tools.ozone.report.defs#reasonSexualOther" => { + Self::ToolsOzoneReportDefsReasonSexualOther + } + "tools.ozone.report.defs#reasonChildSafetyCSAM" => { + Self::ToolsOzoneReportDefsReasonChildSafetyCsam + } + "tools.ozone.report.defs#reasonChildSafetyGroom" => { + Self::ToolsOzoneReportDefsReasonChildSafetyGroom + } + "tools.ozone.report.defs#reasonChildSafetyPrivacy" => { + Self::ToolsOzoneReportDefsReasonChildSafetyPrivacy + } + "tools.ozone.report.defs#reasonChildSafetyHarassment" => { + Self::ToolsOzoneReportDefsReasonChildSafetyHarassment + } + "tools.ozone.report.defs#reasonChildSafetyOther" => { + Self::ToolsOzoneReportDefsReasonChildSafetyOther + } + "tools.ozone.report.defs#reasonHarassmentTroll" => { + Self::ToolsOzoneReportDefsReasonHarassmentTroll + } + "tools.ozone.report.defs#reasonHarassmentTargeted" => { + Self::ToolsOzoneReportDefsReasonHarassmentTargeted + } + "tools.ozone.report.defs#reasonHarassmentHateSpeech" => { + Self::ToolsOzoneReportDefsReasonHarassmentHateSpeech + } + "tools.ozone.report.defs#reasonHarassmentDoxxing" => { + Self::ToolsOzoneReportDefsReasonHarassmentDoxxing + } + "tools.ozone.report.defs#reasonHarassmentOther" => { + Self::ToolsOzoneReportDefsReasonHarassmentOther + } + "tools.ozone.report.defs#reasonMisleadingBot" => { + Self::ToolsOzoneReportDefsReasonMisleadingBot + } + "tools.ozone.report.defs#reasonMisleadingImpersonation" => { + Self::ToolsOzoneReportDefsReasonMisleadingImpersonation + } + "tools.ozone.report.defs#reasonMisleadingSpam" => { + Self::ToolsOzoneReportDefsReasonMisleadingSpam + } + "tools.ozone.report.defs#reasonMisleadingScam" => { + Self::ToolsOzoneReportDefsReasonMisleadingScam + } + "tools.ozone.report.defs#reasonMisleadingElections" => { + Self::ToolsOzoneReportDefsReasonMisleadingElections + } + "tools.ozone.report.defs#reasonMisleadingOther" => { + Self::ToolsOzoneReportDefsReasonMisleadingOther + } + "tools.ozone.report.defs#reasonRuleSiteSecurity" => { + Self::ToolsOzoneReportDefsReasonRuleSiteSecurity + } + "tools.ozone.report.defs#reasonRuleProhibitedSales" => { + Self::ToolsOzoneReportDefsReasonRuleProhibitedSales + } + "tools.ozone.report.defs#reasonRuleBanEvasion" => { + Self::ToolsOzoneReportDefsReasonRuleBanEvasion + } + "tools.ozone.report.defs#reasonRuleOther" => { + Self::ToolsOzoneReportDefsReasonRuleOther + } + "tools.ozone.report.defs#reasonSelfHarmContent" => { + Self::ToolsOzoneReportDefsReasonSelfHarmContent + } + "tools.ozone.report.defs#reasonSelfHarmED" => { + Self::ToolsOzoneReportDefsReasonSelfHarmEd + } + "tools.ozone.report.defs#reasonSelfHarmStunts" => { + Self::ToolsOzoneReportDefsReasonSelfHarmStunts + } + "tools.ozone.report.defs#reasonSelfHarmSubstances" => { + Self::ToolsOzoneReportDefsReasonSelfHarmSubstances + } + "tools.ozone.report.defs#reasonSelfHarmOther" => { + Self::ToolsOzoneReportDefsReasonSelfHarmOther + } _ => Self::Other(s), } } @@ -199,12 +479,132 @@ where ReasonType::ComAtprotoModerationDefsReasonAppeal => { ReasonType::ComAtprotoModerationDefsReasonAppeal } + ReasonType::ToolsOzoneReportDefsReasonAppeal => { + ReasonType::ToolsOzoneReportDefsReasonAppeal + } + ReasonType::ToolsOzoneReportDefsReasonOther => { + ReasonType::ToolsOzoneReportDefsReasonOther + } + ReasonType::ToolsOzoneReportDefsReasonViolenceAnimal => { + ReasonType::ToolsOzoneReportDefsReasonViolenceAnimal + } + ReasonType::ToolsOzoneReportDefsReasonViolenceThreats => { + ReasonType::ToolsOzoneReportDefsReasonViolenceThreats + } + ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent => { + ReasonType::ToolsOzoneReportDefsReasonViolenceGraphicContent + } + ReasonType::ToolsOzoneReportDefsReasonViolenceGlorification => { + ReasonType::ToolsOzoneReportDefsReasonViolenceGlorification + } + ReasonType::ToolsOzoneReportDefsReasonViolenceExtremistContent => { + ReasonType::ToolsOzoneReportDefsReasonViolenceExtremistContent + } + ReasonType::ToolsOzoneReportDefsReasonViolenceTrafficking => { + ReasonType::ToolsOzoneReportDefsReasonViolenceTrafficking + } + ReasonType::ToolsOzoneReportDefsReasonViolenceOther => { + ReasonType::ToolsOzoneReportDefsReasonViolenceOther + } + ReasonType::ToolsOzoneReportDefsReasonSexualAbuseContent => { + ReasonType::ToolsOzoneReportDefsReasonSexualAbuseContent + } + ReasonType::ToolsOzoneReportDefsReasonSexualNcii => { + ReasonType::ToolsOzoneReportDefsReasonSexualNcii + } + ReasonType::ToolsOzoneReportDefsReasonSexualDeepfake => { + ReasonType::ToolsOzoneReportDefsReasonSexualDeepfake + } + ReasonType::ToolsOzoneReportDefsReasonSexualAnimal => { + ReasonType::ToolsOzoneReportDefsReasonSexualAnimal + } + ReasonType::ToolsOzoneReportDefsReasonSexualUnlabeled => { + ReasonType::ToolsOzoneReportDefsReasonSexualUnlabeled + } + ReasonType::ToolsOzoneReportDefsReasonSexualOther => { + ReasonType::ToolsOzoneReportDefsReasonSexualOther + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyCsam => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyCsam + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyGroom => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyGroom + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyPrivacy => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyPrivacy + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyHarassment + } + ReasonType::ToolsOzoneReportDefsReasonChildSafetyOther => { + ReasonType::ToolsOzoneReportDefsReasonChildSafetyOther + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentTroll => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentTroll + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentTargeted => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentTargeted + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentHateSpeech => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentHateSpeech + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentDoxxing => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentDoxxing + } + ReasonType::ToolsOzoneReportDefsReasonHarassmentOther => { + ReasonType::ToolsOzoneReportDefsReasonHarassmentOther + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingBot => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingBot + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingImpersonation => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingImpersonation + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingSpam => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingSpam + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingScam => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingScam + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingElections => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingElections + } + ReasonType::ToolsOzoneReportDefsReasonMisleadingOther => { + ReasonType::ToolsOzoneReportDefsReasonMisleadingOther + } + ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity => { + ReasonType::ToolsOzoneReportDefsReasonRuleSiteSecurity + } + ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales => { + ReasonType::ToolsOzoneReportDefsReasonRuleProhibitedSales + } + ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion => { + ReasonType::ToolsOzoneReportDefsReasonRuleBanEvasion + } + ReasonType::ToolsOzoneReportDefsReasonRuleOther => { + ReasonType::ToolsOzoneReportDefsReasonRuleOther + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmContent => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmContent + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmEd => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmEd + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmStunts => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmStunts + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmSubstances => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmSubstances + } + ReasonType::ToolsOzoneReportDefsReasonSelfHarmOther => { + ReasonType::ToolsOzoneReportDefsReasonSelfHarmOther + } ReasonType::Other(v) => ReasonType::Other(v.into_static()), } } } -/// Direct violation of server rules, laws, terms of service +/// Direct violation of server rules, laws, terms of service. Prefer new lexicon definition `tools.ozone.report.defs#reasonRuleOther`. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)] pub struct ReasonViolation; diff --git a/services/types/src/com_atproto/moderation/create_report.rs b/services/types/src/com_atproto/moderation/create_report.rs index 723fd60..142633f 100644 --- a/services/types/src/com_atproto/moderation/create_report.rs +++ b/services/types/src/com_atproto/moderation/create_report.rs @@ -148,37 +148,37 @@ pub mod create_report_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ReasonType; type Subject; + type ReasonType; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ReasonType = Unset; type Subject = Unset; - } - ///State transition - sets the `reason_type` field to Set - pub struct SetReasonType(PhantomData St>); - impl sealed::Sealed for SetReasonType {} - impl State for SetReasonType { - type ReasonType = Set; - type Subject = St::Subject; + type ReasonType = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type ReasonType = St::ReasonType; type Subject = Set; + type ReasonType = St::ReasonType; + } + ///State transition - sets the `reason_type` field to Set + pub struct SetReasonType(PhantomData St>); + impl sealed::Sealed for SetReasonType {} + impl State for SetReasonType { + type Subject = St::Subject; + type ReasonType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reason_type` field - pub struct reason_type(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `reason_type` field + pub struct reason_type(()); } } @@ -282,8 +282,8 @@ where impl CreateReportBuilder where St: create_report_state::State, - St::ReasonType: create_report_state::IsSet, St::Subject: create_report_state::IsSet, + St::ReasonType: create_report_state::IsSet, { /// Build the final struct. pub fn build(self) -> CreateReport { diff --git a/services/types/src/com_atproto/repo/apply_writes.rs b/services/types/src/com_atproto/repo/apply_writes.rs index 036a940..81aa547 100644 --- a/services/types/src/com_atproto/repo/apply_writes.rs +++ b/services/types/src/com_atproto/repo/apply_writes.rs @@ -496,37 +496,37 @@ pub mod create_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; type Value; + type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Collection = Unset; type Value = Unset; - } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData St>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { - type Collection = Set; - type Value = St::Value; + type Collection = Unset; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData St>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Collection = St::Collection; type Value = Set; + type Collection = St::Collection; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData St>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Value = St::Value; + type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `collection` field - pub struct collection(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -609,8 +609,8 @@ where impl CreateBuilder where St: create_state::State, - St::Collection: create_state::IsSet, St::Value: create_state::IsSet, + St::Collection: create_state::IsSet, { /// Build the final struct. pub fn build(self) -> Create { @@ -1209,37 +1209,37 @@ pub mod apply_writes_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Repo; type Writes; + type Repo; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Repo = Unset; type Writes = Unset; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData St>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { - type Repo = Set; - type Writes = St::Writes; + type Repo = Unset; } ///State transition - sets the `writes` field to Set pub struct SetWrites(PhantomData St>); impl sealed::Sealed for SetWrites {} impl State for SetWrites { - type Repo = St::Repo; type Writes = Set; + type Repo = St::Repo; + } + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData St>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Writes = St::Writes; + type Repo = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `repo` field - pub struct repo(()); ///Marker type for the `writes` field pub struct writes(()); + ///Marker type for the `repo` field + pub struct repo(()); } } @@ -1340,8 +1340,8 @@ where impl ApplyWritesBuilder where St: apply_writes_state::State, - St::Repo: apply_writes_state::IsSet, St::Writes: apply_writes_state::IsSet, + St::Repo: apply_writes_state::IsSet, { /// Build the final struct. pub fn build(self) -> ApplyWrites { @@ -1545,37 +1545,37 @@ pub mod update_result_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = St::Uri; + type Cid = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = St::Cid; type Uri = Set; + type Cid = St::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = St::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -1664,8 +1664,8 @@ impl UpdateResultBuilder { impl UpdateResultBuilder where St: update_result_state::State, - St::Cid: update_result_state::IsSet, St::Uri: update_result_state::IsSet, + St::Cid: update_result_state::IsSet, { /// Build the final struct. pub fn build(self) -> UpdateResult { diff --git a/services/types/src/com_atproto/repo/create_record.rs b/services/types/src/com_atproto/repo/create_record.rs index bb1ecfc..7b2be43 100644 --- a/services/types/src/com_atproto/repo/create_record.rs +++ b/services/types/src/com_atproto/repo/create_record.rs @@ -221,51 +221,51 @@ pub mod create_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; - type Record; type Repo; + type Record; + type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Collection = Unset; - type Record = Unset; type Repo = Unset; + type Record = Unset; + type Collection = Unset; } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData St>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { - type Collection = Set; + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData St>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Repo = Set; type Record = St::Record; - type Repo = St::Repo; + type Collection = St::Collection; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData St>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Collection = St::Collection; - type Record = Set; type Repo = St::Repo; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData St>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { + type Record = Set; type Collection = St::Collection; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData St>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Repo = St::Repo; type Record = St::Record; - type Repo = Set; + type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `collection` field - pub struct collection(()); - ///Marker type for the `record` field - pub struct record(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -400,9 +400,9 @@ impl CreateRecordBuilder { impl CreateRecordBuilder where St: create_record_state::State, - St::Collection: create_record_state::IsSet, - St::Record: create_record_state::IsSet, St::Repo: create_record_state::IsSet, + St::Record: create_record_state::IsSet, + St::Collection: create_record_state::IsSet, { /// Build the final struct. pub fn build(self) -> CreateRecord { diff --git a/services/types/src/com_atproto/repo/delete_record.rs b/services/types/src/com_atproto/repo/delete_record.rs index 917d068..2194044 100644 --- a/services/types/src/com_atproto/repo/delete_record.rs +++ b/services/types/src/com_atproto/repo/delete_record.rs @@ -128,51 +128,51 @@ pub mod delete_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Rkey; type Collection; type Repo; - type Rkey; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Rkey = Unset; type Collection = Unset; type Repo = Unset; - type Rkey = Unset; + } + ///State transition - sets the `rkey` field to Set + pub struct SetRkey(PhantomData St>); + impl sealed::Sealed for SetRkey {} + impl State for SetRkey { + type Rkey = Set; + type Collection = St::Collection; + type Repo = St::Repo; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData St>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { + type Rkey = St::Rkey; type Collection = Set; type Repo = St::Repo; - type Rkey = St::Rkey; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData St>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Collection = St::Collection; - type Repo = Set; type Rkey = St::Rkey; - } - ///State transition - sets the `rkey` field to Set - pub struct SetRkey(PhantomData St>); - impl sealed::Sealed for SetRkey {} - impl State for SetRkey { type Collection = St::Collection; - type Repo = St::Repo; - type Rkey = Set; + type Repo = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `rkey` field + pub struct rkey(()); ///Marker type for the `collection` field pub struct collection(()); ///Marker type for the `repo` field pub struct repo(()); - ///Marker type for the `rkey` field - pub struct rkey(()); } } @@ -293,9 +293,9 @@ impl DeleteRecordBuilder { impl DeleteRecordBuilder where St: delete_record_state::State, + St::Rkey: delete_record_state::IsSet, St::Collection: delete_record_state::IsSet, St::Repo: delete_record_state::IsSet, - St::Rkey: delete_record_state::IsSet, { /// Build the final struct. pub fn build(self) -> DeleteRecord { diff --git a/services/types/src/com_atproto/repo/get_record.rs b/services/types/src/com_atproto/repo/get_record.rs index cb34dcc..3666110 100644 --- a/services/types/src/com_atproto/repo/get_record.rs +++ b/services/types/src/com_atproto/repo/get_record.rs @@ -116,49 +116,49 @@ pub mod get_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; type Repo; + type Collection; type Rkey; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Collection = Unset; type Repo = Unset; + type Collection = Unset; type Rkey = Unset; } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData St>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { - type Collection = Set; - type Repo = St::Repo; - type Rkey = St::Rkey; - } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData St>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Collection = St::Collection; type Repo = Set; + type Collection = St::Collection; + type Rkey = St::Rkey; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData St>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Repo = St::Repo; + type Collection = Set; type Rkey = St::Rkey; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData St>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Collection = St::Collection; type Repo = St::Repo; + type Collection = St::Collection; type Rkey = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `collection` field - pub struct collection(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `collection` field + pub struct collection(()); ///Marker type for the `rkey` field pub struct rkey(()); } @@ -267,8 +267,8 @@ where impl GetRecordBuilder where St: get_record_state::State, - St::Collection: get_record_state::IsSet, St::Repo: get_record_state::IsSet, + St::Collection: get_record_state::IsSet, St::Rkey: get_record_state::IsSet, { /// Build the final struct. diff --git a/services/types/src/com_atproto/repo/list_records.rs b/services/types/src/com_atproto/repo/list_records.rs index 55278c6..5c94484 100644 --- a/services/types/src/com_atproto/repo/list_records.rs +++ b/services/types/src/com_atproto/repo/list_records.rs @@ -287,49 +287,49 @@ pub mod record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Uri; + type Cid; type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Uri = Unset; + type Cid = Unset; type Value = Unset; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = St::Uri; - type Value = St::Value; - } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = St::Cid; type Uri = Set; + type Cid = St::Cid; + type Value = St::Value; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = St::Uri; + type Cid = Set; type Value = St::Value; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData St>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Cid = St::Cid; type Uri = St::Uri; + type Cid = St::Cid; type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `value` field pub struct value(()); } @@ -420,8 +420,8 @@ where impl RecordBuilder where St: record_state::State, - St::Cid: record_state::IsSet, St::Uri: record_state::IsSet, + St::Cid: record_state::IsSet, St::Value: record_state::IsSet, { /// Build the final struct. diff --git a/services/types/src/com_atproto/repo/strong_ref.rs b/services/types/src/com_atproto/repo/strong_ref.rs index 21e9e02..8b7c0d7 100644 --- a/services/types/src/com_atproto/repo/strong_ref.rs +++ b/services/types/src/com_atproto/repo/strong_ref.rs @@ -59,37 +59,37 @@ pub mod strong_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = St::Uri; + type Cid = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = St::Cid; type Uri = Set; + type Cid = St::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = St::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -159,8 +159,8 @@ where impl StrongRefBuilder where St: strong_ref_state::State, - St::Cid: strong_ref_state::IsSet, St::Uri: strong_ref_state::IsSet, + St::Cid: strong_ref_state::IsSet, { /// Build the final struct. pub fn build(self) -> StrongRef { diff --git a/services/types/src/com_atproto/server.rs b/services/types/src/com_atproto/server.rs index ececfed..71bbee9 100644 --- a/services/types/src/com_atproto/server.rs +++ b/services/types/src/com_atproto/server.rs @@ -117,127 +117,127 @@ pub mod invite_code_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Available; - type Code; - type CreatedAt; type CreatedBy; - type Disabled; - type ForAccount; + type CreatedAt; type Uses; + type Code; + type Available; + type ForAccount; + type Disabled; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Available = Unset; - type Code = Unset; - type CreatedAt = Unset; type CreatedBy = Unset; - type Disabled = Unset; - type ForAccount = Unset; + type CreatedAt = Unset; type Uses = Unset; + type Code = Unset; + type Available = Unset; + type ForAccount = Unset; + type Disabled = Unset; } - ///State transition - sets the `available` field to Set - pub struct SetAvailable(PhantomData St>); - impl sealed::Sealed for SetAvailable {} - impl State for SetAvailable { - type Available = Set; - type Code = St::Code; + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData St>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type CreatedBy = Set; type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; - type Disabled = St::Disabled; - type ForAccount = St::ForAccount; type Uses = St::Uses; - } - ///State transition - sets the `code` field to Set - pub struct SetCode(PhantomData St>); - impl sealed::Sealed for SetCode {} - impl State for SetCode { + type Code = St::Code; type Available = St::Available; - type Code = Set; - type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; - type Disabled = St::Disabled; type ForAccount = St::ForAccount; - type Uses = St::Uses; + type Disabled = St::Disabled; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData St>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Available = St::Available; - type Code = St::Code; - type CreatedAt = Set; type CreatedBy = St::CreatedBy; - type Disabled = St::Disabled; - type ForAccount = St::ForAccount; + type CreatedAt = Set; type Uses = St::Uses; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData St>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type Available = St::Available; type Code = St::Code; - type CreatedAt = St::CreatedAt; - type CreatedBy = Set; - type Disabled = St::Disabled; + type Available = St::Available; type ForAccount = St::ForAccount; - type Uses = St::Uses; + type Disabled = St::Disabled; } - ///State transition - sets the `disabled` field to Set - pub struct SetDisabled(PhantomData St>); - impl sealed::Sealed for SetDisabled {} - impl State for SetDisabled { - type Available = St::Available; - type Code = St::Code; + ///State transition - sets the `uses` field to Set + pub struct SetUses(PhantomData St>); + impl sealed::Sealed for SetUses {} + impl State for SetUses { + type CreatedBy = St::CreatedBy; type CreatedAt = St::CreatedAt; + type Uses = Set; + type Code = St::Code; + type Available = St::Available; + type ForAccount = St::ForAccount; + type Disabled = St::Disabled; + } + ///State transition - sets the `code` field to Set + pub struct SetCode(PhantomData St>); + impl sealed::Sealed for SetCode {} + impl State for SetCode { type CreatedBy = St::CreatedBy; - type Disabled = Set; + type CreatedAt = St::CreatedAt; + type Uses = St::Uses; + type Code = Set; + type Available = St::Available; type ForAccount = St::ForAccount; + type Disabled = St::Disabled; + } + ///State transition - sets the `available` field to Set + pub struct SetAvailable(PhantomData St>); + impl sealed::Sealed for SetAvailable {} + impl State for SetAvailable { + type CreatedBy = St::CreatedBy; + type CreatedAt = St::CreatedAt; type Uses = St::Uses; + type Code = St::Code; + type Available = Set; + type ForAccount = St::ForAccount; + type Disabled = St::Disabled; } ///State transition - sets the `for_account` field to Set pub struct SetForAccount(PhantomData St>); impl sealed::Sealed for SetForAccount {} impl State for SetForAccount { - type Available = St::Available; - type Code = St::Code; - type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; - type Disabled = St::Disabled; - type ForAccount = Set; + type CreatedAt = St::CreatedAt; type Uses = St::Uses; - } - ///State transition - sets the `uses` field to Set - pub struct SetUses(PhantomData St>); - impl sealed::Sealed for SetUses {} - impl State for SetUses { - type Available = St::Available; type Code = St::Code; - type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; + type Available = St::Available; + type ForAccount = Set; type Disabled = St::Disabled; + } + ///State transition - sets the `disabled` field to Set + pub struct SetDisabled(PhantomData St>); + impl sealed::Sealed for SetDisabled {} + impl State for SetDisabled { + type CreatedBy = St::CreatedBy; + type CreatedAt = St::CreatedAt; + type Uses = St::Uses; + type Code = St::Code; + type Available = St::Available; type ForAccount = St::ForAccount; - type Uses = Set; + type Disabled = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `available` field - pub struct available(()); - ///Marker type for the `code` field - pub struct code(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `created_by` field pub struct created_by(()); - ///Marker type for the `disabled` field - pub struct disabled(()); - ///Marker type for the `for_account` field - pub struct for_account(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `uses` field pub struct uses(()); + ///Marker type for the `code` field + pub struct code(()); + ///Marker type for the `available` field + pub struct available(()); + ///Marker type for the `for_account` field + pub struct for_account(()); + ///Marker type for the `disabled` field + pub struct disabled(()); } } @@ -410,13 +410,13 @@ where impl InviteCodeBuilder where St: invite_code_state::State, - St::Available: invite_code_state::IsSet, - St::Code: invite_code_state::IsSet, - St::CreatedAt: invite_code_state::IsSet, St::CreatedBy: invite_code_state::IsSet, - St::Disabled: invite_code_state::IsSet, - St::ForAccount: invite_code_state::IsSet, + St::CreatedAt: invite_code_state::IsSet, St::Uses: invite_code_state::IsSet, + St::Code: invite_code_state::IsSet, + St::Available: invite_code_state::IsSet, + St::ForAccount: invite_code_state::IsSet, + St::Disabled: invite_code_state::IsSet, { /// Build the final struct. pub fn build(self) -> InviteCode { @@ -567,37 +567,37 @@ pub mod invite_code_use_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type UsedAt; type UsedBy; + type UsedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type UsedAt = Unset; type UsedBy = Unset; - } - ///State transition - sets the `used_at` field to Set - pub struct SetUsedAt(PhantomData St>); - impl sealed::Sealed for SetUsedAt {} - impl State for SetUsedAt { - type UsedAt = Set; - type UsedBy = St::UsedBy; + type UsedAt = Unset; } ///State transition - sets the `used_by` field to Set pub struct SetUsedBy(PhantomData St>); impl sealed::Sealed for SetUsedBy {} impl State for SetUsedBy { - type UsedAt = St::UsedAt; type UsedBy = Set; + type UsedAt = St::UsedAt; + } + ///State transition - sets the `used_at` field to Set + pub struct SetUsedAt(PhantomData St>); + impl sealed::Sealed for SetUsedAt {} + impl State for SetUsedAt { + type UsedBy = St::UsedBy; + type UsedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `used_at` field - pub struct used_at(()); ///Marker type for the `used_by` field pub struct used_by(()); + ///Marker type for the `used_at` field + pub struct used_at(()); } } @@ -667,8 +667,8 @@ where impl InviteCodeUseBuilder where St: invite_code_use_state::State, - St::UsedAt: invite_code_use_state::IsSet, St::UsedBy: invite_code_use_state::IsSet, + St::UsedAt: invite_code_use_state::IsSet, { /// Build the final struct. pub fn build(self) -> InviteCodeUse { diff --git a/services/types/src/com_atproto/server/create_app_password.rs b/services/types/src/com_atproto/server/create_app_password.rs index 1f399fd..30249fd 100644 --- a/services/types/src/com_atproto/server/create_app_password.rs +++ b/services/types/src/com_atproto/server/create_app_password.rs @@ -156,51 +156,51 @@ pub mod app_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Name; type Password; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Name = Unset; type Password = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Name = St::Name; - type Password = St::Password; + type CreatedAt = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { - type CreatedAt = St::CreatedAt; type Name = Set; type Password = St::Password; + type CreatedAt = St::CreatedAt; } ///State transition - sets the `password` field to Set pub struct SetPassword(PhantomData St>); impl sealed::Sealed for SetPassword {} impl State for SetPassword { - type CreatedAt = St::CreatedAt; type Name = St::Name; type Password = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Name = St::Name; + type Password = St::Password; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `password` field pub struct password(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -302,9 +302,9 @@ impl AppPasswordBuilder { impl AppPasswordBuilder where St: app_password_state::State, - St::CreatedAt: app_password_state::IsSet, St::Name: app_password_state::IsSet, St::Password: app_password_state::IsSet, + St::CreatedAt: app_password_state::IsSet, { /// Build the final struct. pub fn build(self) -> AppPassword { diff --git a/services/types/src/com_atproto/server/create_invite_codes.rs b/services/types/src/com_atproto/server/create_invite_codes.rs index 7bbd2fe..93d66ae 100644 --- a/services/types/src/com_atproto/server/create_invite_codes.rs +++ b/services/types/src/com_atproto/server/create_invite_codes.rs @@ -342,37 +342,37 @@ pub mod create_invite_codes_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CodeCount; type UseCount; + type CodeCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CodeCount = Unset; type UseCount = Unset; - } - ///State transition - sets the `code_count` field to Set - pub struct SetCodeCount(PhantomData St>); - impl sealed::Sealed for SetCodeCount {} - impl State for SetCodeCount { - type CodeCount = Set; - type UseCount = St::UseCount; + type CodeCount = Unset; } ///State transition - sets the `use_count` field to Set pub struct SetUseCount(PhantomData St>); impl sealed::Sealed for SetUseCount {} impl State for SetUseCount { - type CodeCount = St::CodeCount; type UseCount = Set; + type CodeCount = St::CodeCount; + } + ///State transition - sets the `code_count` field to Set + pub struct SetCodeCount(PhantomData St>); + impl sealed::Sealed for SetCodeCount {} + impl State for SetCodeCount { + type UseCount = St::UseCount; + type CodeCount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `code_count` field - pub struct code_count(()); ///Marker type for the `use_count` field pub struct use_count(()); + ///Marker type for the `code_count` field + pub struct code_count(()); } } @@ -455,8 +455,8 @@ where impl CreateInviteCodesBuilder where St: create_invite_codes_state::State, - St::CodeCount: create_invite_codes_state::IsSet, St::UseCount: create_invite_codes_state::IsSet, + St::CodeCount: create_invite_codes_state::IsSet, { /// Build the final struct. pub fn build(self) -> CreateInviteCodes { diff --git a/services/types/src/com_atproto/server/delete_session.rs b/services/types/src/com_atproto/server/delete_session.rs index 0fc5f59..a246114 100644 --- a/services/types/src/com_atproto/server/delete_session.rs +++ b/services/types/src/com_atproto/server/delete_session.rs @@ -10,11 +10,62 @@ use alloc::collections::BTreeMap; #[allow(unused_imports)] use core::marker::PhantomData; -use jacquard_common::{BosStr, DefaultStr, FromStaticStr}; +use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::value::Data; -use jacquard_derive::IntoStatic; +use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; + +#[derive( + Serialize, + Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic +)] + +#[serde(tag = "error", content = "message")] +pub enum DeleteSessionError { + #[serde(rename = "InvalidToken")] + InvalidToken(Option), + #[serde(rename = "ExpiredToken")] + ExpiredToken(Option), + /// Catch-all for unknown error codes. + #[serde(untagged)] + Other { error: SmolStr, message: Option }, +} + +impl core::fmt::Display for DeleteSessionError { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self { + Self::InvalidToken(msg) => { + write!(f, "InvalidToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ExpiredToken(msg) => { + write!(f, "ExpiredToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Other { error, message } => { + write!(f, "{}", error)?; + if let Some(msg) = message { + write!(f, ": {}", msg)?; + } + Ok(()) + } + } + } +} + /// XRPC request marker type. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Copy)] @@ -25,7 +76,7 @@ impl jacquard_common::xrpc::XrpcResp for DeleteSessionResponse { const NSID: &'static str = "com.atproto.server.deleteSession"; const ENCODING: &'static str = "application/json"; type Output = (); - type Err = jacquard_common::xrpc::GenericError; + type Err = DeleteSessionError; } impl jacquard_common::xrpc::XrpcRequest for DeleteSession { diff --git a/services/types/src/com_atproto/server/get_service_auth.rs b/services/types/src/com_atproto/server/get_service_auth.rs index d1352b6..1c78f2c 100644 --- a/services/types/src/com_atproto/server/get_service_auth.rs +++ b/services/types/src/com_atproto/server/get_service_auth.rs @@ -12,7 +12,7 @@ use alloc::collections::BTreeMap; use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; use jacquard_common::deps::smol_str::SmolStr; -use jacquard_common::types::string::{Did, Nsid}; +use jacquard_common::types::string::Nsid; use jacquard_common::types::value::Data; use jacquard_derive::{IntoStatic, open_union}; use serde::{Serialize, Deserialize}; @@ -20,7 +20,7 @@ use serde::{Serialize, Deserialize}; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct GetServiceAuth { - pub aud: Did, + pub aud: S, #[serde(skip_serializing_if = "Option::is_none")] pub exp: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -138,7 +138,7 @@ pub mod get_service_auth_state { /// Builder for constructing an instance of this type. pub struct GetServiceAuthBuilder { _state: PhantomData St>, - _fields: (Option>, Option, Option>), + _fields: (Option, Option, Option>), _type: PhantomData S>, } @@ -168,7 +168,7 @@ where /// Set the `aud` field (required) pub fn aud( mut self, - value: impl Into>, + value: impl Into, ) -> GetServiceAuthBuilder> { self._fields.0 = Option::Some(value.into()); GetServiceAuthBuilder { diff --git a/services/types/src/com_atproto/server/refresh_session.rs b/services/types/src/com_atproto/server/refresh_session.rs index 060e9ba..3a0c01e 100644 --- a/services/types/src/com_atproto/server/refresh_session.rs +++ b/services/types/src/com_atproto/server/refresh_session.rs @@ -26,6 +26,12 @@ pub struct RefreshSessionOutput { pub did: Did, #[serde(skip_serializing_if = "Option::is_none")] pub did_doc: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub email_auth_factor: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub email_confirmed: Option, pub handle: Handle, pub refresh_jwt: S, ///Hosting status of the account. If not specified, then assume 'active'. @@ -143,6 +149,10 @@ where pub enum RefreshSessionError { #[serde(rename = "AccountTakedown")] AccountTakedown(Option), + #[serde(rename = "InvalidToken")] + InvalidToken(Option), + #[serde(rename = "ExpiredToken")] + ExpiredToken(Option), /// Catch-all for unknown error codes. #[serde(untagged)] Other { error: SmolStr, message: Option }, @@ -158,6 +168,20 @@ impl core::fmt::Display for RefreshSessionError { } Ok(()) } + Self::InvalidToken(msg) => { + write!(f, "InvalidToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::ExpiredToken(msg) => { + write!(f, "ExpiredToken")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } Self::Other { error, message } => { write!(f, "{}", error)?; if let Some(msg) = message { diff --git a/services/types/src/com_atproto/sync/get_blocks.rs b/services/types/src/com_atproto/sync/get_blocks.rs index a612a0d..29655db 100644 --- a/services/types/src/com_atproto/sync/get_blocks.rs +++ b/services/types/src/com_atproto/sync/get_blocks.rs @@ -163,37 +163,37 @@ pub mod get_blocks_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cids; type Did; + type Cids; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cids = Unset; type Did = Unset; - } - ///State transition - sets the `cids` field to Set - pub struct SetCids(PhantomData St>); - impl sealed::Sealed for SetCids {} - impl State for SetCids { - type Cids = Set; - type Did = St::Did; + type Cids = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Cids = St::Cids; type Did = Set; + type Cids = St::Cids; + } + ///State transition - sets the `cids` field to Set + pub struct SetCids(PhantomData St>); + impl sealed::Sealed for SetCids {} + impl State for SetCids { + type Did = St::Did; + type Cids = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cids` field - pub struct cids(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `cids` field + pub struct cids(()); } } @@ -263,8 +263,8 @@ where impl GetBlocksBuilder where St: get_blocks_state::State, - St::Cids: get_blocks_state::IsSet, St::Did: get_blocks_state::IsSet, + St::Cids: get_blocks_state::IsSet, { /// Build the final struct. pub fn build(self) -> GetBlocks { diff --git a/services/types/src/com_atproto/sync/get_record.rs b/services/types/src/com_atproto/sync/get_record.rs index 89af302..56139ce 100644 --- a/services/types/src/com_atproto/sync/get_record.rs +++ b/services/types/src/com_atproto/sync/get_record.rs @@ -164,51 +164,51 @@ pub mod get_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; type Did; type Rkey; + type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Collection = Unset; type Did = Unset; type Rkey = Unset; - } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData St>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { - type Collection = Set; - type Did = St::Did; - type Rkey = St::Rkey; + type Collection = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Collection = St::Collection; type Did = Set; type Rkey = St::Rkey; + type Collection = St::Collection; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData St>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Collection = St::Collection; type Did = St::Did; type Rkey = Set; + type Collection = St::Collection; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData St>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Did = St::Did; + type Rkey = St::Rkey; + type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `collection` field - pub struct collection(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `rkey` field pub struct rkey(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -297,9 +297,9 @@ where impl GetRecordBuilder where St: get_record_state::State, - St::Collection: get_record_state::IsSet, St::Did: get_record_state::IsSet, St::Rkey: get_record_state::IsSet, + St::Collection: get_record_state::IsSet, { /// Build the final struct. pub fn build(self) -> GetRecord { diff --git a/services/types/src/com_atproto/sync/subscribe_repos.rs b/services/types/src/com_atproto/sync/subscribe_repos.rs index f2197b6..0e93aaa 100644 --- a/services/types/src/com_atproto/sync/subscribe_repos.rs +++ b/services/types/src/com_atproto/sync/subscribe_repos.rs @@ -664,67 +664,67 @@ pub mod account_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Active; type Did; - type Seq; type Time; + type Seq; + type Active; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Active = Unset; type Did = Unset; - type Seq = Unset; type Time = Unset; - } - ///State transition - sets the `active` field to Set - pub struct SetActive(PhantomData St>); - impl sealed::Sealed for SetActive {} - impl State for SetActive { - type Active = Set; - type Did = St::Did; - type Seq = St::Seq; - type Time = St::Time; + type Seq = Unset; + type Active = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Active = St::Active; type Did = Set; - type Seq = St::Seq; type Time = St::Time; + type Seq = St::Seq; + type Active = St::Active; + } + ///State transition - sets the `time` field to Set + pub struct SetTime(PhantomData St>); + impl sealed::Sealed for SetTime {} + impl State for SetTime { + type Did = St::Did; + type Time = Set; + type Seq = St::Seq; + type Active = St::Active; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData St>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { - type Active = St::Active; type Did = St::Did; - type Seq = Set; type Time = St::Time; - } - ///State transition - sets the `time` field to Set - pub struct SetTime(PhantomData St>); - impl sealed::Sealed for SetTime {} - impl State for SetTime { + type Seq = Set; type Active = St::Active; + } + ///State transition - sets the `active` field to Set + pub struct SetActive(PhantomData St>); + impl sealed::Sealed for SetActive {} + impl State for SetActive { type Did = St::Did; + type Time = St::Time; type Seq = St::Seq; - type Time = Set; + type Active = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `active` field - pub struct active(()); ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `seq` field - pub struct seq(()); ///Marker type for the `time` field pub struct time(()); + ///Marker type for the `seq` field + pub struct seq(()); + ///Marker type for the `active` field + pub struct active(()); } } @@ -851,10 +851,10 @@ where impl AccountBuilder where St: account_state::State, - St::Active: account_state::IsSet, St::Did: account_state::IsSet, - St::Seq: account_state::IsSet, St::Time: account_state::IsSet, + St::Seq: account_state::IsSet, + St::Active: account_state::IsSet, { /// Build the final struct. pub fn build(self) -> Account { @@ -1305,205 +1305,205 @@ pub mod commit_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Blobs; - type Blocks; - type Commit; type Ops; - type Rebase; type Repo; + type TooBig; + type Rebase; type Rev; - type Seq; type Time; - type TooBig; + type Commit; + type Blobs; + type Seq; + type Blocks; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Blobs = Unset; - type Blocks = Unset; - type Commit = Unset; type Ops = Unset; - type Rebase = Unset; type Repo = Unset; + type TooBig = Unset; + type Rebase = Unset; type Rev = Unset; - type Seq = Unset; type Time = Unset; - type TooBig = Unset; + type Commit = Unset; + type Blobs = Unset; + type Seq = Unset; + type Blocks = Unset; } - ///State transition - sets the `blobs` field to Set - pub struct SetBlobs(PhantomData St>); - impl sealed::Sealed for SetBlobs {} - impl State for SetBlobs { - type Blobs = Set; - type Blocks = St::Blocks; - type Commit = St::Commit; - type Ops = St::Ops; - type Rebase = St::Rebase; + ///State transition - sets the `ops` field to Set + pub struct SetOps(PhantomData St>); + impl sealed::Sealed for SetOps {} + impl State for SetOps { + type Ops = Set; type Repo = St::Repo; - type Rev = St::Rev; - type Seq = St::Seq; - type Time = St::Time; type TooBig = St::TooBig; - } - ///State transition - sets the `blocks` field to Set - pub struct SetBlocks(PhantomData St>); - impl sealed::Sealed for SetBlocks {} - impl State for SetBlocks { - type Blobs = St::Blobs; - type Blocks = Set; - type Commit = St::Commit; - type Ops = St::Ops; type Rebase = St::Rebase; - type Repo = St::Repo; type Rev = St::Rev; - type Seq = St::Seq; type Time = St::Time; - type TooBig = St::TooBig; - } - ///State transition - sets the `commit` field to Set - pub struct SetCommit(PhantomData St>); - impl sealed::Sealed for SetCommit {} - impl State for SetCommit { + type Commit = St::Commit; type Blobs = St::Blobs; + type Seq = St::Seq; type Blocks = St::Blocks; - type Commit = Set; + } + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData St>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { type Ops = St::Ops; + type Repo = Set; + type TooBig = St::TooBig; type Rebase = St::Rebase; - type Repo = St::Repo; type Rev = St::Rev; - type Seq = St::Seq; type Time = St::Time; - type TooBig = St::TooBig; - } - ///State transition - sets the `ops` field to Set - pub struct SetOps(PhantomData St>); - impl sealed::Sealed for SetOps {} - impl State for SetOps { + type Commit = St::Commit; type Blobs = St::Blobs; + type Seq = St::Seq; type Blocks = St::Blocks; - type Commit = St::Commit; - type Ops = Set; - type Rebase = St::Rebase; + } + ///State transition - sets the `too_big` field to Set + pub struct SetTooBig(PhantomData St>); + impl sealed::Sealed for SetTooBig {} + impl State for SetTooBig { + type Ops = St::Ops; type Repo = St::Repo; + type TooBig = Set; + type Rebase = St::Rebase; type Rev = St::Rev; - type Seq = St::Seq; type Time = St::Time; - type TooBig = St::TooBig; + type Commit = St::Commit; + type Blobs = St::Blobs; + type Seq = St::Seq; + type Blocks = St::Blocks; } ///State transition - sets the `rebase` field to Set pub struct SetRebase(PhantomData St>); impl sealed::Sealed for SetRebase {} impl State for SetRebase { - type Blobs = St::Blobs; - type Blocks = St::Blocks; - type Commit = St::Commit; type Ops = St::Ops; - type Rebase = Set; type Repo = St::Repo; + type TooBig = St::TooBig; + type Rebase = Set; type Rev = St::Rev; - type Seq = St::Seq; type Time = St::Time; - type TooBig = St::TooBig; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData St>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { - type Blobs = St::Blobs; - type Blocks = St::Blocks; type Commit = St::Commit; - type Ops = St::Ops; - type Rebase = St::Rebase; - type Repo = Set; - type Rev = St::Rev; + type Blobs = St::Blobs; type Seq = St::Seq; - type Time = St::Time; - type TooBig = St::TooBig; + type Blocks = St::Blocks; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData St>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Blobs = St::Blobs; - type Blocks = St::Blocks; - type Commit = St::Commit; type Ops = St::Ops; - type Rebase = St::Rebase; type Repo = St::Repo; + type TooBig = St::TooBig; + type Rebase = St::Rebase; type Rev = Set; - type Seq = St::Seq; type Time = St::Time; - type TooBig = St::TooBig; - } - ///State transition - sets the `seq` field to Set - pub struct SetSeq(PhantomData St>); - impl sealed::Sealed for SetSeq {} - impl State for SetSeq { + type Commit = St::Commit; type Blobs = St::Blobs; + type Seq = St::Seq; type Blocks = St::Blocks; - type Commit = St::Commit; - type Ops = St::Ops; - type Rebase = St::Rebase; - type Repo = St::Repo; - type Rev = St::Rev; - type Seq = Set; - type Time = St::Time; - type TooBig = St::TooBig; } ///State transition - sets the `time` field to Set pub struct SetTime(PhantomData St>); impl sealed::Sealed for SetTime {} impl State for SetTime { + type Ops = St::Ops; + type Repo = St::Repo; + type TooBig = St::TooBig; + type Rebase = St::Rebase; + type Rev = St::Rev; + type Time = Set; + type Commit = St::Commit; type Blobs = St::Blobs; + type Seq = St::Seq; type Blocks = St::Blocks; - type Commit = St::Commit; + } + ///State transition - sets the `commit` field to Set + pub struct SetCommit(PhantomData St>); + impl sealed::Sealed for SetCommit {} + impl State for SetCommit { type Ops = St::Ops; - type Rebase = St::Rebase; type Repo = St::Repo; + type TooBig = St::TooBig; + type Rebase = St::Rebase; type Rev = St::Rev; + type Time = St::Time; + type Commit = Set; + type Blobs = St::Blobs; type Seq = St::Seq; - type Time = Set; + type Blocks = St::Blocks; + } + ///State transition - sets the `blobs` field to Set + pub struct SetBlobs(PhantomData St>); + impl sealed::Sealed for SetBlobs {} + impl State for SetBlobs { + type Ops = St::Ops; + type Repo = St::Repo; type TooBig = St::TooBig; + type Rebase = St::Rebase; + type Rev = St::Rev; + type Time = St::Time; + type Commit = St::Commit; + type Blobs = Set; + type Seq = St::Seq; + type Blocks = St::Blocks; } - ///State transition - sets the `too_big` field to Set - pub struct SetTooBig(PhantomData St>); - impl sealed::Sealed for SetTooBig {} - impl State for SetTooBig { + ///State transition - sets the `seq` field to Set + pub struct SetSeq(PhantomData St>); + impl sealed::Sealed for SetSeq {} + impl State for SetSeq { + type Ops = St::Ops; + type Repo = St::Repo; + type TooBig = St::TooBig; + type Rebase = St::Rebase; + type Rev = St::Rev; + type Time = St::Time; + type Commit = St::Commit; type Blobs = St::Blobs; + type Seq = Set; type Blocks = St::Blocks; - type Commit = St::Commit; + } + ///State transition - sets the `blocks` field to Set + pub struct SetBlocks(PhantomData St>); + impl sealed::Sealed for SetBlocks {} + impl State for SetBlocks { type Ops = St::Ops; - type Rebase = St::Rebase; type Repo = St::Repo; + type TooBig = St::TooBig; + type Rebase = St::Rebase; type Rev = St::Rev; - type Seq = St::Seq; type Time = St::Time; - type TooBig = Set; + type Commit = St::Commit; + type Blobs = St::Blobs; + type Seq = St::Seq; + type Blocks = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `blobs` field - pub struct blobs(()); - ///Marker type for the `blocks` field - pub struct blocks(()); - ///Marker type for the `commit` field - pub struct commit(()); ///Marker type for the `ops` field pub struct ops(()); - ///Marker type for the `rebase` field - pub struct rebase(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `too_big` field + pub struct too_big(()); + ///Marker type for the `rebase` field + pub struct rebase(()); ///Marker type for the `rev` field pub struct rev(()); - ///Marker type for the `seq` field - pub struct seq(()); ///Marker type for the `time` field pub struct time(()); - ///Marker type for the `too_big` field - pub struct too_big(()); + ///Marker type for the `commit` field + pub struct commit(()); + ///Marker type for the `blobs` field + pub struct blobs(()); + ///Marker type for the `seq` field + pub struct seq(()); + ///Marker type for the `blocks` field + pub struct blocks(()); } } @@ -1777,16 +1777,16 @@ where impl CommitBuilder where St: commit_state::State, - St::Blobs: commit_state::IsSet, - St::Blocks: commit_state::IsSet, - St::Commit: commit_state::IsSet, St::Ops: commit_state::IsSet, - St::Rebase: commit_state::IsSet, St::Repo: commit_state::IsSet, + St::TooBig: commit_state::IsSet, + St::Rebase: commit_state::IsSet, St::Rev: commit_state::IsSet, - St::Seq: commit_state::IsSet, St::Time: commit_state::IsSet, - St::TooBig: commit_state::IsSet, + St::Commit: commit_state::IsSet, + St::Blobs: commit_state::IsSet, + St::Seq: commit_state::IsSet, + St::Blocks: commit_state::IsSet, { /// Build the final struct. pub fn build(self) -> Commit { @@ -1837,50 +1837,50 @@ pub mod identity_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; - type Seq; type Time; + type Seq; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; - type Seq = Unset; type Time = Unset; + type Seq = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; - type Seq = St::Seq; - type Time = St::Time; - } - ///State transition - sets the `seq` field to Set - pub struct SetSeq(PhantomData St>); - impl sealed::Sealed for SetSeq {} - impl State for SetSeq { - type Did = St::Did; - type Seq = Set; type Time = St::Time; + type Seq = St::Seq; } ///State transition - sets the `time` field to Set pub struct SetTime(PhantomData St>); impl sealed::Sealed for SetTime {} impl State for SetTime { type Did = St::Did; - type Seq = St::Seq; type Time = Set; + type Seq = St::Seq; + } + ///State transition - sets the `seq` field to Set + pub struct SetSeq(PhantomData St>); + impl sealed::Sealed for SetSeq {} + impl State for SetSeq { + type Did = St::Did; + type Time = St::Time; + type Seq = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `seq` field - pub struct seq(()); ///Marker type for the `time` field pub struct time(()); + ///Marker type for the `seq` field + pub struct seq(()); } } @@ -1983,8 +1983,8 @@ impl IdentityBuilder where St: identity_state::State, St::Did: identity_state::IsSet, - St::Seq: identity_state::IsSet, St::Time: identity_state::IsSet, + St::Seq: identity_state::IsSet, { /// Build the final struct. pub fn build(self) -> Identity { @@ -2085,37 +2085,37 @@ pub mod repo_op_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Action; type Path; + type Action; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Action = Unset; type Path = Unset; - } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData St>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type Action = Set; - type Path = St::Path; + type Action = Unset; } ///State transition - sets the `path` field to Set pub struct SetPath(PhantomData St>); impl sealed::Sealed for SetPath {} impl State for SetPath { - type Action = St::Action; type Path = Set; + type Action = St::Action; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData St>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { + type Path = St::Path; + type Action = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `action` field - pub struct action(()); ///Marker type for the `path` field pub struct path(()); + ///Marker type for the `action` field + pub struct action(()); } } @@ -2216,8 +2216,8 @@ impl RepoOpBuilder { impl RepoOpBuilder where St: repo_op_state::State, - St::Action: repo_op_state::IsSet, St::Path: repo_op_state::IsSet, + St::Action: repo_op_state::IsSet, { /// Build the final struct. pub fn build(self) -> RepoOp { @@ -2251,83 +2251,83 @@ pub mod sync_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Blocks; type Did; type Rev; type Seq; + type Blocks; type Time; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Blocks = Unset; type Did = Unset; type Rev = Unset; type Seq = Unset; + type Blocks = Unset; type Time = Unset; } - ///State transition - sets the `blocks` field to Set - pub struct SetBlocks(PhantomData St>); - impl sealed::Sealed for SetBlocks {} - impl State for SetBlocks { - type Blocks = Set; - type Did = St::Did; - type Rev = St::Rev; - type Seq = St::Seq; - type Time = St::Time; - } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Blocks = St::Blocks; type Did = Set; type Rev = St::Rev; type Seq = St::Seq; + type Blocks = St::Blocks; type Time = St::Time; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData St>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Blocks = St::Blocks; type Did = St::Did; type Rev = Set; type Seq = St::Seq; + type Blocks = St::Blocks; type Time = St::Time; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData St>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { - type Blocks = St::Blocks; type Did = St::Did; type Rev = St::Rev; type Seq = Set; + type Blocks = St::Blocks; + type Time = St::Time; + } + ///State transition - sets the `blocks` field to Set + pub struct SetBlocks(PhantomData St>); + impl sealed::Sealed for SetBlocks {} + impl State for SetBlocks { + type Did = St::Did; + type Rev = St::Rev; + type Seq = St::Seq; + type Blocks = Set; type Time = St::Time; } ///State transition - sets the `time` field to Set pub struct SetTime(PhantomData St>); impl sealed::Sealed for SetTime {} impl State for SetTime { - type Blocks = St::Blocks; type Did = St::Did; type Rev = St::Rev; type Seq = St::Seq; + type Blocks = St::Blocks; type Time = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `blocks` field - pub struct blocks(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `rev` field pub struct rev(()); ///Marker type for the `seq` field pub struct seq(()); + ///Marker type for the `blocks` field + pub struct blocks(()); ///Marker type for the `time` field pub struct time(()); } @@ -2453,10 +2453,10 @@ where impl SyncBuilder where St: sync_state::State, - St::Blocks: sync_state::IsSet, St::Did: sync_state::IsSet, St::Rev: sync_state::IsSet, St::Seq: sync_state::IsSet, + St::Blocks: sync_state::IsSet, St::Time: sync_state::IsSet, { /// Build the final struct. diff --git a/services/types/src/com_atproto/temp.rs b/services/types/src/com_atproto/temp.rs index 8546d06..d8d777e 100644 --- a/services/types/src/com_atproto/temp.rs +++ b/services/types/src/com_atproto/temp.rs @@ -4,6 +4,9 @@ // Any manual changes will be overwritten on the next regeneration. pub mod add_reserved_handle; +pub mod check_handle_availability; pub mod check_signup_queue; +pub mod dereference_scope; pub mod fetch_labels; -pub mod request_phone_verification; \ No newline at end of file +pub mod request_phone_verification; +pub mod revoke_account_credentials; \ No newline at end of file diff --git a/services/types/src/fm_teal/actor/status.rs b/services/types/src/fm_teal/actor/status.rs index 5c7d60b..3949cc2 100644 --- a/services/types/src/fm_teal/actor/status.rs +++ b/services/types/src/fm_teal/actor/status.rs @@ -117,37 +117,37 @@ pub mod status_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Item; type Time; + type Item; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Item = Unset; type Time = Unset; - } - ///State transition - sets the `item` field to Set - pub struct SetItem(PhantomData St>); - impl sealed::Sealed for SetItem {} - impl State for SetItem { - type Item = Set; - type Time = St::Time; + type Item = Unset; } ///State transition - sets the `time` field to Set pub struct SetTime(PhantomData St>); impl sealed::Sealed for SetTime {} impl State for SetTime { - type Item = St::Item; type Time = Set; + type Item = St::Item; + } + ///State transition - sets the `item` field to Set + pub struct SetItem(PhantomData St>); + impl sealed::Sealed for SetItem {} + impl State for SetItem { + type Time = St::Time; + type Item = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `item` field - pub struct item(()); ///Marker type for the `time` field pub struct time(()); + ///Marker type for the `item` field + pub struct item(()); } } @@ -230,8 +230,8 @@ where impl StatusBuilder where St: status_state::State, - St::Item: status_state::IsSet, St::Time: status_state::IsSet, + St::Item: status_state::IsSet, { /// Build the final struct. pub fn build(self) -> Status { diff --git a/services/types/src/fm_teal/feed.rs b/services/types/src/fm_teal/feed.rs index c46ba38..b0c99b6 100644 --- a/services/types/src/fm_teal/feed.rs +++ b/services/types/src/fm_teal/feed.rs @@ -512,37 +512,37 @@ pub mod play_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type TrackName; type Artists; + type TrackName; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type TrackName = Unset; type Artists = Unset; - } - ///State transition - sets the `track_name` field to Set - pub struct SetTrackName(PhantomData St>); - impl sealed::Sealed for SetTrackName {} - impl State for SetTrackName { - type TrackName = Set; - type Artists = St::Artists; + type TrackName = Unset; } ///State transition - sets the `artists` field to Set pub struct SetArtists(PhantomData St>); impl sealed::Sealed for SetArtists {} impl State for SetArtists { - type TrackName = St::TrackName; type Artists = Set; + type TrackName = St::TrackName; + } + ///State transition - sets the `track_name` field to Set + pub struct SetTrackName(PhantomData St>); + impl sealed::Sealed for SetTrackName {} + impl State for SetTrackName { + type Artists = St::Artists; + type TrackName = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `track_name` field - pub struct track_name(()); ///Marker type for the `artists` field pub struct artists(()); + ///Marker type for the `track_name` field + pub struct track_name(()); } } @@ -843,8 +843,8 @@ impl PlayViewBuilder { impl PlayViewBuilder where St: play_view_state::State, - St::TrackName: play_view_state::IsSet, St::Artists: play_view_state::IsSet, + St::TrackName: play_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> PlayView { diff --git a/services/types/src/fm_teal/feed/social/playlist_item.rs b/services/types/src/fm_teal/feed/social/playlist_item.rs index 051608e..4e2a752 100644 --- a/services/types/src/fm_teal/feed/social/playlist_item.rs +++ b/services/types/src/fm_teal/feed/social/playlist_item.rs @@ -119,49 +119,49 @@ pub mod playlist_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Track; type CreatedAt; + type Track; type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Track = Unset; type CreatedAt = Unset; + type Track = Unset; type Subject = Unset; } - ///State transition - sets the `track` field to Set - pub struct SetTrack(PhantomData St>); - impl sealed::Sealed for SetTrack {} - impl State for SetTrack { - type Track = Set; - type CreatedAt = St::CreatedAt; - type Subject = St::Subject; - } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData St>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Track = St::Track; type CreatedAt = Set; + type Track = St::Track; + type Subject = St::Subject; + } + ///State transition - sets the `track` field to Set + pub struct SetTrack(PhantomData St>); + impl sealed::Sealed for SetTrack {} + impl State for SetTrack { + type CreatedAt = St::CreatedAt; + type Track = Set; type Subject = St::Subject; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Track = St::Track; type CreatedAt = St::CreatedAt; + type Track = St::Track; type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `track` field - pub struct track(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `track` field + pub struct track(()); ///Marker type for the `subject` field pub struct subject(()); } @@ -265,8 +265,8 @@ where impl PlaylistItemBuilder where St: playlist_item_state::State, - St::Track: playlist_item_state::IsSet, St::CreatedAt: playlist_item_state::IsSet, + St::Track: playlist_item_state::IsSet, St::Subject: playlist_item_state::IsSet, { /// Build the final struct. diff --git a/services/types/src/fm_teal/feed/social/post.rs b/services/types/src/fm_teal/feed/social/post.rs index 0470a91..a3e002d 100644 --- a/services/types/src/fm_teal/feed/social/post.rs +++ b/services/types/src/fm_teal/feed/social/post.rs @@ -278,37 +278,37 @@ pub mod post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Text; type CreatedAt; + type Text; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Text = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `text` field to Set - pub struct SetText(PhantomData St>); - impl sealed::Sealed for SetText {} - impl State for SetText { - type Text = Set; - type CreatedAt = St::CreatedAt; + type Text = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData St>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Text = St::Text; type CreatedAt = Set; + type Text = St::Text; + } + ///State transition - sets the `text` field to Set + pub struct SetText(PhantomData St>); + impl sealed::Sealed for SetText {} + impl State for SetText { + type CreatedAt = St::CreatedAt; + type Text = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `text` field - pub struct text(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `text` field + pub struct text(()); } } @@ -579,8 +579,8 @@ impl PostBuilder { impl PostBuilder where St: post_state::State, - St::Text: post_state::IsSet, St::CreatedAt: post_state::IsSet, + St::Text: post_state::IsSet, { /// Build the final struct. pub fn build(self) -> Post { @@ -882,37 +882,37 @@ pub mod reply_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Parent; type Root; + type Parent; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Parent = Unset; type Root = Unset; - } - ///State transition - sets the `parent` field to Set - pub struct SetParent(PhantomData St>); - impl sealed::Sealed for SetParent {} - impl State for SetParent { - type Parent = Set; - type Root = St::Root; + type Parent = Unset; } ///State transition - sets the `root` field to Set pub struct SetRoot(PhantomData St>); impl sealed::Sealed for SetRoot {} impl State for SetRoot { - type Parent = St::Parent; type Root = Set; + type Parent = St::Parent; + } + ///State transition - sets the `parent` field to Set + pub struct SetParent(PhantomData St>); + impl sealed::Sealed for SetParent {} + impl State for SetParent { + type Root = St::Root; + type Parent = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `parent` field - pub struct parent(()); ///Marker type for the `root` field pub struct root(()); + ///Marker type for the `parent` field + pub struct parent(()); } } @@ -982,8 +982,8 @@ where impl ReplyRefBuilder where St: reply_ref_state::State, - St::Parent: reply_ref_state::IsSet, St::Root: reply_ref_state::IsSet, + St::Parent: reply_ref_state::IsSet, { /// Build the final struct. pub fn build(self) -> ReplyRef { diff --git a/services/types/src/fm_teal/feed/social/repost.rs b/services/types/src/fm_teal/feed/social/repost.rs index dc318d4..308cb52 100644 --- a/services/types/src/fm_teal/feed/social/repost.rs +++ b/services/types/src/fm_teal/feed/social/repost.rs @@ -114,37 +114,37 @@ pub mod repost_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = St::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = St::CreatedAt; type Subject = Set; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = St::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -214,8 +214,8 @@ where impl RepostBuilder where St: repost_state::State, - St::CreatedAt: repost_state::IsSet, St::Subject: repost_state::IsSet, + St::CreatedAt: repost_state::IsSet, { /// Build the final struct. pub fn build(self) -> Repost { diff --git a/services/types/src/fm_teal/music.rs b/services/types/src/fm_teal/music.rs index f3b657e..5daff89 100644 --- a/services/types/src/fm_teal/music.rs +++ b/services/types/src/fm_teal/music.rs @@ -283,67 +283,67 @@ pub mod album_summary_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Mbid; + type ArtistName; type Name; type PlayCount; - type ArtistName; + type Mbid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Mbid = Unset; + type ArtistName = Unset; type Name = Unset; type PlayCount = Unset; - type ArtistName = Unset; + type Mbid = Unset; } - ///State transition - sets the `mbid` field to Set - pub struct SetMbid(PhantomData St>); - impl sealed::Sealed for SetMbid {} - impl State for SetMbid { - type Mbid = Set; + ///State transition - sets the `artist_name` field to Set + pub struct SetArtistName(PhantomData St>); + impl sealed::Sealed for SetArtistName {} + impl State for SetArtistName { + type ArtistName = Set; type Name = St::Name; type PlayCount = St::PlayCount; - type ArtistName = St::ArtistName; + type Mbid = St::Mbid; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { - type Mbid = St::Mbid; + type ArtistName = St::ArtistName; type Name = Set; type PlayCount = St::PlayCount; - type ArtistName = St::ArtistName; + type Mbid = St::Mbid; } ///State transition - sets the `play_count` field to Set pub struct SetPlayCount(PhantomData St>); impl sealed::Sealed for SetPlayCount {} impl State for SetPlayCount { - type Mbid = St::Mbid; + type ArtistName = St::ArtistName; type Name = St::Name; type PlayCount = Set; - type ArtistName = St::ArtistName; - } - ///State transition - sets the `artist_name` field to Set - pub struct SetArtistName(PhantomData St>); - impl sealed::Sealed for SetArtistName {} - impl State for SetArtistName { type Mbid = St::Mbid; + } + ///State transition - sets the `mbid` field to Set + pub struct SetMbid(PhantomData St>); + impl sealed::Sealed for SetMbid {} + impl State for SetMbid { + type ArtistName = St::ArtistName; type Name = St::Name; type PlayCount = St::PlayCount; - type ArtistName = Set; + type Mbid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `mbid` field - pub struct mbid(()); + ///Marker type for the `artist_name` field + pub struct artist_name(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `play_count` field pub struct play_count(()); - ///Marker type for the `artist_name` field - pub struct artist_name(()); + ///Marker type for the `mbid` field + pub struct mbid(()); } } @@ -490,10 +490,10 @@ impl AlbumSummaryBuilder { impl AlbumSummaryBuilder where St: album_summary_state::State, - St::Mbid: album_summary_state::IsSet, + St::ArtistName: album_summary_state::IsSet, St::Name: album_summary_state::IsSet, St::PlayCount: album_summary_state::IsSet, - St::ArtistName: album_summary_state::IsSet, + St::Mbid: album_summary_state::IsSet, { /// Build the final struct. pub fn build(self) -> AlbumSummary { @@ -812,84 +812,84 @@ pub mod album_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Tracks; - type PlayCount; type Name; type Mbid; type ArtistName; + type PlayCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Tracks = Unset; - type PlayCount = Unset; type Name = Unset; type Mbid = Unset; type ArtistName = Unset; + type PlayCount = Unset; } ///State transition - sets the `tracks` field to Set pub struct SetTracks(PhantomData St>); impl sealed::Sealed for SetTracks {} impl State for SetTracks { type Tracks = Set; - type PlayCount = St::PlayCount; - type Name = St::Name; - type Mbid = St::Mbid; - type ArtistName = St::ArtistName; - } - ///State transition - sets the `play_count` field to Set - pub struct SetPlayCount(PhantomData St>); - impl sealed::Sealed for SetPlayCount {} - impl State for SetPlayCount { - type Tracks = St::Tracks; - type PlayCount = Set; type Name = St::Name; type Mbid = St::Mbid; type ArtistName = St::ArtistName; + type PlayCount = St::PlayCount; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { type Tracks = St::Tracks; - type PlayCount = St::PlayCount; type Name = Set; type Mbid = St::Mbid; type ArtistName = St::ArtistName; + type PlayCount = St::PlayCount; } ///State transition - sets the `mbid` field to Set pub struct SetMbid(PhantomData St>); impl sealed::Sealed for SetMbid {} impl State for SetMbid { type Tracks = St::Tracks; - type PlayCount = St::PlayCount; type Name = St::Name; type Mbid = Set; type ArtistName = St::ArtistName; + type PlayCount = St::PlayCount; } ///State transition - sets the `artist_name` field to Set pub struct SetArtistName(PhantomData St>); impl sealed::Sealed for SetArtistName {} impl State for SetArtistName { type Tracks = St::Tracks; - type PlayCount = St::PlayCount; type Name = St::Name; type Mbid = St::Mbid; type ArtistName = Set; + type PlayCount = St::PlayCount; + } + ///State transition - sets the `play_count` field to Set + pub struct SetPlayCount(PhantomData St>); + impl sealed::Sealed for SetPlayCount {} + impl State for SetPlayCount { + type Tracks = St::Tracks; + type Name = St::Name; + type Mbid = St::Mbid; + type ArtistName = St::ArtistName; + type PlayCount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `tracks` field pub struct tracks(()); - ///Marker type for the `play_count` field - pub struct play_count(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `mbid` field pub struct mbid(()); ///Marker type for the `artist_name` field pub struct artist_name(()); + ///Marker type for the `play_count` field + pub struct play_count(()); } } @@ -1037,10 +1037,10 @@ impl AlbumViewBuilder where St: album_view_state::State, St::Tracks: album_view_state::IsSet, - St::PlayCount: album_view_state::IsSet, St::Name: album_view_state::IsSet, St::Mbid: album_view_state::IsSet, St::ArtistName: album_view_state::IsSet, + St::PlayCount: album_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> AlbumView { @@ -1081,37 +1081,37 @@ pub mod artist_listener_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type PlayCount; type Actor; + type PlayCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type PlayCount = Unset; type Actor = Unset; - } - ///State transition - sets the `play_count` field to Set - pub struct SetPlayCount(PhantomData St>); - impl sealed::Sealed for SetPlayCount {} - impl State for SetPlayCount { - type PlayCount = Set; - type Actor = St::Actor; + type PlayCount = Unset; } ///State transition - sets the `actor` field to Set pub struct SetActor(PhantomData St>); impl sealed::Sealed for SetActor {} impl State for SetActor { - type PlayCount = St::PlayCount; type Actor = Set; + type PlayCount = St::PlayCount; + } + ///State transition - sets the `play_count` field to Set + pub struct SetPlayCount(PhantomData St>); + impl sealed::Sealed for SetPlayCount {} + impl State for SetPlayCount { + type Actor = St::Actor; + type PlayCount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `play_count` field - pub struct play_count(()); ///Marker type for the `actor` field pub struct actor(()); + ///Marker type for the `play_count` field + pub struct play_count(()); } } @@ -1181,8 +1181,8 @@ where impl ArtistListenerViewBuilder where St: artist_listener_view_state::State, - St::PlayCount: artist_listener_view_state::IsSet, St::Actor: artist_listener_view_state::IsSet, + St::PlayCount: artist_listener_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> ArtistListenerView { @@ -1215,49 +1215,49 @@ pub mod artist_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Albums; type Name; + type Albums; type PlayCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Albums = Unset; type Name = Unset; + type Albums = Unset; type PlayCount = Unset; } - ///State transition - sets the `albums` field to Set - pub struct SetAlbums(PhantomData St>); - impl sealed::Sealed for SetAlbums {} - impl State for SetAlbums { - type Albums = Set; - type Name = St::Name; - type PlayCount = St::PlayCount; - } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { - type Albums = St::Albums; type Name = Set; + type Albums = St::Albums; + type PlayCount = St::PlayCount; + } + ///State transition - sets the `albums` field to Set + pub struct SetAlbums(PhantomData St>); + impl sealed::Sealed for SetAlbums {} + impl State for SetAlbums { + type Name = St::Name; + type Albums = Set; type PlayCount = St::PlayCount; } ///State transition - sets the `play_count` field to Set pub struct SetPlayCount(PhantomData St>); impl sealed::Sealed for SetPlayCount {} impl State for SetPlayCount { - type Albums = St::Albums; type Name = St::Name; + type Albums = St::Albums; type PlayCount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `albums` field - pub struct albums(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `albums` field + pub struct albums(()); ///Marker type for the `play_count` field pub struct play_count(()); } @@ -1366,8 +1366,8 @@ where impl ArtistViewBuilder where St: artist_view_state::State, - St::Albums: artist_view_state::IsSet, St::Name: artist_view_state::IsSet, + St::Albums: artist_view_state::IsSet, St::PlayCount: artist_view_state::IsSet, { /// Build the final struct. @@ -1407,8 +1407,8 @@ pub mod track_summary_state { pub trait State: sealed::Sealed { type Name; type ArtistName; - type PlayCount; type Uri; + type PlayCount; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -1416,8 +1416,8 @@ pub mod track_summary_state { impl State for Empty { type Name = Unset; type ArtistName = Unset; - type PlayCount = Unset; type Uri = Unset; + type PlayCount = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); @@ -1425,8 +1425,8 @@ pub mod track_summary_state { impl State for SetName { type Name = Set; type ArtistName = St::ArtistName; - type PlayCount = St::PlayCount; type Uri = St::Uri; + type PlayCount = St::PlayCount; } ///State transition - sets the `artist_name` field to Set pub struct SetArtistName(PhantomData St>); @@ -1434,17 +1434,8 @@ pub mod track_summary_state { impl State for SetArtistName { type Name = St::Name; type ArtistName = Set; - type PlayCount = St::PlayCount; - type Uri = St::Uri; - } - ///State transition - sets the `play_count` field to Set - pub struct SetPlayCount(PhantomData St>); - impl sealed::Sealed for SetPlayCount {} - impl State for SetPlayCount { - type Name = St::Name; - type ArtistName = St::ArtistName; - type PlayCount = Set; type Uri = St::Uri; + type PlayCount = St::PlayCount; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); @@ -1452,8 +1443,17 @@ pub mod track_summary_state { impl State for SetUri { type Name = St::Name; type ArtistName = St::ArtistName; - type PlayCount = St::PlayCount; type Uri = Set; + type PlayCount = St::PlayCount; + } + ///State transition - sets the `play_count` field to Set + pub struct SetPlayCount(PhantomData St>); + impl sealed::Sealed for SetPlayCount {} + impl State for SetPlayCount { + type Name = St::Name; + type ArtistName = St::ArtistName; + type Uri = St::Uri; + type PlayCount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -1462,10 +1462,10 @@ pub mod track_summary_state { pub struct name(()); ///Marker type for the `artist_name` field pub struct artist_name(()); - ///Marker type for the `play_count` field - pub struct play_count(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `play_count` field + pub struct play_count(()); } } @@ -1588,8 +1588,8 @@ where St: track_summary_state::State, St::Name: track_summary_state::IsSet, St::ArtistName: track_summary_state::IsSet, - St::PlayCount: track_summary_state::IsSet, St::Uri: track_summary_state::IsSet, + St::PlayCount: track_summary_state::IsSet, { /// Build the final struct. pub fn build(self) -> TrackSummary { diff --git a/services/types/src/fm_teal/richtext/facet.rs b/services/types/src/fm_teal/richtext/facet.rs index 3334324..241527b 100644 --- a/services/types/src/fm_teal/richtext/facet.rs +++ b/services/types/src/fm_teal/richtext/facet.rs @@ -73,37 +73,37 @@ pub mod facet_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Features; type Index; + type Features; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Features = Unset; type Index = Unset; - } - ///State transition - sets the `features` field to Set - pub struct SetFeatures(PhantomData St>); - impl sealed::Sealed for SetFeatures {} - impl State for SetFeatures { - type Features = Set; - type Index = St::Index; + type Features = Unset; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData St>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { - type Features = St::Features; type Index = Set; + type Features = St::Features; + } + ///State transition - sets the `features` field to Set + pub struct SetFeatures(PhantomData St>); + impl sealed::Sealed for SetFeatures {} + impl State for SetFeatures { + type Index = St::Index; + type Features = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `features` field - pub struct features(()); ///Marker type for the `index` field pub struct index(()); + ///Marker type for the `features` field + pub struct features(()); } } @@ -173,8 +173,8 @@ where impl FacetBuilder where St: facet_state::State, - St::Features: facet_state::IsSet, St::Index: facet_state::IsSet, + St::Features: facet_state::IsSet, { /// Build the final struct. pub fn build(self) -> Facet { diff --git a/services/types/src/fm_teal/search.rs b/services/types/src/fm_teal/search.rs index 54f12d1..7e45a9f 100644 --- a/services/types/src/fm_teal/search.rs +++ b/services/types/src/fm_teal/search.rs @@ -74,67 +74,67 @@ pub mod song_result_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; - type PlayCount; - type ArtistName; type TrackName; + type ArtistName; + type PlayCount; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; - type PlayCount = Unset; - type ArtistName = Unset; type TrackName = Unset; + type ArtistName = Unset; + type PlayCount = Unset; + type Uri = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type PlayCount = St::PlayCount; + ///State transition - sets the `track_name` field to Set + pub struct SetTrackName(PhantomData St>); + impl sealed::Sealed for SetTrackName {} + impl State for SetTrackName { + type TrackName = Set; type ArtistName = St::ArtistName; - type TrackName = St::TrackName; - } - ///State transition - sets the `play_count` field to Set - pub struct SetPlayCount(PhantomData St>); - impl sealed::Sealed for SetPlayCount {} - impl State for SetPlayCount { + type PlayCount = St::PlayCount; type Uri = St::Uri; - type PlayCount = Set; - type ArtistName = St::ArtistName; - type TrackName = St::TrackName; } ///State transition - sets the `artist_name` field to Set pub struct SetArtistName(PhantomData St>); impl sealed::Sealed for SetArtistName {} impl State for SetArtistName { - type Uri = St::Uri; - type PlayCount = St::PlayCount; - type ArtistName = Set; type TrackName = St::TrackName; + type ArtistName = Set; + type PlayCount = St::PlayCount; + type Uri = St::Uri; } - ///State transition - sets the `track_name` field to Set - pub struct SetTrackName(PhantomData St>); - impl sealed::Sealed for SetTrackName {} - impl State for SetTrackName { + ///State transition - sets the `play_count` field to Set + pub struct SetPlayCount(PhantomData St>); + impl sealed::Sealed for SetPlayCount {} + impl State for SetPlayCount { + type TrackName = St::TrackName; + type ArtistName = St::ArtistName; + type PlayCount = Set; type Uri = St::Uri; - type PlayCount = St::PlayCount; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type TrackName = St::TrackName; type ArtistName = St::ArtistName; - type TrackName = Set; + type PlayCount = St::PlayCount; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); - ///Marker type for the `play_count` field - pub struct play_count(()); - ///Marker type for the `artist_name` field - pub struct artist_name(()); ///Marker type for the `track_name` field pub struct track_name(()); + ///Marker type for the `artist_name` field + pub struct artist_name(()); + ///Marker type for the `play_count` field + pub struct play_count(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -275,10 +275,10 @@ where impl SongResultBuilder where St: song_result_state::State, - St::Uri: song_result_state::IsSet, - St::PlayCount: song_result_state::IsSet, - St::ArtistName: song_result_state::IsSet, St::TrackName: song_result_state::IsSet, + St::ArtistName: song_result_state::IsSet, + St::PlayCount: song_result_state::IsSet, + St::Uri: song_result_state::IsSet, { /// Build the final struct. pub fn build(self) -> SongResult { diff --git a/services/types/src/lib.rs b/services/types/src/lib.rs index 816934c..42dd007 100644 --- a/services/types/src/lib.rs +++ b/services/types/src/lib.rs @@ -18,6 +18,10 @@ pub mod chat_bsky; pub mod com_atproto; +#[cfg(feature = "com_germnetwork")] +pub mod com_germnetwork; + + #[cfg(feature = "fm_teal")] pub mod fm_teal; diff --git a/services/types/src/tools_ozone.rs b/services/types/src/tools_ozone.rs index b0ca3e5..9b29101 100644 --- a/services/types/src/tools_ozone.rs +++ b/services/types/src/tools_ozone.rs @@ -6,6 +6,8 @@ pub mod communication; pub mod hosting; pub mod moderation; +pub mod queue; +pub mod report; pub mod safelink; pub mod server; pub mod set; diff --git a/services/types/src/tools_ozone/communication.rs b/services/types/src/tools_ozone/communication.rs index b67105a..21bcf7a 100644 --- a/services/types/src/tools_ozone/communication.rs +++ b/services/types/src/tools_ozone/communication.rs @@ -79,127 +79,127 @@ pub mod template_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ContentMarkdown; - type CreatedAt; - type Disabled; - type Id; type LastUpdatedBy; - type Name; + type Disabled; type UpdatedAt; + type Name; + type Id; + type CreatedAt; + type ContentMarkdown; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ContentMarkdown = Unset; - type CreatedAt = Unset; - type Disabled = Unset; - type Id = Unset; type LastUpdatedBy = Unset; - type Name = Unset; + type Disabled = Unset; type UpdatedAt = Unset; + type Name = Unset; + type Id = Unset; + type CreatedAt = Unset; + type ContentMarkdown = Unset; } - ///State transition - sets the `content_markdown` field to Set - pub struct SetContentMarkdown(PhantomData St>); - impl sealed::Sealed for SetContentMarkdown {} - impl State for SetContentMarkdown { - type ContentMarkdown = Set; - type CreatedAt = St::CreatedAt; + ///State transition - sets the `last_updated_by` field to Set + pub struct SetLastUpdatedBy(PhantomData St>); + impl sealed::Sealed for SetLastUpdatedBy {} + impl State for SetLastUpdatedBy { + type LastUpdatedBy = Set; type Disabled = St::Disabled; - type Id = St::Id; - type LastUpdatedBy = St::LastUpdatedBy; - type Name = St::Name; type UpdatedAt = St::UpdatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type ContentMarkdown = St::ContentMarkdown; - type CreatedAt = Set; - type Disabled = St::Disabled; - type Id = St::Id; - type LastUpdatedBy = St::LastUpdatedBy; type Name = St::Name; - type UpdatedAt = St::UpdatedAt; + type Id = St::Id; + type CreatedAt = St::CreatedAt; + type ContentMarkdown = St::ContentMarkdown; } ///State transition - sets the `disabled` field to Set pub struct SetDisabled(PhantomData St>); impl sealed::Sealed for SetDisabled {} impl State for SetDisabled { - type ContentMarkdown = St::ContentMarkdown; - type CreatedAt = St::CreatedAt; - type Disabled = Set; - type Id = St::Id; type LastUpdatedBy = St::LastUpdatedBy; - type Name = St::Name; + type Disabled = Set; type UpdatedAt = St::UpdatedAt; - } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData St>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type ContentMarkdown = St::ContentMarkdown; - type CreatedAt = St::CreatedAt; - type Disabled = St::Disabled; - type Id = Set; - type LastUpdatedBy = St::LastUpdatedBy; type Name = St::Name; - type UpdatedAt = St::UpdatedAt; - } - ///State transition - sets the `last_updated_by` field to Set - pub struct SetLastUpdatedBy(PhantomData St>); - impl sealed::Sealed for SetLastUpdatedBy {} - impl State for SetLastUpdatedBy { - type ContentMarkdown = St::ContentMarkdown; + type Id = St::Id; type CreatedAt = St::CreatedAt; + type ContentMarkdown = St::ContentMarkdown; + } + ///State transition - sets the `updated_at` field to Set + pub struct SetUpdatedAt(PhantomData St>); + impl sealed::Sealed for SetUpdatedAt {} + impl State for SetUpdatedAt { + type LastUpdatedBy = St::LastUpdatedBy; type Disabled = St::Disabled; - type Id = St::Id; - type LastUpdatedBy = Set; + type UpdatedAt = Set; type Name = St::Name; - type UpdatedAt = St::UpdatedAt; + type Id = St::Id; + type CreatedAt = St::CreatedAt; + type ContentMarkdown = St::ContentMarkdown; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { - type ContentMarkdown = St::ContentMarkdown; - type CreatedAt = St::CreatedAt; + type LastUpdatedBy = St::LastUpdatedBy; type Disabled = St::Disabled; + type UpdatedAt = St::UpdatedAt; + type Name = Set; type Id = St::Id; + type CreatedAt = St::CreatedAt; + type ContentMarkdown = St::ContentMarkdown; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData St>); + impl sealed::Sealed for SetId {} + impl State for SetId { type LastUpdatedBy = St::LastUpdatedBy; - type Name = Set; + type Disabled = St::Disabled; type UpdatedAt = St::UpdatedAt; - } - ///State transition - sets the `updated_at` field to Set - pub struct SetUpdatedAt(PhantomData St>); - impl sealed::Sealed for SetUpdatedAt {} - impl State for SetUpdatedAt { - type ContentMarkdown = St::ContentMarkdown; + type Name = St::Name; + type Id = Set; type CreatedAt = St::CreatedAt; + type ContentMarkdown = St::ContentMarkdown; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type LastUpdatedBy = St::LastUpdatedBy; type Disabled = St::Disabled; + type UpdatedAt = St::UpdatedAt; + type Name = St::Name; type Id = St::Id; + type CreatedAt = Set; + type ContentMarkdown = St::ContentMarkdown; + } + ///State transition - sets the `content_markdown` field to Set + pub struct SetContentMarkdown(PhantomData St>); + impl sealed::Sealed for SetContentMarkdown {} + impl State for SetContentMarkdown { type LastUpdatedBy = St::LastUpdatedBy; + type Disabled = St::Disabled; + type UpdatedAt = St::UpdatedAt; type Name = St::Name; - type UpdatedAt = Set; + type Id = St::Id; + type CreatedAt = St::CreatedAt; + type ContentMarkdown = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `content_markdown` field - pub struct content_markdown(()); - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `disabled` field - pub struct disabled(()); - ///Marker type for the `id` field - pub struct id(()); ///Marker type for the `last_updated_by` field pub struct last_updated_by(()); - ///Marker type for the `name` field - pub struct name(()); + ///Marker type for the `disabled` field + pub struct disabled(()); ///Marker type for the `updated_at` field pub struct updated_at(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `id` field + pub struct id(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `content_markdown` field + pub struct content_markdown(()); } } @@ -400,13 +400,13 @@ where impl TemplateViewBuilder where St: template_view_state::State, - St::ContentMarkdown: template_view_state::IsSet, - St::CreatedAt: template_view_state::IsSet, - St::Disabled: template_view_state::IsSet, - St::Id: template_view_state::IsSet, St::LastUpdatedBy: template_view_state::IsSet, - St::Name: template_view_state::IsSet, + St::Disabled: template_view_state::IsSet, St::UpdatedAt: template_view_state::IsSet, + St::Name: template_view_state::IsSet, + St::Id: template_view_state::IsSet, + St::CreatedAt: template_view_state::IsSet, + St::ContentMarkdown: template_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> TemplateView { diff --git a/services/types/src/tools_ozone/moderation.rs b/services/types/src/tools_ozone/moderation.rs index 5283a4d..dce1003 100644 --- a/services/types/src/tools_ozone/moderation.rs +++ b/services/types/src/tools_ozone/moderation.rs @@ -5,7 +5,9 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. +pub mod cancel_scheduled_actions; pub mod emit_event; +pub mod get_account_timeline; pub mod get_event; pub mod get_record; pub mod get_records; @@ -13,8 +15,10 @@ pub mod get_repo; pub mod get_reporter_stats; pub mod get_repos; pub mod get_subjects; +pub mod list_scheduled_actions; pub mod query_events; pub mod query_statuses; +pub mod schedule_action; pub mod search_repos; @@ -37,6 +41,8 @@ use jacquard_lexicon::schema::LexiconSchema; #[allow(unused_imports)] use jacquard_lexicon::validation::{ConstraintError, ValidationPath}; use serde::{Serialize, Deserialize}; +use crate::app_bsky::ageassurance::Access; +use crate::chat_bsky::convo::ConvoRef; use crate::chat_bsky::convo::MessageRef; use crate::com_atproto::admin::RepoRef; use crate::com_atproto::admin::ThreatSignature; @@ -291,11 +297,34 @@ pub struct AccountStats { pub extra_data: Option>>, } +/// Strike information for an account + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct AccountStrike { + ///Current number of active strikes (excluding expired strikes) + #[serde(skip_serializing_if = "Option::is_none")] + pub active_strike_count: Option, + ///Timestamp of the first strike received + #[serde(skip_serializing_if = "Option::is_none")] + pub first_strike_at: Option, + ///Timestamp of the most recent strike received + #[serde(skip_serializing_if = "Option::is_none")] + pub last_strike_at: Option, + ///Total number of strikes ever received (including expired strikes) + #[serde(skip_serializing_if = "Option::is_none")] + pub total_strike_count: Option, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + /// Age assurance info coming directly from users. Only works on DID subjects. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct AgeAssuranceEvent { + #[serde(skip_serializing_if = "Option::is_none")] + pub access: Option>, ///The unique identifier for this instance of the age assurance flow, in UUID format. pub attempt_id: S, ///The IP address used when completing the AA flow. @@ -304,6 +333,9 @@ pub struct AgeAssuranceEvent { ///The user agent used when completing the AA flow. #[serde(skip_serializing_if = "Option::is_none")] pub complete_ua: Option, + ///The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub country_code: Option, ///The date and time of this write operation. pub created_at: Datetime, ///The IP address used when initiating the AA flow. @@ -312,13 +344,16 @@ pub struct AgeAssuranceEvent { ///The user agent used when initiating the AA flow. #[serde(skip_serializing_if = "Option::is_none")] pub init_ua: Option, - ///The status of the age assurance process. + ///The ISO 3166-2 region code provided when beginning the Age Assurance flow. + #[serde(skip_serializing_if = "Option::is_none")] + pub region_code: Option, + ///The status of the Age Assurance process. pub status: AgeAssuranceEventStatus, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } -/// The status of the age assurance process. +/// The status of the Age Assurance process. #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum AgeAssuranceEventStatus { @@ -408,6 +443,8 @@ where #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] pub struct AgeAssuranceOverrideEvent { + #[serde(skip_serializing_if = "Option::is_none")] + pub access: Option>, ///Comment describing the reason for the override. pub comment: S, ///The status to be set for the user decided by a moderator, overriding whatever value the user had previously. Use reset to default to original state. @@ -508,6 +545,17 @@ where } } +/// Purges all age assurance events for the subject. Only works on DID subjects. Moderator-only. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct AgeAssurancePurgeEvent { + ///Comment describing the reason for the purge. + pub comment: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -535,6 +583,27 @@ pub enum BlobViewDetails { VideoDetails(Box>), } +/// Logs cancellation of a scheduled takedown action for an account. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct CancelScheduledTakedownEvent { + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ConvoView { + pub convo_id: S, + pub did: Did, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + /// Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking. #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] @@ -612,6 +681,21 @@ pub struct ModEventEmail { ///The content of the email sent to the user. #[serde(skip_serializing_if = "Option::is_none")] pub content: Option, + ///Indicates whether the email was successfully delivered to the user's inbox. + #[serde(skip_serializing_if = "Option::is_none")] + pub is_delivered: Option, + ///Names/Keywords of the policies that necessitated the email. + #[serde(skip_serializing_if = "Option::is_none")] + pub policies: Option>, + ///Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense + #[serde(skip_serializing_if = "Option::is_none")] + pub severity_level: Option, + ///Number of strikes to assign to the user for this violation. Normally 0 as an indicator of a warning and only added as a strike on a repeat offense. + #[serde(skip_serializing_if = "Option::is_none")] + pub strike_count: Option, + ///When the strike should expire. If not provided, the strike never expires. + #[serde(skip_serializing_if = "Option::is_none")] + pub strike_expires_at: Option, ///The subject line of the email sent to the user. pub subject_line: S, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] @@ -718,6 +802,15 @@ pub struct ModEventReverseTakedown { ///Describe reasoning behind the reversal. #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, + ///Names/Keywords of the policy infraction for which takedown is being reversed. + #[serde(skip_serializing_if = "Option::is_none")] + pub policies: Option>, + ///Severity level of the violation. Usually set from the last policy infraction's severity. + #[serde(skip_serializing_if = "Option::is_none")] + pub severity_level: Option, + ///Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity. + #[serde(skip_serializing_if = "Option::is_none")] + pub strike_count: Option, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } @@ -732,6 +825,9 @@ pub struct ModEventTag { ///Additional comment about added/removed tags. #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, + ///Indicates how long the tags being added should remain before automatically being removed. Only applies to tags being added. + #[serde(skip_serializing_if = "Option::is_none")] + pub duration_in_hours: Option, ///Tags to be removed to the subject. Ignores a tag If it doesn't exist, won't be duplicated. pub remove: Vec, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] @@ -754,6 +850,18 @@ pub struct ModEventTakedown { ///Names/Keywords of the policies that drove the decision. #[serde(skip_serializing_if = "Option::is_none")] pub policies: Option>, + ///Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.). + #[serde(skip_serializing_if = "Option::is_none")] + pub severity_level: Option, + ///Number of strikes to assign to the user for this violation. + #[serde(skip_serializing_if = "Option::is_none")] + pub strike_count: Option, + ///When the strike should expire. If not provided, the strike never expires. + #[serde(skip_serializing_if = "Option::is_none")] + pub strike_expires_at: Option, + ///List of services where the takedown should be applied. If empty or not provided, takedown is applied on all configured services. + #[serde(skip_serializing_if = "Option::is_none")] + pub target_services: Option>, #[serde(flatten, default, skip_serializing_if = "Option::is_none")] pub extra_data: Option>>, } @@ -849,6 +957,14 @@ pub enum ModEventViewEvent { AgeAssuranceEvent(Box>), #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")] AgeAssuranceOverrideEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#ageAssurancePurgeEvent")] + AgeAssurancePurgeEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")] + RevokeAccountCredentialsEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")] + ScheduleTakedownEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")] + CancelScheduledTakedownEvent(Box>), } @@ -862,6 +978,8 @@ pub enum ModEventViewSubject { StrongRef(Box>), #[serde(rename = "chat.bsky.convo.defs#messageRef")] MessageRef(Box>), + #[serde(rename = "chat.bsky.convo.defs#convoRef")] + ConvoRef(Box>), } @@ -927,6 +1045,14 @@ pub enum ModEventViewDetailEvent { AgeAssuranceEvent(Box>), #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")] AgeAssuranceOverrideEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#ageAssurancePurgeEvent")] + AgeAssurancePurgeEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")] + RevokeAccountCredentialsEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")] + ScheduleTakedownEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")] + CancelScheduledTakedownEvent(Box>), } @@ -942,6 +1068,8 @@ pub enum ModEventViewDetailSubject { RecordView(Box>), #[serde(rename = "tools.ozone.moderation.defs#recordViewNotFound")] RecordViewNotFound(Box>), + #[serde(rename = "tools.ozone.moderation.defs#convoView")] + ConvoView(Box>), } /// Moderation tool information for tracing the source of the action @@ -1372,33 +1500,293 @@ impl core::fmt::Display for ReviewOpen { } } +/// Account credentials revocation by moderators. Only works on DID subjects. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct RevokeAccountCredentialsEvent { + ///Comment describing the reason for the revocation. + pub comment: S, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Logs a scheduled takedown action for an account. + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ScheduleTakedownEvent { + #[serde(skip_serializing_if = "Option::is_none")] + pub comment: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub execute_after: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub execute_at: Option, + #[serde(skip_serializing_if = "Option::is_none")] + pub execute_until: Option, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// View of a scheduled moderation action + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ScheduledActionView { + ///Type of action to be executed + pub action: ScheduledActionViewAction, + ///When the scheduled action was created + pub created_at: Datetime, + ///DID of the user who created this scheduled action + pub created_by: Did, + ///Subject DID for the action + pub did: Did, + ///Serialized event object that will be propagated to the event when performed + #[serde(skip_serializing_if = "Option::is_none")] + pub event_data: Option>, + ///Earliest time to execute the action (for randomized scheduling) + #[serde(skip_serializing_if = "Option::is_none")] + pub execute_after: Option, + ///Exact time to execute the action + #[serde(skip_serializing_if = "Option::is_none")] + pub execute_at: Option, + ///Latest time to execute the action (for randomized scheduling) + #[serde(skip_serializing_if = "Option::is_none")] + pub execute_until: Option, + ///ID of the moderation event created when action was successfully executed + #[serde(skip_serializing_if = "Option::is_none")] + pub execution_event_id: Option, + ///Auto-incrementing row ID + pub id: i64, + ///When the action was last attempted to be executed + #[serde(skip_serializing_if = "Option::is_none")] + pub last_executed_at: Option, + ///Reason for the last execution failure + #[serde(skip_serializing_if = "Option::is_none")] + pub last_failure_reason: Option, + ///Whether execution time should be randomized within the specified range + #[serde(skip_serializing_if = "Option::is_none")] + pub randomize_execution: Option, + ///Current status of the scheduled action + pub status: ScheduledActionViewStatus, + ///When the scheduled action was last updated + #[serde(skip_serializing_if = "Option::is_none")] + pub updated_at: Option, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + +/// Type of action to be executed + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ScheduledActionViewAction { + Takedown, + Other(S), +} + +impl ScheduledActionViewAction { + pub fn as_str(&self) -> &str { + match self { + Self::Takedown => "takedown", + Self::Other(s) => s.as_ref(), + } + } + /// Construct from a string-like value, matching known values. + pub fn from_value(s: S) -> Self { + match s.as_ref() { + "takedown" => Self::Takedown, + _ => Self::Other(s), + } + } +} + +impl core::fmt::Display for ScheduledActionViewAction { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl AsRef for ScheduledActionViewAction { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl Serialize for ScheduledActionViewAction { + fn serialize(&self, serializer: Ser) -> Result + where + Ser: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> +for ScheduledActionViewAction { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = S::deserialize(deserializer)?; + Ok(Self::from_value(s)) + } +} + +impl Default for ScheduledActionViewAction { + fn default() -> Self { + Self::Other(Default::default()) + } +} + +impl jacquard_common::IntoStatic for ScheduledActionViewAction +where + S: BosStr + jacquard_common::IntoStatic, + S::Output: BosStr, +{ + type Output = ScheduledActionViewAction; + fn into_static(self) -> Self::Output { + match self { + ScheduledActionViewAction::Takedown => ScheduledActionViewAction::Takedown, + ScheduledActionViewAction::Other(v) => { + ScheduledActionViewAction::Other(v.into_static()) + } + } + } +} + +/// Current status of the scheduled action + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ScheduledActionViewStatus { + Pending, + Executed, + Cancelled, + Failed, + Other(S), +} + +impl ScheduledActionViewStatus { + pub fn as_str(&self) -> &str { + match self { + Self::Pending => "pending", + Self::Executed => "executed", + Self::Cancelled => "cancelled", + Self::Failed => "failed", + Self::Other(s) => s.as_ref(), + } + } + /// Construct from a string-like value, matching known values. + pub fn from_value(s: S) -> Self { + match s.as_ref() { + "pending" => Self::Pending, + "executed" => Self::Executed, + "cancelled" => Self::Cancelled, + "failed" => Self::Failed, + _ => Self::Other(s), + } + } +} + +impl core::fmt::Display for ScheduledActionViewStatus { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{}", self.as_str()) + } +} + +impl AsRef for ScheduledActionViewStatus { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl Serialize for ScheduledActionViewStatus { + fn serialize(&self, serializer: Ser) -> Result + where + Ser: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, S: Deserialize<'de> + BosStr> Deserialize<'de> +for ScheduledActionViewStatus { + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = S::deserialize(deserializer)?; + Ok(Self::from_value(s)) + } +} + +impl Default for ScheduledActionViewStatus { + fn default() -> Self { + Self::Other(Default::default()) + } +} + +impl jacquard_common::IntoStatic for ScheduledActionViewStatus +where + S: BosStr + jacquard_common::IntoStatic, + S::Output: BosStr, +{ + type Output = ScheduledActionViewStatus; + fn into_static(self) -> Self::Output { + match self { + ScheduledActionViewStatus::Pending => ScheduledActionViewStatus::Pending, + ScheduledActionViewStatus::Executed => ScheduledActionViewStatus::Executed, + ScheduledActionViewStatus::Cancelled => ScheduledActionViewStatus::Cancelled, + ScheduledActionViewStatus::Failed => ScheduledActionViewStatus::Failed, + ScheduledActionViewStatus::Other(v) => { + ScheduledActionViewStatus::Other(v.into_static()) + } + } + } +} + #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub enum SubjectReviewState { - ReviewOpen, - ReviewEscalated, - ReviewClosed, - ReviewNone, + ToolsOzoneModerationDefsReviewOpen, + ToolsOzoneModerationDefsReviewEscalated, + ToolsOzoneModerationDefsReviewClosed, + ToolsOzoneModerationDefsReviewNone, Other(S), } impl SubjectReviewState { pub fn as_str(&self) -> &str { match self { - Self::ReviewOpen => "#reviewOpen", - Self::ReviewEscalated => "#reviewEscalated", - Self::ReviewClosed => "#reviewClosed", - Self::ReviewNone => "#reviewNone", + Self::ToolsOzoneModerationDefsReviewOpen => { + "tools.ozone.moderation.defs#reviewOpen" + } + Self::ToolsOzoneModerationDefsReviewEscalated => { + "tools.ozone.moderation.defs#reviewEscalated" + } + Self::ToolsOzoneModerationDefsReviewClosed => { + "tools.ozone.moderation.defs#reviewClosed" + } + Self::ToolsOzoneModerationDefsReviewNone => { + "tools.ozone.moderation.defs#reviewNone" + } Self::Other(s) => s.as_ref(), } } /// Construct from a string-like value, matching known values. pub fn from_value(s: S) -> Self { match s.as_ref() { - "#reviewOpen" => Self::ReviewOpen, - "#reviewEscalated" => Self::ReviewEscalated, - "#reviewClosed" => Self::ReviewClosed, - "#reviewNone" => Self::ReviewNone, + "tools.ozone.moderation.defs#reviewOpen" => { + Self::ToolsOzoneModerationDefsReviewOpen + } + "tools.ozone.moderation.defs#reviewEscalated" => { + Self::ToolsOzoneModerationDefsReviewEscalated + } + "tools.ozone.moderation.defs#reviewClosed" => { + Self::ToolsOzoneModerationDefsReviewClosed + } + "tools.ozone.moderation.defs#reviewNone" => { + Self::ToolsOzoneModerationDefsReviewNone + } _ => Self::Other(s), } } @@ -1443,10 +1831,18 @@ where type Output = SubjectReviewState; fn into_static(self) -> Self::Output { match self { - SubjectReviewState::ReviewOpen => SubjectReviewState::ReviewOpen, - SubjectReviewState::ReviewEscalated => SubjectReviewState::ReviewEscalated, - SubjectReviewState::ReviewClosed => SubjectReviewState::ReviewClosed, - SubjectReviewState::ReviewNone => SubjectReviewState::ReviewNone, + SubjectReviewState::ToolsOzoneModerationDefsReviewOpen => { + SubjectReviewState::ToolsOzoneModerationDefsReviewOpen + } + SubjectReviewState::ToolsOzoneModerationDefsReviewEscalated => { + SubjectReviewState::ToolsOzoneModerationDefsReviewEscalated + } + SubjectReviewState::ToolsOzoneModerationDefsReviewClosed => { + SubjectReviewState::ToolsOzoneModerationDefsReviewClosed + } + SubjectReviewState::ToolsOzoneModerationDefsReviewNone => { + SubjectReviewState::ToolsOzoneModerationDefsReviewNone + } SubjectReviewState::Other(v) => SubjectReviewState::Other(v.into_static()), } } @@ -1459,6 +1855,9 @@ pub struct SubjectStatusView { ///Statistics related to the account subject #[serde(skip_serializing_if = "Option::is_none")] pub account_stats: Option>, + ///Strike information for the account (account-level only) + #[serde(skip_serializing_if = "Option::is_none")] + pub account_strike: Option>, ///Current age assurance state of the subject. #[serde(skip_serializing_if = "Option::is_none")] pub age_assurance_state: Option>, @@ -1725,6 +2124,8 @@ pub enum SubjectStatusViewSubject { StrongRef(Box>), #[serde(rename = "chat.bsky.convo.defs#messageRef")] MessageRef(Box>), + #[serde(rename = "chat.bsky.convo.defs#convoRef")] + ConvoRef(Box>), } /// Detailed view of a subject. For record subjects, the author's repo and profile will be returned. @@ -1746,6 +2147,36 @@ pub struct SubjectView { pub extra_data: Option>>, } +/// Moderation event timeline event for a PLC create operation + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)] +pub struct TimelineEventPlcCreate; +impl core::fmt::Display for TimelineEventPlcCreate { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "timelineEventPlcCreate") + } +} + +/// Moderation event timeline event for generic PLC operation + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)] +pub struct TimelineEventPlcOperation; +impl core::fmt::Display for TimelineEventPlcOperation { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "timelineEventPlcOperation") + } +} + +/// Moderation event timeline event for a PLC tombstone operation + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Hash)] +pub struct TimelineEventPlcTombstone; +impl core::fmt::Display for TimelineEventPlcTombstone { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "timelineEventPlcTombstone") + } +} + #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -1802,7 +2233,22 @@ impl LexiconSchema for AccountStats { } } -impl LexiconSchema for AgeAssuranceEvent { +impl LexiconSchema for AccountStrike { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "accountStrike" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for AgeAssuranceEvent { fn nsid() -> &'static str { "tools.ozone.moderation.defs" } @@ -1828,6 +2274,43 @@ impl LexiconSchema for AgeAssuranceOverrideEvent { lexicon_doc_tools_ozone_moderation_defs() } fn validate(&self) -> Result<(), ConstraintError> { + { + let value = &self.comment; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) < 1usize { + return Err(ConstraintError::MinLength { + path: ValidationPath::from_field("comment"), + min: 1usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +impl LexiconSchema for AgeAssurancePurgeEvent { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "ageAssurancePurgeEvent" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + { + let value = &self.comment; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) < 1usize { + return Err(ConstraintError::MinLength { + path: ValidationPath::from_field("comment"), + min: 1usize, + actual: ::len(value.as_ref()), + }); + } + } Ok(()) } } @@ -1847,6 +2330,36 @@ impl LexiconSchema for BlobView { } } +impl LexiconSchema for CancelScheduledTakedownEvent { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "cancelScheduledTakedownEvent" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for ConvoView { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "convoView" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + impl LexiconSchema for IdentityEvent { fn nsid() -> &'static str { "tools.ozone.moderation.defs" @@ -1933,6 +2446,16 @@ impl LexiconSchema for ModEventEmail { lexicon_doc_tools_ozone_moderation_defs() } fn validate(&self) -> Result<(), ConstraintError> { + if let Some(ref value) = self.policies { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(ConstraintError::MaxLength { + path: ValidationPath::from_field("policies"), + max: 5usize, + actual: value.len(), + }); + } + } Ok(()) } } @@ -2073,6 +2596,16 @@ impl LexiconSchema for ModEventReverseTakedown { lexicon_doc_tools_ozone_moderation_defs() } fn validate(&self) -> Result<(), ConstraintError> { + if let Some(ref value) = self.policies { + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(ConstraintError::MaxLength { + path: ValidationPath::from_field("policies"), + max: 5usize, + actual: value.len(), + }); + } + } Ok(()) } } @@ -2372,6 +2905,62 @@ impl LexiconSchema for ReporterStats { } } +impl LexiconSchema for RevokeAccountCredentialsEvent { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "revokeAccountCredentialsEvent" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + { + let value = &self.comment; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) < 1usize { + return Err(ConstraintError::MinLength { + path: ValidationPath::from_field("comment"), + min: 1usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +impl LexiconSchema for ScheduleTakedownEvent { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "scheduleTakedownEvent" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + +impl LexiconSchema for ScheduledActionView { + fn nsid() -> &'static str { + "tools.ozone.moderation.defs" + } + fn def_name() -> &'static str { + "scheduledActionView" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_defs() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + impl LexiconSchema for SubjectStatusView { fn nsid() -> &'static str { "tools.ozone.moderation.defs" @@ -2445,37 +3034,37 @@ pub mod account_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Active; type Timestamp; + type Active; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Active = Unset; type Timestamp = Unset; - } - ///State transition - sets the `active` field to Set - pub struct SetActive(PhantomData St>); - impl sealed::Sealed for SetActive {} - impl State for SetActive { - type Active = Set; - type Timestamp = St::Timestamp; + type Active = Unset; } ///State transition - sets the `timestamp` field to Set pub struct SetTimestamp(PhantomData St>); impl sealed::Sealed for SetTimestamp {} impl State for SetTimestamp { - type Active = St::Active; type Timestamp = Set; + type Active = St::Active; + } + ///State transition - sets the `active` field to Set + pub struct SetActive(PhantomData St>); + impl sealed::Sealed for SetActive {} + impl State for SetActive { + type Timestamp = St::Timestamp; + type Active = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `active` field - pub struct active(()); ///Marker type for the `timestamp` field pub struct timestamp(()); + ///Marker type for the `active` field + pub struct active(()); } } @@ -2571,8 +3160,8 @@ where impl AccountEventBuilder where St: account_event_state::State, - St::Active: account_event_state::IsSet, St::Timestamp: account_event_state::IsSet, + St::Active: account_event_state::IsSet, { /// Build the final struct. pub fn build(self) -> AccountEvent { @@ -2749,6 +3338,54 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("accountStrike"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static("Strike information for an account"), + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("activeStrikeCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("firstStrikeAt"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("Timestamp of the first strike received"), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("lastStrikeAt"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Timestamp of the most recent strike received", + ), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("totalStrikeCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); map.insert( SmolStr::new_static("ageAssuranceEvent"), LexUserType::Object(LexObject { @@ -2767,6 +3404,15 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("access"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "app.bsky.ageassurance.defs#access", + ), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("attemptId"), LexObjectProperty::String(LexString { @@ -2800,6 +3446,17 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("countryCode"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "The ISO 3166-1 alpha-2 country code provided when beginning the Age Assurance flow.", + ), + ), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("createdAt"), LexObjectProperty::String(LexString { @@ -2834,12 +3491,23 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("regionCode"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "The ISO 3166-2 region code provided when beginning the Age Assurance flow.", + ), + ), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("status"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( - "The status of the age assurance process.", + "The status of the Age Assurance process.", ), ), ..Default::default() @@ -2866,6 +3534,15 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("access"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "app.bsky.ageassurance.defs#access", + ), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("comment"), LexObjectProperty::String(LexString { @@ -2874,6 +3551,7 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { "Comment describing the reason for the override.", ), ), + min_length: Some(1usize), ..Default::default() }), ); @@ -2893,6 +3571,35 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("ageAssurancePurgeEvent"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Purges all age assurance events for the subject. Only works on DID subjects. Moderator-only.", + ), + ), + required: Some(vec![SmolStr::new_static("comment")]), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("comment"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Comment describing the reason for the purge.", + ), + ), + min_length: Some(1usize), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); map.insert( SmolStr::new_static("blobView"), LexUserType::Object(LexObject { @@ -2952,14 +3659,13 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { }), ); map.insert( - SmolStr::new_static("identityEvent"), + SmolStr::new_static("cancelScheduledTakedownEvent"), LexUserType::Object(LexObject { description: Some( CowStr::new_static( - "Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", + "Logs cancellation of a scheduled takedown action for an account.", ), ), - required: Some(vec![SmolStr::new_static("timestamp")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); @@ -2967,10 +3673,56 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { SmolStr::new_static("comment"), LexObjectProperty::String(LexString { ..Default::default() }), ); - map.insert( - SmolStr::new_static("handle"), - LexObjectProperty::String(LexString { - format: Some(LexStringFormat::Handle), + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("convoView"), + LexUserType::Object(LexObject { + required: Some( + vec![SmolStr::new_static("did"), SmolStr::new_static("convoId")], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("convoId"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("did"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Did), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("identityEvent"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Logs identity related events on a repo subject. Normally captured by automod from the firehose and emitted to ozone for historical tracking.", + ), + ), + required: Some(vec![SmolStr::new_static("timestamp")]), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("comment"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("handle"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Handle), ..Default::default() }), ); @@ -3124,6 +3876,56 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("isDelivered"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("policies"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Names/Keywords of the policies that necessitated the email.", + ), + ), + items: LexArrayItem::String(LexString { + ..Default::default() + }), + max_length: Some(5usize), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("severityLevel"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense", + ), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("strikeCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("strikeExpiresAt"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "When the strike should expire. If not provided, the strike never expires.", + ), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); map.insert( SmolStr::new_static("subjectLine"), LexObjectProperty::String(LexString { @@ -3354,6 +4156,38 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("policies"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Names/Keywords of the policy infraction for which takedown is being reversed.", + ), + ), + items: LexArrayItem::String(LexString { + ..Default::default() + }), + max_length: Some(5usize), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("severityLevel"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Severity level of the violation. Usually set from the last policy infraction's severity.", + ), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("strikeCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); map }, ..Default::default() @@ -3396,6 +4230,12 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("durationInHours"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); map.insert( SmolStr::new_static("remove"), LexObjectProperty::Array(LexArray { @@ -3457,6 +4297,49 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("severityLevel"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.).", + ), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("strikeCount"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("strikeExpiresAt"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "When the strike should expire. If not provided, the strike never expires.", + ), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("targetServices"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "List of services where the takedown should be applied. If empty or not provided, takedown is applied on all configured services.", + ), + ), + items: LexArrayItem::String(LexString { + ..Default::default() + }), + ..Default::default() + }), + ); map }, ..Default::default() @@ -3567,7 +4450,11 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { CowStr::new_static("#recordEvent"), CowStr::new_static("#modEventPriorityScore"), CowStr::new_static("#ageAssuranceEvent"), - CowStr::new_static("#ageAssuranceOverrideEvent") + CowStr::new_static("#ageAssuranceOverrideEvent"), + CowStr::new_static("#ageAssurancePurgeEvent"), + CowStr::new_static("#revokeAccountCredentialsEvent"), + CowStr::new_static("#scheduleTakedownEvent"), + CowStr::new_static("#cancelScheduledTakedownEvent") ], ..Default::default() }), @@ -3591,7 +4478,8 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { refs: vec![ CowStr::new_static("com.atproto.admin.defs#repoRef"), CowStr::new_static("com.atproto.repo.strongRef"), - CowStr::new_static("chat.bsky.convo.defs#messageRef") + CowStr::new_static("chat.bsky.convo.defs#messageRef"), + CowStr::new_static("chat.bsky.convo.defs#convoRef") ], ..Default::default() }), @@ -3667,7 +4555,11 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { CowStr::new_static("#recordEvent"), CowStr::new_static("#modEventPriorityScore"), CowStr::new_static("#ageAssuranceEvent"), - CowStr::new_static("#ageAssuranceOverrideEvent") + CowStr::new_static("#ageAssuranceOverrideEvent"), + CowStr::new_static("#ageAssurancePurgeEvent"), + CowStr::new_static("#revokeAccountCredentialsEvent"), + CowStr::new_static("#scheduleTakedownEvent"), + CowStr::new_static("#cancelScheduledTakedownEvent") ], ..Default::default() }), @@ -3692,7 +4584,8 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { CowStr::new_static("#repoView"), CowStr::new_static("#repoViewNotFound"), CowStr::new_static("#recordView"), - CowStr::new_static("#recordViewNotFound") + CowStr::new_static("#recordViewNotFound"), + CowStr::new_static("#convoView") ], ..Default::default() }), @@ -4436,63 +5329,97 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { LexUserType::Token(LexToken { ..Default::default() }), ); map.insert( - SmolStr::new_static("subjectReviewState"), - LexUserType::String(LexString { ..Default::default() }), - ); - map.insert( - SmolStr::new_static("subjectStatusView"), + SmolStr::new_static("revokeAccountCredentialsEvent"), LexUserType::Object(LexObject { - required: Some( - vec![ - SmolStr::new_static("id"), SmolStr::new_static("subject"), - SmolStr::new_static("createdAt"), - SmolStr::new_static("updatedAt"), - SmolStr::new_static("reviewState") - ], + description: Some( + CowStr::new_static( + "Account credentials revocation by moderators. Only works on DID subjects.", + ), ), + required: Some(vec![SmolStr::new_static("comment")]), properties: { #[allow(unused_mut)] let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("accountStats"), - LexObjectProperty::Ref(LexRef { - r#ref: CowStr::new_static("#accountStats"), - ..Default::default() - }), - ); - map.insert( - SmolStr::new_static("ageAssuranceState"), + SmolStr::new_static("comment"), LexObjectProperty::String(LexString { description: Some( CowStr::new_static( - "Current age assurance state of the subject.", + "Comment describing the reason for the revocation.", ), ), + min_length: Some(1usize), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("scheduleTakedownEvent"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Logs a scheduled takedown action for an account.", + ), + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("comment"), + LexObjectProperty::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("executeAfter"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( - SmolStr::new_static("ageAssuranceUpdatedBy"), + SmolStr::new_static("executeAt"), LexObjectProperty::String(LexString { - description: Some( - CowStr::new_static( - "Whether or not the last successful update to age assurance was made by the user or admin.", - ), - ), + format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( - SmolStr::new_static("appealed"), - LexObjectProperty::Boolean(LexBoolean { + SmolStr::new_static("executeUntil"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Datetime), ..Default::default() }), ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("scheduledActionView"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static("View of a scheduled moderation action"), + ), + required: Some( + vec![ + SmolStr::new_static("id"), SmolStr::new_static("action"), + SmolStr::new_static("did"), SmolStr::new_static("createdBy"), + SmolStr::new_static("createdAt"), + SmolStr::new_static("status") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); map.insert( - SmolStr::new_static("comment"), + SmolStr::new_static("action"), LexObjectProperty::String(LexString { description: Some( - CowStr::new_static("Sticky comment on the subject."), + CowStr::new_static("Type of action to be executed"), ), ..Default::default() }), @@ -4501,26 +5428,232 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { SmolStr::new_static("createdAt"), LexObjectProperty::String(LexString { description: Some( - CowStr::new_static( - "Timestamp referencing the first moderation status impacting event was emitted on the subject", - ), + CowStr::new_static("When the scheduled action was created"), ), format: Some(LexStringFormat::Datetime), ..Default::default() }), ); map.insert( - SmolStr::new_static("hosting"), - LexObjectProperty::Union(LexRefUnion { - refs: vec![ - CowStr::new_static("#accountHosting"), - CowStr::new_static("#recordHosting") - ], + SmolStr::new_static("createdBy"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "DID of the user who created this scheduled action", + ), + ), + format: Some(LexStringFormat::Did), ..Default::default() }), ); map.insert( - SmolStr::new_static("id"), + SmolStr::new_static("did"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("Subject DID for the action"), + ), + format: Some(LexStringFormat::Did), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("eventData"), + LexObjectProperty::Unknown(LexUnknown { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("executeAfter"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Earliest time to execute the action (for randomized scheduling)", + ), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("executeAt"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("Exact time to execute the action"), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("executeUntil"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Latest time to execute the action (for randomized scheduling)", + ), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("executionEventId"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("id"), + LexObjectProperty::Integer(LexInteger { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("lastExecutedAt"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "When the action was last attempted to be executed", + ), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("lastFailureReason"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("Reason for the last execution failure"), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("randomizeExecution"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("status"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("Current status of the scheduled action"), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("updatedAt"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "When the scheduled action was last updated", + ), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("subjectReviewState"), + LexUserType::String(LexString { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("subjectStatusView"), + LexUserType::Object(LexObject { + required: Some( + vec![ + SmolStr::new_static("id"), SmolStr::new_static("subject"), + SmolStr::new_static("createdAt"), + SmolStr::new_static("updatedAt"), + SmolStr::new_static("reviewState") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("accountStats"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#accountStats"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("accountStrike"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#accountStrike"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("ageAssuranceState"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Current age assurance state of the subject.", + ), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("ageAssuranceUpdatedBy"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Whether or not the last successful update to age assurance was made by the user or admin.", + ), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("appealed"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("comment"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static("Sticky comment on the subject."), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("createdAt"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Timestamp referencing the first moderation status impacting event was emitted on the subject", + ), + ), + format: Some(LexStringFormat::Datetime), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("hosting"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("#accountHosting"), + CowStr::new_static("#recordHosting") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("id"), LexObjectProperty::Integer(LexInteger { ..Default::default() }), @@ -4600,7 +5733,8 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { refs: vec![ CowStr::new_static("com.atproto.admin.defs#repoRef"), CowStr::new_static("com.atproto.repo.strongRef"), - CowStr::new_static("chat.bsky.convo.defs#messageRef") + CowStr::new_static("chat.bsky.convo.defs#messageRef"), + CowStr::new_static("chat.bsky.convo.defs#convoRef") ], ..Default::default() }), @@ -4718,6 +5852,18 @@ fn lexicon_doc_tools_ozone_moderation_defs() -> LexiconDoc<'static> { ..Default::default() }), ); + map.insert( + SmolStr::new_static("timelineEventPlcCreate"), + LexUserType::Token(LexToken { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("timelineEventPlcOperation"), + LexUserType::Token(LexToken { ..Default::default() }), + ); + map.insert( + SmolStr::new_static("timelineEventPlcTombstone"), + LexUserType::Token(LexToken { ..Default::default() }), + ); map.insert( SmolStr::new_static("videoDetails"), LexUserType::Object(LexObject { @@ -4769,51 +5915,51 @@ pub mod age_assurance_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AttemptId; type CreatedAt; type Status; + type AttemptId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AttemptId = Unset; type CreatedAt = Unset; type Status = Unset; - } - ///State transition - sets the `attempt_id` field to Set - pub struct SetAttemptId(PhantomData St>); - impl sealed::Sealed for SetAttemptId {} - impl State for SetAttemptId { - type AttemptId = Set; - type CreatedAt = St::CreatedAt; - type Status = St::Status; + type AttemptId = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData St>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type AttemptId = St::AttemptId; type CreatedAt = Set; type Status = St::Status; + type AttemptId = St::AttemptId; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData St>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type AttemptId = St::AttemptId; type CreatedAt = St::CreatedAt; type Status = Set; + type AttemptId = St::AttemptId; + } + ///State transition - sets the `attempt_id` field to Set + pub struct SetAttemptId(PhantomData St>); + impl sealed::Sealed for SetAttemptId {} + impl State for SetAttemptId { + type CreatedAt = St::CreatedAt; + type Status = St::Status; + type AttemptId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `attempt_id` field - pub struct attempt_id(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `attempt_id` field + pub struct attempt_id(()); } } @@ -4821,12 +5967,15 @@ pub mod age_assurance_event_state { pub struct AgeAssuranceEventBuilder { _state: PhantomData St>, _fields: ( + Option>, + Option, Option, Option, Option, Option, Option, Option, + Option, Option>, ), _type: PhantomData S>, @@ -4844,12 +5993,25 @@ impl AgeAssuranceEventBuilder { pub fn new() -> Self { AgeAssuranceEventBuilder { _state: PhantomData, - _fields: (None, None, None, None, None, None, None), + _fields: (None, None, None, None, None, None, None, None, None, None), _type: PhantomData, } } } +impl AgeAssuranceEventBuilder { + /// Set the `access` field (optional) + pub fn access(mut self, value: impl Into>>) -> Self { + self._fields.0 = value.into(); + self + } + /// Set the `access` field to an Option value (optional) + pub fn maybe_access(mut self, value: Option>) -> Self { + self._fields.0 = value; + self + } +} + impl AgeAssuranceEventBuilder where St: age_assurance_event_state::State, @@ -4860,7 +6022,7 @@ where mut self, value: impl Into, ) -> AgeAssuranceEventBuilder> { - self._fields.0 = Option::Some(value.into()); + self._fields.1 = Option::Some(value.into()); AgeAssuranceEventBuilder { _state: PhantomData, _fields: self._fields, @@ -4872,12 +6034,12 @@ where impl AgeAssuranceEventBuilder { /// Set the `completeIp` field (optional) pub fn complete_ip(mut self, value: impl Into>) -> Self { - self._fields.1 = value.into(); + self._fields.2 = value.into(); self } /// Set the `completeIp` field to an Option value (optional) pub fn maybe_complete_ip(mut self, value: Option) -> Self { - self._fields.1 = value; + self._fields.2 = value; self } } @@ -4885,27 +6047,40 @@ impl AgeAssuranceEventBuilder AgeAssuranceEventBuilder { /// Set the `completeUa` field (optional) pub fn complete_ua(mut self, value: impl Into>) -> Self { - self._fields.2 = value.into(); + self._fields.3 = value.into(); self } /// Set the `completeUa` field to an Option value (optional) pub fn maybe_complete_ua(mut self, value: Option) -> Self { - self._fields.2 = value; + self._fields.3 = value; self } } -impl AgeAssuranceEventBuilder -where - St: age_assurance_event_state::State, - St::CreatedAt: age_assurance_event_state::IsUnset, -{ - /// Set the `createdAt` field (required) - pub fn created_at( - mut self, +impl AgeAssuranceEventBuilder { + /// Set the `countryCode` field (optional) + pub fn country_code(mut self, value: impl Into>) -> Self { + self._fields.4 = value.into(); + self + } + /// Set the `countryCode` field to an Option value (optional) + pub fn maybe_country_code(mut self, value: Option) -> Self { + self._fields.4 = value; + self + } +} + +impl AgeAssuranceEventBuilder +where + St: age_assurance_event_state::State, + St::CreatedAt: age_assurance_event_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, value: impl Into, ) -> AgeAssuranceEventBuilder> { - self._fields.3 = Option::Some(value.into()); + self._fields.5 = Option::Some(value.into()); AgeAssuranceEventBuilder { _state: PhantomData, _fields: self._fields, @@ -4917,12 +6092,12 @@ where impl AgeAssuranceEventBuilder { /// Set the `initIp` field (optional) pub fn init_ip(mut self, value: impl Into>) -> Self { - self._fields.4 = value.into(); + self._fields.6 = value.into(); self } /// Set the `initIp` field to an Option value (optional) pub fn maybe_init_ip(mut self, value: Option) -> Self { - self._fields.4 = value; + self._fields.6 = value; self } } @@ -4930,12 +6105,25 @@ impl AgeAssuranceEventBuilder AgeAssuranceEventBuilder { /// Set the `initUa` field (optional) pub fn init_ua(mut self, value: impl Into>) -> Self { - self._fields.5 = value.into(); + self._fields.7 = value.into(); self } /// Set the `initUa` field to an Option value (optional) pub fn maybe_init_ua(mut self, value: Option) -> Self { - self._fields.5 = value; + self._fields.7 = value; + self + } +} + +impl AgeAssuranceEventBuilder { + /// Set the `regionCode` field (optional) + pub fn region_code(mut self, value: impl Into>) -> Self { + self._fields.8 = value.into(); + self + } + /// Set the `regionCode` field to an Option value (optional) + pub fn maybe_region_code(mut self, value: Option) -> Self { + self._fields.8 = value; self } } @@ -4950,7 +6138,7 @@ where mut self, value: impl Into>, ) -> AgeAssuranceEventBuilder> { - self._fields.6 = Option::Some(value.into()); + self._fields.9 = Option::Some(value.into()); AgeAssuranceEventBuilder { _state: PhantomData, _fields: self._fields, @@ -4962,20 +6150,23 @@ where impl AgeAssuranceEventBuilder where St: age_assurance_event_state::State, - St::AttemptId: age_assurance_event_state::IsSet, St::CreatedAt: age_assurance_event_state::IsSet, St::Status: age_assurance_event_state::IsSet, + St::AttemptId: age_assurance_event_state::IsSet, { /// Build the final struct. pub fn build(self) -> AgeAssuranceEvent { AgeAssuranceEvent { - attempt_id: self._fields.0.unwrap(), - complete_ip: self._fields.1, - complete_ua: self._fields.2, - created_at: self._fields.3.unwrap(), - init_ip: self._fields.4, - init_ua: self._fields.5, - status: self._fields.6.unwrap(), + access: self._fields.0, + attempt_id: self._fields.1.unwrap(), + complete_ip: self._fields.2, + complete_ua: self._fields.3, + country_code: self._fields.4, + created_at: self._fields.5.unwrap(), + init_ip: self._fields.6, + init_ua: self._fields.7, + region_code: self._fields.8, + status: self._fields.9.unwrap(), extra_data: Default::default(), } } @@ -4985,13 +6176,16 @@ where extra_data: BTreeMap>, ) -> AgeAssuranceEvent { AgeAssuranceEvent { - attempt_id: self._fields.0.unwrap(), - complete_ip: self._fields.1, - complete_ua: self._fields.2, - created_at: self._fields.3.unwrap(), - init_ip: self._fields.4, - init_ua: self._fields.5, - status: self._fields.6.unwrap(), + access: self._fields.0, + attempt_id: self._fields.1.unwrap(), + complete_ip: self._fields.2, + complete_ua: self._fields.3, + country_code: self._fields.4, + created_at: self._fields.5.unwrap(), + init_ip: self._fields.6, + init_ua: self._fields.7, + region_code: self._fields.8, + status: self._fields.9.unwrap(), extra_data: Some(extra_data), } } @@ -5007,67 +6201,67 @@ pub mod blob_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; - type CreatedAt; type MimeType; + type CreatedAt; type Size; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; - type CreatedAt = Unset; type MimeType = Unset; + type CreatedAt = Unset; type Size = Unset; + type Cid = Unset; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; + ///State transition - sets the `mime_type` field to Set + pub struct SetMimeType(PhantomData St>); + impl sealed::Sealed for SetMimeType {} + impl State for SetMimeType { + type MimeType = Set; type CreatedAt = St::CreatedAt; - type MimeType = St::MimeType; type Size = St::Size; + type Cid = St::Cid; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData St>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Cid = St::Cid; - type CreatedAt = Set; type MimeType = St::MimeType; + type CreatedAt = Set; type Size = St::Size; - } - ///State transition - sets the `mime_type` field to Set - pub struct SetMimeType(PhantomData St>); - impl sealed::Sealed for SetMimeType {} - impl State for SetMimeType { type Cid = St::Cid; - type CreatedAt = St::CreatedAt; - type MimeType = Set; - type Size = St::Size; } ///State transition - sets the `size` field to Set pub struct SetSize(PhantomData St>); impl sealed::Sealed for SetSize {} impl State for SetSize { - type Cid = St::Cid; - type CreatedAt = St::CreatedAt; type MimeType = St::MimeType; + type CreatedAt = St::CreatedAt; type Size = Set; + type Cid = St::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type MimeType = St::MimeType; + type CreatedAt = St::CreatedAt; + type Size = St::Size; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `mime_type` field pub struct mime_type(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `size` field pub struct size(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -5211,10 +6405,10 @@ where impl BlobViewBuilder where St: blob_view_state::State, - St::Cid: blob_view_state::IsSet, - St::CreatedAt: blob_view_state::IsSet, St::MimeType: blob_view_state::IsSet, + St::CreatedAt: blob_view_state::IsSet, St::Size: blob_view_state::IsSet, + St::Cid: blob_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> BlobView { @@ -5242,6 +6436,140 @@ where } } +pub mod convo_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Did; + type ConvoId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Did = Unset; + type ConvoId = Unset; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; + type ConvoId = St::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData St>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Did = St::Did; + type ConvoId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct ConvoViewBuilder { + _state: PhantomData St>, + _fields: (Option, Option>), + _type: PhantomData S>, +} + +impl ConvoView { + /// Create a new builder for this type. + pub fn new() -> ConvoViewBuilder { + ConvoViewBuilder::new() + } +} + +impl ConvoViewBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + ConvoViewBuilder { + _state: PhantomData, + _fields: (None, None), + _type: PhantomData, + } + } +} + +impl ConvoViewBuilder +where + St: convo_view_state::State, + St::ConvoId: convo_view_state::IsUnset, +{ + /// Set the `convoId` field (required) + pub fn convo_id( + mut self, + value: impl Into, + ) -> ConvoViewBuilder> { + self._fields.0 = Option::Some(value.into()); + ConvoViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ConvoViewBuilder +where + St: convo_view_state::State, + St::Did: convo_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ConvoViewBuilder> { + self._fields.1 = Option::Some(value.into()); + ConvoViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ConvoViewBuilder +where + St: convo_view_state::State, + St::Did: convo_view_state::IsSet, + St::ConvoId: convo_view_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> ConvoView { + ConvoView { + convo_id: self._fields.0.unwrap(), + did: self._fields.1.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> ConvoView { + ConvoView { + convo_id: self._fields.0.unwrap(), + did: self._fields.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + pub mod identity_event_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; @@ -5418,37 +6746,37 @@ pub mod image_details_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Height; type Width; + type Height; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Height = Unset; type Width = Unset; - } - ///State transition - sets the `height` field to Set - pub struct SetHeight(PhantomData St>); - impl sealed::Sealed for SetHeight {} - impl State for SetHeight { - type Height = Set; - type Width = St::Width; + type Height = Unset; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData St>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type Height = St::Height; type Width = Set; + type Height = St::Height; + } + ///State transition - sets the `height` field to Set + pub struct SetHeight(PhantomData St>); + impl sealed::Sealed for SetHeight {} + impl State for SetHeight { + type Width = St::Width; + type Height = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `height` field - pub struct height(()); ///Marker type for the `width` field pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); } } @@ -5518,8 +6846,8 @@ where impl ImageDetailsBuilder where St: image_details_state::State, - St::Height: image_details_state::IsSet, St::Width: image_details_state::IsSet, + St::Height: image_details_state::IsSet, { /// Build the final struct. pub fn build(self) -> ImageDetails { @@ -5552,37 +6880,37 @@ pub mod mod_event_label_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreateLabelVals; type NegateLabelVals; + type CreateLabelVals; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreateLabelVals = Unset; type NegateLabelVals = Unset; - } - ///State transition - sets the `create_label_vals` field to Set - pub struct SetCreateLabelVals(PhantomData St>); - impl sealed::Sealed for SetCreateLabelVals {} - impl State for SetCreateLabelVals { - type CreateLabelVals = Set; - type NegateLabelVals = St::NegateLabelVals; + type CreateLabelVals = Unset; } ///State transition - sets the `negate_label_vals` field to Set pub struct SetNegateLabelVals(PhantomData St>); impl sealed::Sealed for SetNegateLabelVals {} impl State for SetNegateLabelVals { - type CreateLabelVals = St::CreateLabelVals; type NegateLabelVals = Set; + type CreateLabelVals = St::CreateLabelVals; + } + ///State transition - sets the `create_label_vals` field to Set + pub struct SetCreateLabelVals(PhantomData St>); + impl sealed::Sealed for SetCreateLabelVals {} + impl State for SetCreateLabelVals { + type NegateLabelVals = St::NegateLabelVals; + type CreateLabelVals = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `create_label_vals` field - pub struct create_label_vals(()); ///Marker type for the `negate_label_vals` field pub struct negate_label_vals(()); + ///Marker type for the `create_label_vals` field + pub struct create_label_vals(()); } } @@ -5678,8 +7006,8 @@ where impl ModEventLabelBuilder where St: mod_event_label_state::State, - St::CreateLabelVals: mod_event_label_state::IsSet, St::NegateLabelVals: mod_event_label_state::IsSet, + St::CreateLabelVals: mod_event_label_state::IsSet, { /// Build the final struct. pub fn build(self) -> ModEventLabel { @@ -6085,44 +7413,44 @@ pub mod mod_event_tag_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Add; type Remove; + type Add; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Add = Unset; type Remove = Unset; - } - ///State transition - sets the `add` field to Set - pub struct SetAdd(PhantomData St>); - impl sealed::Sealed for SetAdd {} - impl State for SetAdd { - type Add = Set; - type Remove = St::Remove; + type Add = Unset; } ///State transition - sets the `remove` field to Set pub struct SetRemove(PhantomData St>); impl sealed::Sealed for SetRemove {} impl State for SetRemove { - type Add = St::Add; type Remove = Set; + type Add = St::Add; + } + ///State transition - sets the `add` field to Set + pub struct SetAdd(PhantomData St>); + impl sealed::Sealed for SetAdd {} + impl State for SetAdd { + type Remove = St::Remove; + type Add = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `add` field - pub struct add(()); ///Marker type for the `remove` field pub struct remove(()); + ///Marker type for the `add` field + pub struct add(()); } } /// Builder for constructing an instance of this type. pub struct ModEventTagBuilder { _state: PhantomData St>, - _fields: (Option>, Option, Option>), + _fields: (Option>, Option, Option, Option>), _type: PhantomData S>, } @@ -6138,7 +7466,7 @@ impl ModEventTagBuilder { pub fn new() -> Self { ModEventTagBuilder { _state: PhantomData, - _fields: (None, None, None), + _fields: (None, None, None, None), _type: PhantomData, } } @@ -6176,6 +7504,19 @@ impl ModEventTagBuilder { } } +impl ModEventTagBuilder { + /// Set the `durationInHours` field (optional) + pub fn duration_in_hours(mut self, value: impl Into>) -> Self { + self._fields.2 = value.into(); + self + } + /// Set the `durationInHours` field to an Option value (optional) + pub fn maybe_duration_in_hours(mut self, value: Option) -> Self { + self._fields.2 = value; + self + } +} + impl ModEventTagBuilder where St: mod_event_tag_state::State, @@ -6186,7 +7527,7 @@ where mut self, value: impl Into>, ) -> ModEventTagBuilder> { - self._fields.2 = Option::Some(value.into()); + self._fields.3 = Option::Some(value.into()); ModEventTagBuilder { _state: PhantomData, _fields: self._fields, @@ -6198,15 +7539,16 @@ where impl ModEventTagBuilder where St: mod_event_tag_state::State, - St::Add: mod_event_tag_state::IsSet, St::Remove: mod_event_tag_state::IsSet, + St::Add: mod_event_tag_state::IsSet, { /// Build the final struct. pub fn build(self) -> ModEventTag { ModEventTag { add: self._fields.0.unwrap(), comment: self._fields.1, - remove: self._fields.2.unwrap(), + duration_in_hours: self._fields.2, + remove: self._fields.3.unwrap(), extra_data: Default::default(), } } @@ -6218,7 +7560,8 @@ where ModEventTag { add: self._fields.0.unwrap(), comment: self._fields.1, - remove: self._fields.2.unwrap(), + duration_in_hours: self._fields.2, + remove: self._fields.3.unwrap(), extra_data: Some(extra_data), } } @@ -6234,105 +7577,105 @@ pub mod mod_event_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; - type CreatedBy; type Event; - type Id; type Subject; type SubjectBlobCids; + type CreatedBy; + type CreatedAt; + type Id; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; - type CreatedBy = Unset; type Event = Unset; - type Id = Unset; type Subject = Unset; type SubjectBlobCids = Unset; + type CreatedBy = Unset; + type CreatedAt = Unset; + type Id = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; + ///State transition - sets the `event` field to Set + pub struct SetEvent(PhantomData St>); + impl sealed::Sealed for SetEvent {} + impl State for SetEvent { + type Event = Set; + type Subject = St::Subject; + type SubjectBlobCids = St::SubjectBlobCids; type CreatedBy = St::CreatedBy; + type CreatedAt = St::CreatedAt; + type Id = St::Id; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData St>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { type Event = St::Event; + type Subject = Set; + type SubjectBlobCids = St::SubjectBlobCids; + type CreatedBy = St::CreatedBy; + type CreatedAt = St::CreatedAt; type Id = St::Id; + } + ///State transition - sets the `subject_blob_cids` field to Set + pub struct SetSubjectBlobCids(PhantomData St>); + impl sealed::Sealed for SetSubjectBlobCids {} + impl State for SetSubjectBlobCids { + type Event = St::Event; type Subject = St::Subject; - type SubjectBlobCids = St::SubjectBlobCids; + type SubjectBlobCids = Set; + type CreatedBy = St::CreatedBy; + type CreatedAt = St::CreatedAt; + type Id = St::Id; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData St>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type CreatedAt = St::CreatedAt; - type CreatedBy = Set; type Event = St::Event; - type Id = St::Id; type Subject = St::Subject; type SubjectBlobCids = St::SubjectBlobCids; - } - ///State transition - sets the `event` field to Set - pub struct SetEvent(PhantomData St>); - impl sealed::Sealed for SetEvent {} - impl State for SetEvent { + type CreatedBy = Set; type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; - type Event = Set; type Id = St::Id; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Event = St::Event; type Subject = St::Subject; type SubjectBlobCids = St::SubjectBlobCids; + type CreatedBy = St::CreatedBy; + type CreatedAt = Set; + type Id = St::Id; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData St>); impl sealed::Sealed for SetId {} impl State for SetId { - type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; type Event = St::Event; - type Id = Set; type Subject = St::Subject; type SubjectBlobCids = St::SubjectBlobCids; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData St>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; - type Event = St::Event; - type Id = St::Id; - type Subject = Set; - type SubjectBlobCids = St::SubjectBlobCids; - } - ///State transition - sets the `subject_blob_cids` field to Set - pub struct SetSubjectBlobCids(PhantomData St>); - impl sealed::Sealed for SetSubjectBlobCids {} - impl State for SetSubjectBlobCids { type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; - type Event = St::Event; - type Id = St::Id; - type Subject = St::Subject; - type SubjectBlobCids = Set; + type Id = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `created_by` field - pub struct created_by(()); ///Marker type for the `event` field pub struct event(()); - ///Marker type for the `id` field - pub struct id(()); ///Marker type for the `subject` field pub struct subject(()); ///Marker type for the `subject_blob_cids` field pub struct subject_blob_cids(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `id` field + pub struct id(()); } } @@ -6527,12 +7870,12 @@ impl ModEventViewBuilder { impl ModEventViewBuilder where St: mod_event_view_state::State, - St::CreatedAt: mod_event_view_state::IsSet, - St::CreatedBy: mod_event_view_state::IsSet, St::Event: mod_event_view_state::IsSet, - St::Id: mod_event_view_state::IsSet, St::Subject: mod_event_view_state::IsSet, St::SubjectBlobCids: mod_event_view_state::IsSet, + St::CreatedBy: mod_event_view_state::IsSet, + St::CreatedAt: mod_event_view_state::IsSet, + St::Id: mod_event_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> ModEventView { @@ -6579,105 +7922,105 @@ pub mod mod_event_view_detail_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; - type CreatedBy; - type Event; type Id; type Subject; + type CreatedBy; type SubjectBlobs; + type Event; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; - type CreatedBy = Unset; - type Event = Unset; type Id = Unset; type Subject = Unset; + type CreatedBy = Unset; type SubjectBlobs = Unset; + type Event = Unset; + type CreatedAt = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData St>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Id = Set; + type Subject = St::Subject; type CreatedBy = St::CreatedBy; + type SubjectBlobs = St::SubjectBlobs; type Event = St::Event; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData St>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { type Id = St::Id; - type Subject = St::Subject; + type Subject = Set; + type CreatedBy = St::CreatedBy; type SubjectBlobs = St::SubjectBlobs; + type Event = St::Event; + type CreatedAt = St::CreatedAt; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData St>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { - type CreatedAt = St::CreatedAt; + type Id = St::Id; + type Subject = St::Subject; type CreatedBy = Set; + type SubjectBlobs = St::SubjectBlobs; type Event = St::Event; + type CreatedAt = St::CreatedAt; + } + ///State transition - sets the `subject_blobs` field to Set + pub struct SetSubjectBlobs(PhantomData St>); + impl sealed::Sealed for SetSubjectBlobs {} + impl State for SetSubjectBlobs { type Id = St::Id; type Subject = St::Subject; - type SubjectBlobs = St::SubjectBlobs; + type CreatedBy = St::CreatedBy; + type SubjectBlobs = Set; + type Event = St::Event; + type CreatedAt = St::CreatedAt; } ///State transition - sets the `event` field to Set pub struct SetEvent(PhantomData St>); impl sealed::Sealed for SetEvent {} impl State for SetEvent { - type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; - type Event = Set; type Id = St::Id; type Subject = St::Subject; - type SubjectBlobs = St::SubjectBlobs; - } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData St>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; - type Event = St::Event; - type Id = Set; - type Subject = St::Subject; type SubjectBlobs = St::SubjectBlobs; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData St>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { + type Event = Set; type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; - type Event = St::Event; - type Id = St::Id; - type Subject = Set; - type SubjectBlobs = St::SubjectBlobs; } - ///State transition - sets the `subject_blobs` field to Set - pub struct SetSubjectBlobs(PhantomData St>); - impl sealed::Sealed for SetSubjectBlobs {} - impl State for SetSubjectBlobs { - type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; - type Event = St::Event; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { type Id = St::Id; type Subject = St::Subject; - type SubjectBlobs = Set; + type CreatedBy = St::CreatedBy; + type SubjectBlobs = St::SubjectBlobs; + type Event = St::Event; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `created_by` field - pub struct created_by(()); - ///Marker type for the `event` field - pub struct event(()); ///Marker type for the `id` field pub struct id(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_by` field + pub struct created_by(()); ///Marker type for the `subject_blobs` field pub struct subject_blobs(()); + ///Marker type for the `event` field + pub struct event(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -6847,12 +8190,12 @@ where impl ModEventViewDetailBuilder where St: mod_event_view_detail_state::State, - St::CreatedAt: mod_event_view_detail_state::IsSet, - St::CreatedBy: mod_event_view_detail_state::IsSet, - St::Event: mod_event_view_detail_state::IsSet, St::Id: mod_event_view_detail_state::IsSet, St::Subject: mod_event_view_detail_state::IsSet, + St::CreatedBy: mod_event_view_detail_state::IsSet, St::SubjectBlobs: mod_event_view_detail_state::IsSet, + St::Event: mod_event_view_detail_state::IsSet, + St::CreatedAt: mod_event_view_detail_state::IsSet, { /// Build the final struct. pub fn build(self) -> ModEventViewDetail { @@ -7059,125 +8402,125 @@ pub mod record_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type BlobCids; - type Cid; type IndexedAt; type Moderation; type Repo; + type BlobCids; type Uri; + type Cid; type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type BlobCids = Unset; - type Cid = Unset; type IndexedAt = Unset; type Moderation = Unset; type Repo = Unset; + type BlobCids = Unset; type Uri = Unset; + type Cid = Unset; type Value = Unset; } - ///State transition - sets the `blob_cids` field to Set - pub struct SetBlobCids(PhantomData St>); - impl sealed::Sealed for SetBlobCids {} - impl State for SetBlobCids { - type BlobCids = Set; - type Cid = St::Cid; - type IndexedAt = St::IndexedAt; - type Moderation = St::Moderation; - type Repo = St::Repo; - type Uri = St::Uri; - type Value = St::Value; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData St>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type BlobCids = St::BlobCids; - type Cid = Set; - type IndexedAt = St::IndexedAt; - type Moderation = St::Moderation; - type Repo = St::Repo; - type Uri = St::Uri; - type Value = St::Value; - } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type BlobCids = St::BlobCids; - type Cid = St::Cid; type IndexedAt = Set; type Moderation = St::Moderation; type Repo = St::Repo; + type BlobCids = St::BlobCids; type Uri = St::Uri; + type Cid = St::Cid; type Value = St::Value; } ///State transition - sets the `moderation` field to Set pub struct SetModeration(PhantomData St>); impl sealed::Sealed for SetModeration {} impl State for SetModeration { - type BlobCids = St::BlobCids; - type Cid = St::Cid; type IndexedAt = St::IndexedAt; type Moderation = Set; type Repo = St::Repo; + type BlobCids = St::BlobCids; type Uri = St::Uri; + type Cid = St::Cid; type Value = St::Value; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData St>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { + type IndexedAt = St::IndexedAt; + type Moderation = St::Moderation; + type Repo = Set; type BlobCids = St::BlobCids; + type Uri = St::Uri; type Cid = St::Cid; + type Value = St::Value; + } + ///State transition - sets the `blob_cids` field to Set + pub struct SetBlobCids(PhantomData St>); + impl sealed::Sealed for SetBlobCids {} + impl State for SetBlobCids { type IndexedAt = St::IndexedAt; type Moderation = St::Moderation; - type Repo = Set; + type Repo = St::Repo; + type BlobCids = Set; type Uri = St::Uri; + type Cid = St::Cid; type Value = St::Value; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { + type IndexedAt = St::IndexedAt; + type Moderation = St::Moderation; + type Repo = St::Repo; type BlobCids = St::BlobCids; + type Uri = Set; type Cid = St::Cid; + type Value = St::Value; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData St>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type IndexedAt = St::IndexedAt; type Moderation = St::Moderation; type Repo = St::Repo; - type Uri = Set; + type BlobCids = St::BlobCids; + type Uri = St::Uri; + type Cid = Set; type Value = St::Value; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData St>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type BlobCids = St::BlobCids; - type Cid = St::Cid; type IndexedAt = St::IndexedAt; type Moderation = St::Moderation; type Repo = St::Repo; + type BlobCids = St::BlobCids; type Uri = St::Uri; + type Cid = St::Cid; type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `blob_cids` field - pub struct blob_cids(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `moderation` field pub struct moderation(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `blob_cids` field + pub struct blob_cids(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `value` field pub struct value(()); } @@ -7352,12 +8695,12 @@ where impl RecordViewBuilder where St: record_view_state::State, - St::BlobCids: record_view_state::IsSet, - St::Cid: record_view_state::IsSet, St::IndexedAt: record_view_state::IsSet, St::Moderation: record_view_state::IsSet, St::Repo: record_view_state::IsSet, + St::BlobCids: record_view_state::IsSet, St::Uri: record_view_state::IsSet, + St::Cid: record_view_state::IsSet, St::Value: record_view_state::IsSet, { /// Build the final struct. @@ -7402,11 +8745,11 @@ pub mod record_view_detail_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Blobs; + type Uri; + type Moderation; type Cid; type IndexedAt; - type Moderation; type Repo; - type Uri; type Value; } /// Empty state - all required fields are unset @@ -7414,11 +8757,11 @@ pub mod record_view_detail_state { impl sealed::Sealed for Empty {} impl State for Empty { type Blobs = Unset; + type Uri = Unset; + type Moderation = Unset; type Cid = Unset; type IndexedAt = Unset; - type Moderation = Unset; type Repo = Unset; - type Uri = Unset; type Value = Unset; } ///State transition - sets the `blobs` field to Set @@ -7426,11 +8769,35 @@ pub mod record_view_detail_state { impl sealed::Sealed for SetBlobs {} impl State for SetBlobs { type Blobs = Set; + type Uri = St::Uri; + type Moderation = St::Moderation; type Cid = St::Cid; type IndexedAt = St::IndexedAt; + type Repo = St::Repo; + type Value = St::Value; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Blobs = St::Blobs; + type Uri = Set; type Moderation = St::Moderation; + type Cid = St::Cid; + type IndexedAt = St::IndexedAt; type Repo = St::Repo; + type Value = St::Value; + } + ///State transition - sets the `moderation` field to Set + pub struct SetModeration(PhantomData St>); + impl sealed::Sealed for SetModeration {} + impl State for SetModeration { + type Blobs = St::Blobs; type Uri = St::Uri; + type Moderation = Set; + type Cid = St::Cid; + type IndexedAt = St::IndexedAt; + type Repo = St::Repo; type Value = St::Value; } ///State transition - sets the `cid` field to Set @@ -7438,11 +8805,11 @@ pub mod record_view_detail_state { impl sealed::Sealed for SetCid {} impl State for SetCid { type Blobs = St::Blobs; + type Uri = St::Uri; + type Moderation = St::Moderation; type Cid = Set; type IndexedAt = St::IndexedAt; - type Moderation = St::Moderation; type Repo = St::Repo; - type Uri = St::Uri; type Value = St::Value; } ///State transition - sets the `indexed_at` field to Set @@ -7450,23 +8817,11 @@ pub mod record_view_detail_state { impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Blobs = St::Blobs; - type Cid = St::Cid; - type IndexedAt = Set; - type Moderation = St::Moderation; - type Repo = St::Repo; type Uri = St::Uri; - type Value = St::Value; - } - ///State transition - sets the `moderation` field to Set - pub struct SetModeration(PhantomData St>); - impl sealed::Sealed for SetModeration {} - impl State for SetModeration { - type Blobs = St::Blobs; + type Moderation = St::Moderation; type Cid = St::Cid; - type IndexedAt = St::IndexedAt; - type Moderation = Set; + type IndexedAt = Set; type Repo = St::Repo; - type Uri = St::Uri; type Value = St::Value; } ///State transition - sets the `repo` field to Set @@ -7474,23 +8829,11 @@ pub mod record_view_detail_state { impl sealed::Sealed for SetRepo {} impl State for SetRepo { type Blobs = St::Blobs; - type Cid = St::Cid; - type IndexedAt = St::IndexedAt; - type Moderation = St::Moderation; - type Repo = Set; type Uri = St::Uri; - type Value = St::Value; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Blobs = St::Blobs; + type Moderation = St::Moderation; type Cid = St::Cid; type IndexedAt = St::IndexedAt; - type Moderation = St::Moderation; - type Repo = St::Repo; - type Uri = Set; + type Repo = Set; type Value = St::Value; } ///State transition - sets the `value` field to Set @@ -7498,11 +8841,11 @@ pub mod record_view_detail_state { impl sealed::Sealed for SetValue {} impl State for SetValue { type Blobs = St::Blobs; + type Uri = St::Uri; + type Moderation = St::Moderation; type Cid = St::Cid; type IndexedAt = St::IndexedAt; - type Moderation = St::Moderation; type Repo = St::Repo; - type Uri = St::Uri; type Value = Set; } /// Marker types for field names @@ -7510,16 +8853,16 @@ pub mod record_view_detail_state { pub mod members { ///Marker type for the `blobs` field pub struct blobs(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `moderation` field + pub struct moderation(()); ///Marker type for the `cid` field pub struct cid(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `moderation` field - pub struct moderation(()); ///Marker type for the `repo` field pub struct repo(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `value` field pub struct value(()); } @@ -7709,11 +9052,11 @@ impl RecordViewDetailBuilder where St: record_view_detail_state::State, St::Blobs: record_view_detail_state::IsSet, + St::Uri: record_view_detail_state::IsSet, + St::Moderation: record_view_detail_state::IsSet, St::Cid: record_view_detail_state::IsSet, St::IndexedAt: record_view_detail_state::IsSet, - St::Moderation: record_view_detail_state::IsSet, St::Repo: record_view_detail_state::IsSet, - St::Uri: record_view_detail_state::IsSet, St::Value: record_view_detail_state::IsSet, { /// Build the final struct. @@ -7859,85 +9202,85 @@ pub mod repo_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type RelatedRecords; + type Moderation; type Did; type Handle; type IndexedAt; - type Moderation; - type RelatedRecords; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type RelatedRecords = Unset; + type Moderation = Unset; type Did = Unset; type Handle = Unset; type IndexedAt = Unset; - type Moderation = Unset; - type RelatedRecords = Unset; + } + ///State transition - sets the `related_records` field to Set + pub struct SetRelatedRecords(PhantomData St>); + impl sealed::Sealed for SetRelatedRecords {} + impl State for SetRelatedRecords { + type RelatedRecords = Set; + type Moderation = St::Moderation; + type Did = St::Did; + type Handle = St::Handle; + type IndexedAt = St::IndexedAt; + } + ///State transition - sets the `moderation` field to Set + pub struct SetModeration(PhantomData St>); + impl sealed::Sealed for SetModeration {} + impl State for SetModeration { + type RelatedRecords = St::RelatedRecords; + type Moderation = Set; + type Did = St::Did; + type Handle = St::Handle; + type IndexedAt = St::IndexedAt; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { + type RelatedRecords = St::RelatedRecords; + type Moderation = St::Moderation; type Did = Set; type Handle = St::Handle; type IndexedAt = St::IndexedAt; - type Moderation = St::Moderation; - type RelatedRecords = St::RelatedRecords; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData St>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { + type RelatedRecords = St::RelatedRecords; + type Moderation = St::Moderation; type Did = St::Did; type Handle = Set; type IndexedAt = St::IndexedAt; - type Moderation = St::Moderation; - type RelatedRecords = St::RelatedRecords; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Did = St::Did; - type Handle = St::Handle; - type IndexedAt = Set; - type Moderation = St::Moderation; - type RelatedRecords = St::RelatedRecords; - } - ///State transition - sets the `moderation` field to Set - pub struct SetModeration(PhantomData St>); - impl sealed::Sealed for SetModeration {} - impl State for SetModeration { - type Did = St::Did; - type Handle = St::Handle; - type IndexedAt = St::IndexedAt; - type Moderation = Set; type RelatedRecords = St::RelatedRecords; - } - ///State transition - sets the `related_records` field to Set - pub struct SetRelatedRecords(PhantomData St>); - impl sealed::Sealed for SetRelatedRecords {} - impl State for SetRelatedRecords { + type Moderation = St::Moderation; type Did = St::Did; type Handle = St::Handle; - type IndexedAt = St::IndexedAt; - type Moderation = St::Moderation; - type RelatedRecords = Set; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `related_records` field + pub struct related_records(()); + ///Marker type for the `moderation` field + pub struct moderation(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `moderation` field - pub struct moderation(()); - ///Marker type for the `related_records` field - pub struct related_records(()); } } @@ -8160,11 +9503,11 @@ impl RepoViewBuilder { impl RepoViewBuilder where St: repo_view_state::State, + St::RelatedRecords: repo_view_state::IsSet, + St::Moderation: repo_view_state::IsSet, St::Did: repo_view_state::IsSet, St::Handle: repo_view_state::IsSet, St::IndexedAt: repo_view_state::IsSet, - St::Moderation: repo_view_state::IsSet, - St::RelatedRecords: repo_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> RepoView { @@ -8214,9 +9557,9 @@ pub mod repo_view_detail_state { pub trait State: sealed::Sealed { type Did; type Handle; + type RelatedRecords; type IndexedAt; type Moderation; - type RelatedRecords; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -8224,9 +9567,9 @@ pub mod repo_view_detail_state { impl State for Empty { type Did = Unset; type Handle = Unset; + type RelatedRecords = Unset; type IndexedAt = Unset; type Moderation = Unset; - type RelatedRecords = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); @@ -8234,9 +9577,9 @@ pub mod repo_view_detail_state { impl State for SetDid { type Did = Set; type Handle = St::Handle; + type RelatedRecords = St::RelatedRecords; type IndexedAt = St::IndexedAt; type Moderation = St::Moderation; - type RelatedRecords = St::RelatedRecords; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData St>); @@ -8244,9 +9587,19 @@ pub mod repo_view_detail_state { impl State for SetHandle { type Did = St::Did; type Handle = Set; + type RelatedRecords = St::RelatedRecords; + type IndexedAt = St::IndexedAt; + type Moderation = St::Moderation; + } + ///State transition - sets the `related_records` field to Set + pub struct SetRelatedRecords(PhantomData St>); + impl sealed::Sealed for SetRelatedRecords {} + impl State for SetRelatedRecords { + type Did = St::Did; + type Handle = St::Handle; + type RelatedRecords = Set; type IndexedAt = St::IndexedAt; type Moderation = St::Moderation; - type RelatedRecords = St::RelatedRecords; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData St>); @@ -8254,9 +9607,9 @@ pub mod repo_view_detail_state { impl State for SetIndexedAt { type Did = St::Did; type Handle = St::Handle; + type RelatedRecords = St::RelatedRecords; type IndexedAt = Set; type Moderation = St::Moderation; - type RelatedRecords = St::RelatedRecords; } ///State transition - sets the `moderation` field to Set pub struct SetModeration(PhantomData St>); @@ -8264,19 +9617,9 @@ pub mod repo_view_detail_state { impl State for SetModeration { type Did = St::Did; type Handle = St::Handle; + type RelatedRecords = St::RelatedRecords; type IndexedAt = St::IndexedAt; type Moderation = Set; - type RelatedRecords = St::RelatedRecords; - } - ///State transition - sets the `related_records` field to Set - pub struct SetRelatedRecords(PhantomData St>); - impl sealed::Sealed for SetRelatedRecords {} - impl State for SetRelatedRecords { - type Did = St::Did; - type Handle = St::Handle; - type IndexedAt = St::IndexedAt; - type Moderation = St::Moderation; - type RelatedRecords = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -8285,12 +9628,12 @@ pub mod repo_view_detail_state { pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `related_records` field + pub struct related_records(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `moderation` field pub struct moderation(()); - ///Marker type for the `related_records` field - pub struct related_records(()); } } @@ -8572,9 +9915,9 @@ where St: repo_view_detail_state::State, St::Did: repo_view_detail_state::IsSet, St::Handle: repo_view_detail_state::IsSet, + St::RelatedRecords: repo_view_detail_state::IsSet, St::IndexedAt: repo_view_detail_state::IsSet, St::Moderation: repo_view_detail_state::IsSet, - St::RelatedRecords: repo_view_detail_state::IsSet, { /// Build the final struct. pub fn build(self) -> RepoViewDetail { @@ -8731,177 +10074,177 @@ pub mod reporter_stats_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AccountReportCount; + type ReportedAccountCount; type Did; + type TakendownRecordCount; + type ReportedRecordCount; + type AccountReportCount; type LabeledAccountCount; type LabeledRecordCount; type RecordReportCount; - type ReportedAccountCount; - type ReportedRecordCount; type TakendownAccountCount; - type TakendownRecordCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AccountReportCount = Unset; + type ReportedAccountCount = Unset; type Did = Unset; + type TakendownRecordCount = Unset; + type ReportedRecordCount = Unset; + type AccountReportCount = Unset; type LabeledAccountCount = Unset; type LabeledRecordCount = Unset; type RecordReportCount = Unset; - type ReportedAccountCount = Unset; - type ReportedRecordCount = Unset; type TakendownAccountCount = Unset; - type TakendownRecordCount = Unset; } - ///State transition - sets the `account_report_count` field to Set - pub struct SetAccountReportCount(PhantomData St>); - impl sealed::Sealed for SetAccountReportCount {} - impl State for SetAccountReportCount { - type AccountReportCount = Set; + ///State transition - sets the `reported_account_count` field to Set + pub struct SetReportedAccountCount(PhantomData St>); + impl sealed::Sealed for SetReportedAccountCount {} + impl State for SetReportedAccountCount { + type ReportedAccountCount = Set; type Did = St::Did; + type TakendownRecordCount = St::TakendownRecordCount; + type ReportedRecordCount = St::ReportedRecordCount; + type AccountReportCount = St::AccountReportCount; type LabeledAccountCount = St::LabeledAccountCount; type LabeledRecordCount = St::LabeledRecordCount; type RecordReportCount = St::RecordReportCount; - type ReportedAccountCount = St::ReportedAccountCount; - type ReportedRecordCount = St::ReportedRecordCount; type TakendownAccountCount = St::TakendownAccountCount; - type TakendownRecordCount = St::TakendownRecordCount; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData St>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type AccountReportCount = St::AccountReportCount; + type ReportedAccountCount = St::ReportedAccountCount; type Did = Set; + type TakendownRecordCount = St::TakendownRecordCount; + type ReportedRecordCount = St::ReportedRecordCount; + type AccountReportCount = St::AccountReportCount; type LabeledAccountCount = St::LabeledAccountCount; type LabeledRecordCount = St::LabeledRecordCount; type RecordReportCount = St::RecordReportCount; + type TakendownAccountCount = St::TakendownAccountCount; + } + ///State transition - sets the `takendown_record_count` field to Set + pub struct SetTakendownRecordCount(PhantomData St>); + impl sealed::Sealed for SetTakendownRecordCount {} + impl State for SetTakendownRecordCount { type ReportedAccountCount = St::ReportedAccountCount; + type Did = St::Did; + type TakendownRecordCount = Set; type ReportedRecordCount = St::ReportedRecordCount; + type AccountReportCount = St::AccountReportCount; + type LabeledAccountCount = St::LabeledAccountCount; + type LabeledRecordCount = St::LabeledRecordCount; + type RecordReportCount = St::RecordReportCount; type TakendownAccountCount = St::TakendownAccountCount; + } + ///State transition - sets the `reported_record_count` field to Set + pub struct SetReportedRecordCount(PhantomData St>); + impl sealed::Sealed for SetReportedRecordCount {} + impl State for SetReportedRecordCount { + type ReportedAccountCount = St::ReportedAccountCount; + type Did = St::Did; + type TakendownRecordCount = St::TakendownRecordCount; + type ReportedRecordCount = Set; + type AccountReportCount = St::AccountReportCount; + type LabeledAccountCount = St::LabeledAccountCount; + type LabeledRecordCount = St::LabeledRecordCount; + type RecordReportCount = St::RecordReportCount; + type TakendownAccountCount = St::TakendownAccountCount; + } + ///State transition - sets the `account_report_count` field to Set + pub struct SetAccountReportCount(PhantomData St>); + impl sealed::Sealed for SetAccountReportCount {} + impl State for SetAccountReportCount { + type ReportedAccountCount = St::ReportedAccountCount; + type Did = St::Did; type TakendownRecordCount = St::TakendownRecordCount; + type ReportedRecordCount = St::ReportedRecordCount; + type AccountReportCount = Set; + type LabeledAccountCount = St::LabeledAccountCount; + type LabeledRecordCount = St::LabeledRecordCount; + type RecordReportCount = St::RecordReportCount; + type TakendownAccountCount = St::TakendownAccountCount; } ///State transition - sets the `labeled_account_count` field to Set pub struct SetLabeledAccountCount(PhantomData St>); impl sealed::Sealed for SetLabeledAccountCount {} impl State for SetLabeledAccountCount { - type AccountReportCount = St::AccountReportCount; + type ReportedAccountCount = St::ReportedAccountCount; type Did = St::Did; + type TakendownRecordCount = St::TakendownRecordCount; + type ReportedRecordCount = St::ReportedRecordCount; + type AccountReportCount = St::AccountReportCount; type LabeledAccountCount = Set; type LabeledRecordCount = St::LabeledRecordCount; type RecordReportCount = St::RecordReportCount; - type ReportedAccountCount = St::ReportedAccountCount; - type ReportedRecordCount = St::ReportedRecordCount; type TakendownAccountCount = St::TakendownAccountCount; - type TakendownRecordCount = St::TakendownRecordCount; } ///State transition - sets the `labeled_record_count` field to Set pub struct SetLabeledRecordCount(PhantomData St>); impl sealed::Sealed for SetLabeledRecordCount {} impl State for SetLabeledRecordCount { - type AccountReportCount = St::AccountReportCount; + type ReportedAccountCount = St::ReportedAccountCount; type Did = St::Did; + type TakendownRecordCount = St::TakendownRecordCount; + type ReportedRecordCount = St::ReportedRecordCount; + type AccountReportCount = St::AccountReportCount; type LabeledAccountCount = St::LabeledAccountCount; type LabeledRecordCount = Set; type RecordReportCount = St::RecordReportCount; - type ReportedAccountCount = St::ReportedAccountCount; - type ReportedRecordCount = St::ReportedRecordCount; type TakendownAccountCount = St::TakendownAccountCount; - type TakendownRecordCount = St::TakendownRecordCount; } ///State transition - sets the `record_report_count` field to Set pub struct SetRecordReportCount(PhantomData St>); impl sealed::Sealed for SetRecordReportCount {} impl State for SetRecordReportCount { - type AccountReportCount = St::AccountReportCount; - type Did = St::Did; - type LabeledAccountCount = St::LabeledAccountCount; - type LabeledRecordCount = St::LabeledRecordCount; - type RecordReportCount = Set; type ReportedAccountCount = St::ReportedAccountCount; - type ReportedRecordCount = St::ReportedRecordCount; - type TakendownAccountCount = St::TakendownAccountCount; - type TakendownRecordCount = St::TakendownRecordCount; - } - ///State transition - sets the `reported_account_count` field to Set - pub struct SetReportedAccountCount(PhantomData St>); - impl sealed::Sealed for SetReportedAccountCount {} - impl State for SetReportedAccountCount { - type AccountReportCount = St::AccountReportCount; type Did = St::Did; - type LabeledAccountCount = St::LabeledAccountCount; - type LabeledRecordCount = St::LabeledRecordCount; - type RecordReportCount = St::RecordReportCount; - type ReportedAccountCount = Set; - type ReportedRecordCount = St::ReportedRecordCount; - type TakendownAccountCount = St::TakendownAccountCount; type TakendownRecordCount = St::TakendownRecordCount; - } - ///State transition - sets the `reported_record_count` field to Set - pub struct SetReportedRecordCount(PhantomData St>); - impl sealed::Sealed for SetReportedRecordCount {} - impl State for SetReportedRecordCount { + type ReportedRecordCount = St::ReportedRecordCount; type AccountReportCount = St::AccountReportCount; - type Did = St::Did; type LabeledAccountCount = St::LabeledAccountCount; type LabeledRecordCount = St::LabeledRecordCount; - type RecordReportCount = St::RecordReportCount; - type ReportedAccountCount = St::ReportedAccountCount; - type ReportedRecordCount = Set; + type RecordReportCount = Set; type TakendownAccountCount = St::TakendownAccountCount; - type TakendownRecordCount = St::TakendownRecordCount; } ///State transition - sets the `takendown_account_count` field to Set pub struct SetTakendownAccountCount(PhantomData St>); impl sealed::Sealed for SetTakendownAccountCount {} impl State for SetTakendownAccountCount { - type AccountReportCount = St::AccountReportCount; - type Did = St::Did; - type LabeledAccountCount = St::LabeledAccountCount; - type LabeledRecordCount = St::LabeledRecordCount; - type RecordReportCount = St::RecordReportCount; type ReportedAccountCount = St::ReportedAccountCount; - type ReportedRecordCount = St::ReportedRecordCount; - type TakendownAccountCount = Set; + type Did = St::Did; type TakendownRecordCount = St::TakendownRecordCount; - } - ///State transition - sets the `takendown_record_count` field to Set - pub struct SetTakendownRecordCount(PhantomData St>); - impl sealed::Sealed for SetTakendownRecordCount {} - impl State for SetTakendownRecordCount { + type ReportedRecordCount = St::ReportedRecordCount; type AccountReportCount = St::AccountReportCount; - type Did = St::Did; type LabeledAccountCount = St::LabeledAccountCount; type LabeledRecordCount = St::LabeledRecordCount; type RecordReportCount = St::RecordReportCount; - type ReportedAccountCount = St::ReportedAccountCount; - type ReportedRecordCount = St::ReportedRecordCount; - type TakendownAccountCount = St::TakendownAccountCount; - type TakendownRecordCount = Set; + type TakendownAccountCount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `account_report_count` field - pub struct account_report_count(()); + ///Marker type for the `reported_account_count` field + pub struct reported_account_count(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `takendown_record_count` field + pub struct takendown_record_count(()); + ///Marker type for the `reported_record_count` field + pub struct reported_record_count(()); + ///Marker type for the `account_report_count` field + pub struct account_report_count(()); ///Marker type for the `labeled_account_count` field pub struct labeled_account_count(()); ///Marker type for the `labeled_record_count` field pub struct labeled_record_count(()); ///Marker type for the `record_report_count` field pub struct record_report_count(()); - ///Marker type for the `reported_account_count` field - pub struct reported_account_count(()); - ///Marker type for the `reported_record_count` field - pub struct reported_record_count(()); ///Marker type for the `takendown_account_count` field pub struct takendown_account_count(()); - ///Marker type for the `takendown_record_count` field - pub struct takendown_record_count(()); } } @@ -9073,18 +10416,499 @@ where } } -impl ReporterStatsBuilder +impl ReporterStatsBuilder +where + St: reporter_stats_state::State, + St::TakendownAccountCount: reporter_stats_state::IsUnset, +{ + /// Set the `takendownAccountCount` field (required) + pub fn takendown_account_count( + mut self, + value: impl Into, + ) -> ReporterStatsBuilder> { + self._fields.7 = Option::Some(value.into()); + ReporterStatsBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ReporterStatsBuilder +where + St: reporter_stats_state::State, + St::TakendownRecordCount: reporter_stats_state::IsUnset, +{ + /// Set the `takendownRecordCount` field (required) + pub fn takendown_record_count( + mut self, + value: impl Into, + ) -> ReporterStatsBuilder> { + self._fields.8 = Option::Some(value.into()); + ReporterStatsBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ReporterStatsBuilder +where + St: reporter_stats_state::State, + St::ReportedAccountCount: reporter_stats_state::IsSet, + St::Did: reporter_stats_state::IsSet, + St::TakendownRecordCount: reporter_stats_state::IsSet, + St::ReportedRecordCount: reporter_stats_state::IsSet, + St::AccountReportCount: reporter_stats_state::IsSet, + St::LabeledAccountCount: reporter_stats_state::IsSet, + St::LabeledRecordCount: reporter_stats_state::IsSet, + St::RecordReportCount: reporter_stats_state::IsSet, + St::TakendownAccountCount: reporter_stats_state::IsSet, +{ + /// Build the final struct. + pub fn build(self) -> ReporterStats { + ReporterStats { + account_report_count: self._fields.0.unwrap(), + did: self._fields.1.unwrap(), + labeled_account_count: self._fields.2.unwrap(), + labeled_record_count: self._fields.3.unwrap(), + record_report_count: self._fields.4.unwrap(), + reported_account_count: self._fields.5.unwrap(), + reported_record_count: self._fields.6.unwrap(), + takendown_account_count: self._fields.7.unwrap(), + takendown_record_count: self._fields.8.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data. + pub fn build_with_data( + self, + extra_data: BTreeMap>, + ) -> ReporterStats { + ReporterStats { + account_report_count: self._fields.0.unwrap(), + did: self._fields.1.unwrap(), + labeled_account_count: self._fields.2.unwrap(), + labeled_record_count: self._fields.3.unwrap(), + record_report_count: self._fields.4.unwrap(), + reported_account_count: self._fields.5.unwrap(), + reported_record_count: self._fields.6.unwrap(), + takendown_account_count: self._fields.7.unwrap(), + takendown_record_count: self._fields.8.unwrap(), + extra_data: Some(extra_data), + } + } +} + +pub mod scheduled_action_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type CreatedBy; + type Id; + type CreatedAt; + type Status; + type Did; + type Action; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type CreatedBy = Unset; + type Id = Unset; + type CreatedAt = Unset; + type Status = Unset; + type Did = Unset; + type Action = Unset; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData St>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type CreatedBy = Set; + type Id = St::Id; + type CreatedAt = St::CreatedAt; + type Status = St::Status; + type Did = St::Did; + type Action = St::Action; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData St>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type CreatedBy = St::CreatedBy; + type Id = Set; + type CreatedAt = St::CreatedAt; + type Status = St::Status; + type Did = St::Did; + type Action = St::Action; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedBy = St::CreatedBy; + type Id = St::Id; + type CreatedAt = Set; + type Status = St::Status; + type Did = St::Did; + type Action = St::Action; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData St>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type CreatedBy = St::CreatedBy; + type Id = St::Id; + type CreatedAt = St::CreatedAt; + type Status = Set; + type Did = St::Did; + type Action = St::Action; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type CreatedBy = St::CreatedBy; + type Id = St::Id; + type CreatedAt = St::CreatedAt; + type Status = St::Status; + type Did = Set; + type Action = St::Action; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData St>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { + type CreatedBy = St::CreatedBy; + type Id = St::Id; + type CreatedAt = St::CreatedAt; + type Status = St::Status; + type Did = St::Did; + type Action = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `id` field + pub struct id(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `status` field + pub struct status(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `action` field + pub struct action(()); + } +} + +/// Builder for constructing an instance of this type. +pub struct ScheduledActionViewBuilder< + S: BosStr, + St: scheduled_action_view_state::State, +> { + _state: PhantomData St>, + _fields: ( + Option>, + Option, + Option>, + Option>, + Option>, + Option, + Option, + Option, + Option, + Option, + Option, + Option, + Option, + Option>, + Option, + ), + _type: PhantomData S>, +} + +impl ScheduledActionView { + /// Create a new builder for this type. + pub fn new() -> ScheduledActionViewBuilder { + ScheduledActionViewBuilder::new() + } +} + +impl ScheduledActionViewBuilder { + /// Create a new builder with all fields unset. + pub fn new() -> Self { + ScheduledActionViewBuilder { + _state: PhantomData, + _fields: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _type: PhantomData, + } + } +} + +impl ScheduledActionViewBuilder +where + St: scheduled_action_view_state::State, + St::Action: scheduled_action_view_state::IsUnset, +{ + /// Set the `action` field (required) + pub fn action( + mut self, + value: impl Into>, + ) -> ScheduledActionViewBuilder> { + self._fields.0 = Option::Some(value.into()); + ScheduledActionViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ScheduledActionViewBuilder +where + St: scheduled_action_view_state::State, + St::CreatedAt: scheduled_action_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> ScheduledActionViewBuilder> { + self._fields.1 = Option::Some(value.into()); + ScheduledActionViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ScheduledActionViewBuilder +where + St: scheduled_action_view_state::State, + St::CreatedBy: scheduled_action_view_state::IsUnset, +{ + /// Set the `createdBy` field (required) + pub fn created_by( + mut self, + value: impl Into>, + ) -> ScheduledActionViewBuilder> { + self._fields.2 = Option::Some(value.into()); + ScheduledActionViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl ScheduledActionViewBuilder +where + St: scheduled_action_view_state::State, + St::Did: scheduled_action_view_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> ScheduledActionViewBuilder> { + self._fields.3 = Option::Some(value.into()); + ScheduledActionViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl< + S: BosStr, + St: scheduled_action_view_state::State, +> ScheduledActionViewBuilder { + /// Set the `eventData` field (optional) + pub fn event_data(mut self, value: impl Into>>) -> Self { + self._fields.4 = value.into(); + self + } + /// Set the `eventData` field to an Option value (optional) + pub fn maybe_event_data(mut self, value: Option>) -> Self { + self._fields.4 = value; + self + } +} + +impl< + S: BosStr, + St: scheduled_action_view_state::State, +> ScheduledActionViewBuilder { + /// Set the `executeAfter` field (optional) + pub fn execute_after(mut self, value: impl Into>) -> Self { + self._fields.5 = value.into(); + self + } + /// Set the `executeAfter` field to an Option value (optional) + pub fn maybe_execute_after(mut self, value: Option) -> Self { + self._fields.5 = value; + self + } +} + +impl< + S: BosStr, + St: scheduled_action_view_state::State, +> ScheduledActionViewBuilder { + /// Set the `executeAt` field (optional) + pub fn execute_at(mut self, value: impl Into>) -> Self { + self._fields.6 = value.into(); + self + } + /// Set the `executeAt` field to an Option value (optional) + pub fn maybe_execute_at(mut self, value: Option) -> Self { + self._fields.6 = value; + self + } +} + +impl< + S: BosStr, + St: scheduled_action_view_state::State, +> ScheduledActionViewBuilder { + /// Set the `executeUntil` field (optional) + pub fn execute_until(mut self, value: impl Into>) -> Self { + self._fields.7 = value.into(); + self + } + /// Set the `executeUntil` field to an Option value (optional) + pub fn maybe_execute_until(mut self, value: Option) -> Self { + self._fields.7 = value; + self + } +} + +impl< + S: BosStr, + St: scheduled_action_view_state::State, +> ScheduledActionViewBuilder { + /// Set the `executionEventId` field (optional) + pub fn execution_event_id(mut self, value: impl Into>) -> Self { + self._fields.8 = value.into(); + self + } + /// Set the `executionEventId` field to an Option value (optional) + pub fn maybe_execution_event_id(mut self, value: Option) -> Self { + self._fields.8 = value; + self + } +} + +impl ScheduledActionViewBuilder +where + St: scheduled_action_view_state::State, + St::Id: scheduled_action_view_state::IsUnset, +{ + /// Set the `id` field (required) + pub fn id( + mut self, + value: impl Into, + ) -> ScheduledActionViewBuilder> { + self._fields.9 = Option::Some(value.into()); + ScheduledActionViewBuilder { + _state: PhantomData, + _fields: self._fields, + _type: PhantomData, + } + } +} + +impl< + S: BosStr, + St: scheduled_action_view_state::State, +> ScheduledActionViewBuilder { + /// Set the `lastExecutedAt` field (optional) + pub fn last_executed_at(mut self, value: impl Into>) -> Self { + self._fields.10 = value.into(); + self + } + /// Set the `lastExecutedAt` field to an Option value (optional) + pub fn maybe_last_executed_at(mut self, value: Option) -> Self { + self._fields.10 = value; + self + } +} + +impl< + S: BosStr, + St: scheduled_action_view_state::State, +> ScheduledActionViewBuilder { + /// Set the `lastFailureReason` field (optional) + pub fn last_failure_reason(mut self, value: impl Into>) -> Self { + self._fields.11 = value.into(); + self + } + /// Set the `lastFailureReason` field to an Option value (optional) + pub fn maybe_last_failure_reason(mut self, value: Option) -> Self { + self._fields.11 = value; + self + } +} + +impl< + S: BosStr, + St: scheduled_action_view_state::State, +> ScheduledActionViewBuilder { + /// Set the `randomizeExecution` field (optional) + pub fn randomize_execution(mut self, value: impl Into>) -> Self { + self._fields.12 = value.into(); + self + } + /// Set the `randomizeExecution` field to an Option value (optional) + pub fn maybe_randomize_execution(mut self, value: Option) -> Self { + self._fields.12 = value; + self + } +} + +impl ScheduledActionViewBuilder where - St: reporter_stats_state::State, - St::TakendownAccountCount: reporter_stats_state::IsUnset, + St: scheduled_action_view_state::State, + St::Status: scheduled_action_view_state::IsUnset, { - /// Set the `takendownAccountCount` field (required) - pub fn takendown_account_count( + /// Set the `status` field (required) + pub fn status( mut self, - value: impl Into, - ) -> ReporterStatsBuilder> { - self._fields.7 = Option::Some(value.into()); - ReporterStatsBuilder { + value: impl Into>, + ) -> ScheduledActionViewBuilder> { + self._fields.13 = Option::Some(value.into()); + ScheduledActionViewBuilder { _state: PhantomData, _fields: self._fields, _type: PhantomData, @@ -9092,50 +10916,50 @@ where } } -impl ReporterStatsBuilder -where - St: reporter_stats_state::State, - St::TakendownRecordCount: reporter_stats_state::IsUnset, -{ - /// Set the `takendownRecordCount` field (required) - pub fn takendown_record_count( - mut self, - value: impl Into, - ) -> ReporterStatsBuilder> { - self._fields.8 = Option::Some(value.into()); - ReporterStatsBuilder { - _state: PhantomData, - _fields: self._fields, - _type: PhantomData, - } +impl< + S: BosStr, + St: scheduled_action_view_state::State, +> ScheduledActionViewBuilder { + /// Set the `updatedAt` field (optional) + pub fn updated_at(mut self, value: impl Into>) -> Self { + self._fields.14 = value.into(); + self + } + /// Set the `updatedAt` field to an Option value (optional) + pub fn maybe_updated_at(mut self, value: Option) -> Self { + self._fields.14 = value; + self } } -impl ReporterStatsBuilder +impl ScheduledActionViewBuilder where - St: reporter_stats_state::State, - St::AccountReportCount: reporter_stats_state::IsSet, - St::Did: reporter_stats_state::IsSet, - St::LabeledAccountCount: reporter_stats_state::IsSet, - St::LabeledRecordCount: reporter_stats_state::IsSet, - St::RecordReportCount: reporter_stats_state::IsSet, - St::ReportedAccountCount: reporter_stats_state::IsSet, - St::ReportedRecordCount: reporter_stats_state::IsSet, - St::TakendownAccountCount: reporter_stats_state::IsSet, - St::TakendownRecordCount: reporter_stats_state::IsSet, + St: scheduled_action_view_state::State, + St::CreatedBy: scheduled_action_view_state::IsSet, + St::Id: scheduled_action_view_state::IsSet, + St::CreatedAt: scheduled_action_view_state::IsSet, + St::Status: scheduled_action_view_state::IsSet, + St::Did: scheduled_action_view_state::IsSet, + St::Action: scheduled_action_view_state::IsSet, { /// Build the final struct. - pub fn build(self) -> ReporterStats { - ReporterStats { - account_report_count: self._fields.0.unwrap(), - did: self._fields.1.unwrap(), - labeled_account_count: self._fields.2.unwrap(), - labeled_record_count: self._fields.3.unwrap(), - record_report_count: self._fields.4.unwrap(), - reported_account_count: self._fields.5.unwrap(), - reported_record_count: self._fields.6.unwrap(), - takendown_account_count: self._fields.7.unwrap(), - takendown_record_count: self._fields.8.unwrap(), + pub fn build(self) -> ScheduledActionView { + ScheduledActionView { + action: self._fields.0.unwrap(), + created_at: self._fields.1.unwrap(), + created_by: self._fields.2.unwrap(), + did: self._fields.3.unwrap(), + event_data: self._fields.4, + execute_after: self._fields.5, + execute_at: self._fields.6, + execute_until: self._fields.7, + execution_event_id: self._fields.8, + id: self._fields.9.unwrap(), + last_executed_at: self._fields.10, + last_failure_reason: self._fields.11, + randomize_execution: self._fields.12, + status: self._fields.13.unwrap(), + updated_at: self._fields.14, extra_data: Default::default(), } } @@ -9143,17 +10967,23 @@ where pub fn build_with_data( self, extra_data: BTreeMap>, - ) -> ReporterStats { - ReporterStats { - account_report_count: self._fields.0.unwrap(), - did: self._fields.1.unwrap(), - labeled_account_count: self._fields.2.unwrap(), - labeled_record_count: self._fields.3.unwrap(), - record_report_count: self._fields.4.unwrap(), - reported_account_count: self._fields.5.unwrap(), - reported_record_count: self._fields.6.unwrap(), - takendown_account_count: self._fields.7.unwrap(), - takendown_record_count: self._fields.8.unwrap(), + ) -> ScheduledActionView { + ScheduledActionView { + action: self._fields.0.unwrap(), + created_at: self._fields.1.unwrap(), + created_by: self._fields.2.unwrap(), + did: self._fields.3.unwrap(), + event_data: self._fields.4, + execute_after: self._fields.5, + execute_at: self._fields.6, + execute_until: self._fields.7, + execution_event_id: self._fields.8, + id: self._fields.9.unwrap(), + last_executed_at: self._fields.10, + last_failure_reason: self._fields.11, + randomize_execution: self._fields.12, + status: self._fields.13.unwrap(), + updated_at: self._fields.14, extra_data: Some(extra_data), } } @@ -9169,9 +10999,9 @@ pub mod subject_status_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Id; type ReviewState; + type CreatedAt; type Subject; type UpdatedAt; } @@ -9179,29 +11009,19 @@ pub mod subject_status_view_state { pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Id = Unset; type ReviewState = Unset; + type CreatedAt = Unset; type Subject = Unset; type UpdatedAt = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Id = St::Id; - type ReviewState = St::ReviewState; - type Subject = St::Subject; - type UpdatedAt = St::UpdatedAt; - } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData St>); impl sealed::Sealed for SetId {} impl State for SetId { - type CreatedAt = St::CreatedAt; type Id = Set; type ReviewState = St::ReviewState; + type CreatedAt = St::CreatedAt; type Subject = St::Subject; type UpdatedAt = St::UpdatedAt; } @@ -9209,9 +11029,19 @@ pub mod subject_status_view_state { pub struct SetReviewState(PhantomData St>); impl sealed::Sealed for SetReviewState {} impl State for SetReviewState { - type CreatedAt = St::CreatedAt; type Id = St::Id; type ReviewState = Set; + type CreatedAt = St::CreatedAt; + type Subject = St::Subject; + type UpdatedAt = St::UpdatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Id = St::Id; + type ReviewState = St::ReviewState; + type CreatedAt = Set; type Subject = St::Subject; type UpdatedAt = St::UpdatedAt; } @@ -9219,9 +11049,9 @@ pub mod subject_status_view_state { pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = St::CreatedAt; type Id = St::Id; type ReviewState = St::ReviewState; + type CreatedAt = St::CreatedAt; type Subject = Set; type UpdatedAt = St::UpdatedAt; } @@ -9229,21 +11059,21 @@ pub mod subject_status_view_state { pub struct SetUpdatedAt(PhantomData St>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { - type CreatedAt = St::CreatedAt; type Id = St::Id; type ReviewState = St::ReviewState; + type CreatedAt = St::CreatedAt; type Subject = St::Subject; type UpdatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `id` field pub struct id(()); ///Marker type for the `review_state` field pub struct review_state(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); ///Marker type for the `updated_at` field @@ -9256,6 +11086,7 @@ pub struct SubjectStatusViewBuilder St>, _fields: ( Option>, + Option>, Option>, Option>, Option, @@ -9320,6 +11151,7 @@ impl SubjectStatusViewBuilder { None, None, None, + None, ), _type: PhantomData, } @@ -9345,13 +11177,32 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { + /// Set the `accountStrike` field (optional) + pub fn account_strike( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.1 = value.into(); + self + } + /// Set the `accountStrike` field to an Option value (optional) + pub fn maybe_account_strike( + mut self, + value: Option>, + ) -> Self { + self._fields.1 = value; + self + } +} + impl SubjectStatusViewBuilder { /// Set the `ageAssuranceState` field (optional) pub fn age_assurance_state( mut self, value: impl Into>>, ) -> Self { - self._fields.1 = value.into(); + self._fields.2 = value.into(); self } /// Set the `ageAssuranceState` field to an Option value (optional) @@ -9359,7 +11210,7 @@ impl SubjectStatusViewBuilder>, ) -> Self { - self._fields.1 = value; + self._fields.2 = value; self } } @@ -9370,7 +11221,7 @@ impl SubjectStatusViewBuilder>>, ) -> Self { - self._fields.2 = value.into(); + self._fields.3 = value.into(); self } /// Set the `ageAssuranceUpdatedBy` field to an Option value (optional) @@ -9378,7 +11229,7 @@ impl SubjectStatusViewBuilder>, ) -> Self { - self._fields.2 = value; + self._fields.3 = value; self } } @@ -9386,12 +11237,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `appealed` field (optional) pub fn appealed(mut self, value: impl Into>) -> Self { - self._fields.3 = value.into(); + self._fields.4 = value.into(); self } /// Set the `appealed` field to an Option value (optional) pub fn maybe_appealed(mut self, value: Option) -> Self { - self._fields.3 = value; + self._fields.4 = value; self } } @@ -9399,12 +11250,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `comment` field (optional) pub fn comment(mut self, value: impl Into>) -> Self { - self._fields.4 = value.into(); + self._fields.5 = value.into(); self } /// Set the `comment` field to an Option value (optional) pub fn maybe_comment(mut self, value: Option) -> Self { - self._fields.4 = value; + self._fields.5 = value; self } } @@ -9419,7 +11270,7 @@ where mut self, value: impl Into, ) -> SubjectStatusViewBuilder> { - self._fields.5 = Option::Some(value.into()); + self._fields.6 = Option::Some(value.into()); SubjectStatusViewBuilder { _state: PhantomData, _fields: self._fields, @@ -9434,12 +11285,12 @@ impl SubjectStatusViewBuilder>>, ) -> Self { - self._fields.6 = value.into(); + self._fields.7 = value.into(); self } /// Set the `hosting` field to an Option value (optional) pub fn maybe_hosting(mut self, value: Option>) -> Self { - self._fields.6 = value; + self._fields.7 = value; self } } @@ -9454,7 +11305,7 @@ where mut self, value: impl Into, ) -> SubjectStatusViewBuilder> { - self._fields.7 = Option::Some(value.into()); + self._fields.8 = Option::Some(value.into()); SubjectStatusViewBuilder { _state: PhantomData, _fields: self._fields, @@ -9466,12 +11317,12 @@ where impl SubjectStatusViewBuilder { /// Set the `lastAppealedAt` field (optional) pub fn last_appealed_at(mut self, value: impl Into>) -> Self { - self._fields.8 = value.into(); + self._fields.9 = value.into(); self } /// Set the `lastAppealedAt` field to an Option value (optional) pub fn maybe_last_appealed_at(mut self, value: Option) -> Self { - self._fields.8 = value; + self._fields.9 = value; self } } @@ -9479,12 +11330,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `lastReportedAt` field (optional) pub fn last_reported_at(mut self, value: impl Into>) -> Self { - self._fields.9 = value.into(); + self._fields.10 = value.into(); self } /// Set the `lastReportedAt` field to an Option value (optional) pub fn maybe_last_reported_at(mut self, value: Option) -> Self { - self._fields.9 = value; + self._fields.10 = value; self } } @@ -9492,12 +11343,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `lastReviewedAt` field (optional) pub fn last_reviewed_at(mut self, value: impl Into>) -> Self { - self._fields.10 = value.into(); + self._fields.11 = value.into(); self } /// Set the `lastReviewedAt` field to an Option value (optional) pub fn maybe_last_reviewed_at(mut self, value: Option) -> Self { - self._fields.10 = value; + self._fields.11 = value; self } } @@ -9505,12 +11356,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `lastReviewedBy` field (optional) pub fn last_reviewed_by(mut self, value: impl Into>>) -> Self { - self._fields.11 = value.into(); + self._fields.12 = value.into(); self } /// Set the `lastReviewedBy` field to an Option value (optional) pub fn maybe_last_reviewed_by(mut self, value: Option>) -> Self { - self._fields.11 = value; + self._fields.12 = value; self } } @@ -9518,12 +11369,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `muteReportingUntil` field (optional) pub fn mute_reporting_until(mut self, value: impl Into>) -> Self { - self._fields.12 = value.into(); + self._fields.13 = value.into(); self } /// Set the `muteReportingUntil` field to an Option value (optional) pub fn maybe_mute_reporting_until(mut self, value: Option) -> Self { - self._fields.12 = value; + self._fields.13 = value; self } } @@ -9531,12 +11382,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `muteUntil` field (optional) pub fn mute_until(mut self, value: impl Into>) -> Self { - self._fields.13 = value.into(); + self._fields.14 = value.into(); self } /// Set the `muteUntil` field to an Option value (optional) pub fn maybe_mute_until(mut self, value: Option) -> Self { - self._fields.13 = value; + self._fields.14 = value; self } } @@ -9544,12 +11395,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `priorityScore` field (optional) pub fn priority_score(mut self, value: impl Into>) -> Self { - self._fields.14 = value.into(); + self._fields.15 = value.into(); self } /// Set the `priorityScore` field to an Option value (optional) pub fn maybe_priority_score(mut self, value: Option) -> Self { - self._fields.14 = value; + self._fields.15 = value; self } } @@ -9560,7 +11411,7 @@ impl SubjectStatusViewBuilder>>, ) -> Self { - self._fields.15 = value.into(); + self._fields.16 = value.into(); self } /// Set the `recordsStats` field to an Option value (optional) @@ -9568,7 +11419,7 @@ impl SubjectStatusViewBuilder>, ) -> Self { - self._fields.15 = value; + self._fields.16 = value; self } } @@ -9583,7 +11434,7 @@ where mut self, value: impl Into>, ) -> SubjectStatusViewBuilder> { - self._fields.16 = Option::Some(value.into()); + self._fields.17 = Option::Some(value.into()); SubjectStatusViewBuilder { _state: PhantomData, _fields: self._fields, @@ -9602,7 +11453,7 @@ where mut self, value: impl Into>, ) -> SubjectStatusViewBuilder> { - self._fields.17 = Option::Some(value.into()); + self._fields.18 = Option::Some(value.into()); SubjectStatusViewBuilder { _state: PhantomData, _fields: self._fields, @@ -9614,12 +11465,12 @@ where impl SubjectStatusViewBuilder { /// Set the `subjectBlobCids` field (optional) pub fn subject_blob_cids(mut self, value: impl Into>>>) -> Self { - self._fields.18 = value.into(); + self._fields.19 = value.into(); self } /// Set the `subjectBlobCids` field to an Option value (optional) pub fn maybe_subject_blob_cids(mut self, value: Option>>) -> Self { - self._fields.18 = value; + self._fields.19 = value; self } } @@ -9627,12 +11478,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `subjectRepoHandle` field (optional) pub fn subject_repo_handle(mut self, value: impl Into>) -> Self { - self._fields.19 = value.into(); + self._fields.20 = value.into(); self } /// Set the `subjectRepoHandle` field to an Option value (optional) pub fn maybe_subject_repo_handle(mut self, value: Option) -> Self { - self._fields.19 = value; + self._fields.20 = value; self } } @@ -9640,12 +11491,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `suspendUntil` field (optional) pub fn suspend_until(mut self, value: impl Into>) -> Self { - self._fields.20 = value.into(); + self._fields.21 = value.into(); self } /// Set the `suspendUntil` field to an Option value (optional) pub fn maybe_suspend_until(mut self, value: Option) -> Self { - self._fields.20 = value; + self._fields.21 = value; self } } @@ -9653,12 +11504,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `tags` field (optional) pub fn tags(mut self, value: impl Into>>) -> Self { - self._fields.21 = value.into(); + self._fields.22 = value.into(); self } /// Set the `tags` field to an Option value (optional) pub fn maybe_tags(mut self, value: Option>) -> Self { - self._fields.21 = value; + self._fields.22 = value; self } } @@ -9666,12 +11517,12 @@ impl SubjectStatusViewBuilder SubjectStatusViewBuilder { /// Set the `takendown` field (optional) pub fn takendown(mut self, value: impl Into>) -> Self { - self._fields.22 = value.into(); + self._fields.23 = value.into(); self } /// Set the `takendown` field to an Option value (optional) pub fn maybe_takendown(mut self, value: Option) -> Self { - self._fields.22 = value; + self._fields.23 = value; self } } @@ -9686,7 +11537,7 @@ where mut self, value: impl Into, ) -> SubjectStatusViewBuilder> { - self._fields.23 = Option::Some(value.into()); + self._fields.24 = Option::Some(value.into()); SubjectStatusViewBuilder { _state: PhantomData, _fields: self._fields, @@ -9698,9 +11549,9 @@ where impl SubjectStatusViewBuilder where St: subject_status_view_state::State, - St::CreatedAt: subject_status_view_state::IsSet, St::Id: subject_status_view_state::IsSet, St::ReviewState: subject_status_view_state::IsSet, + St::CreatedAt: subject_status_view_state::IsSet, St::Subject: subject_status_view_state::IsSet, St::UpdatedAt: subject_status_view_state::IsSet, { @@ -9708,29 +11559,30 @@ where pub fn build(self) -> SubjectStatusView { SubjectStatusView { account_stats: self._fields.0, - age_assurance_state: self._fields.1, - age_assurance_updated_by: self._fields.2, - appealed: self._fields.3, - comment: self._fields.4, - created_at: self._fields.5.unwrap(), - hosting: self._fields.6, - id: self._fields.7.unwrap(), - last_appealed_at: self._fields.8, - last_reported_at: self._fields.9, - last_reviewed_at: self._fields.10, - last_reviewed_by: self._fields.11, - mute_reporting_until: self._fields.12, - mute_until: self._fields.13, - priority_score: self._fields.14, - records_stats: self._fields.15, - review_state: self._fields.16.unwrap(), - subject: self._fields.17.unwrap(), - subject_blob_cids: self._fields.18, - subject_repo_handle: self._fields.19, - suspend_until: self._fields.20, - tags: self._fields.21, - takendown: self._fields.22, - updated_at: self._fields.23.unwrap(), + account_strike: self._fields.1, + age_assurance_state: self._fields.2, + age_assurance_updated_by: self._fields.3, + appealed: self._fields.4, + comment: self._fields.5, + created_at: self._fields.6.unwrap(), + hosting: self._fields.7, + id: self._fields.8.unwrap(), + last_appealed_at: self._fields.9, + last_reported_at: self._fields.10, + last_reviewed_at: self._fields.11, + last_reviewed_by: self._fields.12, + mute_reporting_until: self._fields.13, + mute_until: self._fields.14, + priority_score: self._fields.15, + records_stats: self._fields.16, + review_state: self._fields.17.unwrap(), + subject: self._fields.18.unwrap(), + subject_blob_cids: self._fields.19, + subject_repo_handle: self._fields.20, + suspend_until: self._fields.21, + tags: self._fields.22, + takendown: self._fields.23, + updated_at: self._fields.24.unwrap(), extra_data: Default::default(), } } @@ -9741,29 +11593,30 @@ where ) -> SubjectStatusView { SubjectStatusView { account_stats: self._fields.0, - age_assurance_state: self._fields.1, - age_assurance_updated_by: self._fields.2, - appealed: self._fields.3, - comment: self._fields.4, - created_at: self._fields.5.unwrap(), - hosting: self._fields.6, - id: self._fields.7.unwrap(), - last_appealed_at: self._fields.8, - last_reported_at: self._fields.9, - last_reviewed_at: self._fields.10, - last_reviewed_by: self._fields.11, - mute_reporting_until: self._fields.12, - mute_until: self._fields.13, - priority_score: self._fields.14, - records_stats: self._fields.15, - review_state: self._fields.16.unwrap(), - subject: self._fields.17.unwrap(), - subject_blob_cids: self._fields.18, - subject_repo_handle: self._fields.19, - suspend_until: self._fields.20, - tags: self._fields.21, - takendown: self._fields.22, - updated_at: self._fields.23.unwrap(), + account_strike: self._fields.1, + age_assurance_state: self._fields.2, + age_assurance_updated_by: self._fields.3, + appealed: self._fields.4, + comment: self._fields.5, + created_at: self._fields.6.unwrap(), + hosting: self._fields.7, + id: self._fields.8.unwrap(), + last_appealed_at: self._fields.9, + last_reported_at: self._fields.10, + last_reviewed_at: self._fields.11, + last_reviewed_by: self._fields.12, + mute_reporting_until: self._fields.13, + mute_until: self._fields.14, + priority_score: self._fields.15, + records_stats: self._fields.16, + review_state: self._fields.17.unwrap(), + subject: self._fields.18.unwrap(), + subject_blob_cids: self._fields.19, + subject_repo_handle: self._fields.20, + suspend_until: self._fields.21, + tags: self._fields.22, + takendown: self._fields.23, + updated_at: self._fields.24.unwrap(), extra_data: Some(extra_data), } } @@ -9779,29 +11632,29 @@ pub mod subject_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type Type; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type Type = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData St>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type Type = St::Type; + type Subject = Unset; } ///State transition - sets the `type` field to Set pub struct SetType(PhantomData St>); impl sealed::Sealed for SetType {} impl State for SetType { - type Subject = St::Subject; type Type = Set; + type Subject = St::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData St>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Type = St::Type; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -9953,8 +11806,8 @@ where impl SubjectViewBuilder where St: subject_view_state::State, - St::Subject: subject_view_state::IsSet, St::Type: subject_view_state::IsSet, + St::Subject: subject_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> SubjectView { @@ -9995,51 +11848,51 @@ pub mod video_details_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Height; type Length; type Width; + type Height; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Height = Unset; type Length = Unset; type Width = Unset; - } - ///State transition - sets the `height` field to Set - pub struct SetHeight(PhantomData St>); - impl sealed::Sealed for SetHeight {} - impl State for SetHeight { - type Height = Set; - type Length = St::Length; - type Width = St::Width; + type Height = Unset; } ///State transition - sets the `length` field to Set pub struct SetLength(PhantomData St>); impl sealed::Sealed for SetLength {} impl State for SetLength { - type Height = St::Height; type Length = Set; type Width = St::Width; + type Height = St::Height; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData St>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type Height = St::Height; type Length = St::Length; type Width = Set; + type Height = St::Height; + } + ///State transition - sets the `height` field to Set + pub struct SetHeight(PhantomData St>); + impl sealed::Sealed for SetHeight {} + impl State for SetHeight { + type Length = St::Length; + type Width = St::Width; + type Height = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `height` field - pub struct height(()); ///Marker type for the `length` field pub struct length(()); ///Marker type for the `width` field pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); } } @@ -10128,9 +11981,9 @@ where impl VideoDetailsBuilder where St: video_details_state::State, - St::Height: video_details_state::IsSet, St::Length: video_details_state::IsSet, St::Width: video_details_state::IsSet, + St::Height: video_details_state::IsSet, { /// Build the final struct. pub fn build(self) -> VideoDetails { diff --git a/services/types/src/tools_ozone/moderation/emit_event.rs b/services/types/src/tools_ozone/moderation/emit_event.rs index 1362fd4..bc52df0 100644 --- a/services/types/src/tools_ozone/moderation/emit_event.rs +++ b/services/types/src/tools_ozone/moderation/emit_event.rs @@ -11,16 +11,26 @@ use alloc::collections::BTreeMap; #[allow(unused_imports)] use core::marker::PhantomData; use jacquard_common::{CowStr, BosStr, DefaultStr, FromStaticStr}; + +#[allow(unused_imports)] +use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation; use jacquard_common::deps::smol_str::SmolStr; use jacquard_common::types::string::{Did, Cid}; use jacquard_common::types::value::Data; use jacquard_derive::{IntoStatic, open_union}; +use jacquard_lexicon::lexicon::LexiconDoc; +use jacquard_lexicon::schema::LexiconSchema; + +#[allow(unused_imports)] +use jacquard_lexicon::validation::{ConstraintError, ValidationPath}; use serde::{Serialize, Deserialize}; use crate::com_atproto::admin::RepoRef; use crate::com_atproto::repo::strong_ref::StrongRef; use crate::tools_ozone::moderation::AccountEvent; use crate::tools_ozone::moderation::AgeAssuranceEvent; use crate::tools_ozone::moderation::AgeAssuranceOverrideEvent; +use crate::tools_ozone::moderation::AgeAssurancePurgeEvent; +use crate::tools_ozone::moderation::CancelScheduledTakedownEvent; use crate::tools_ozone::moderation::IdentityEvent; use crate::tools_ozone::moderation::ModEventAcknowledge; use crate::tools_ozone::moderation::ModEventComment; @@ -41,6 +51,9 @@ use crate::tools_ozone::moderation::ModEventUnmuteReporter; use crate::tools_ozone::moderation::ModEventView; use crate::tools_ozone::moderation::ModTool; use crate::tools_ozone::moderation::RecordEvent; +use crate::tools_ozone::moderation::RevokeAccountCredentialsEvent; +use crate::tools_ozone::moderation::ScheduleTakedownEvent; +use crate::tools_ozone::moderation::emit_event; #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)] #[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] @@ -52,6 +65,9 @@ pub struct EmitEvent { pub external_id: Option, #[serde(skip_serializing_if = "Option::is_none")] pub mod_tool: Option>, + ///Optional report-level targeting. If provided, this event will be linked to specific reports and reporters may be notified. + #[serde(skip_serializing_if = "Option::is_none")] + pub report_action: Option>, pub subject: EmitEventSubject, #[serde(skip_serializing_if = "Option::is_none")] pub subject_blob_cids: Option>>, @@ -106,6 +122,14 @@ pub enum EmitEventEvent { AgeAssuranceEvent(Box>), #[serde(rename = "tools.ozone.moderation.defs#ageAssuranceOverrideEvent")] AgeAssuranceOverrideEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#ageAssurancePurgeEvent")] + AgeAssurancePurgeEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#revokeAccountCredentialsEvent")] + RevokeAccountCredentialsEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#scheduleTakedownEvent")] + ScheduleTakedownEvent(Box>), + #[serde(rename = "tools.ozone.moderation.defs#cancelScheduledTakedownEvent")] + CancelScheduledTakedownEvent(Box>), } @@ -181,6 +205,27 @@ impl core::fmt::Display for EmitEventError { } } +/// Target specific reports when emitting a moderation event + +#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)] +#[serde(rename_all = "camelCase", bound(deserialize = "S: Deserialize<'de> + BosStr"))] +pub struct ReportAction { + ///Target ALL reports on the subject + #[serde(skip_serializing_if = "Option::is_none")] + pub all: Option, + ///Target specific report IDs + #[serde(skip_serializing_if = "Option::is_none")] + pub ids: Option>, + ///Note to send to reporter(s) when actioning their report + #[serde(skip_serializing_if = "Option::is_none")] + pub note: Option, + ///Target reports matching these report types on the subject (fully qualified NSIDs) + #[serde(skip_serializing_if = "Option::is_none")] + pub types: Option>, + #[serde(flatten, default, skip_serializing_if = "Option::is_none")] + pub extra_data: Option>>, +} + /// Response type for tools.ozone.moderation.emitEvent pub struct EmitEventResponse; impl jacquard_common::xrpc::XrpcResp for EmitEventResponse { @@ -209,6 +254,21 @@ impl jacquard_common::xrpc::XrpcEndpoint for EmitEventRequest { type Response = EmitEventResponse; } +impl LexiconSchema for ReportAction { + fn nsid() -> &'static str { + "tools.ozone.moderation.emitEvent" + } + fn def_name() -> &'static str { + "reportAction" + } + fn lexicon_doc() -> LexiconDoc<'static> { + lexicon_doc_tools_ozone_moderation_emitEvent() + } + fn validate(&self) -> Result<(), ConstraintError> { + Ok(()) + } +} + pub mod emit_event_state { pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; @@ -219,51 +279,51 @@ pub mod emit_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Subject; type CreatedBy; type Event; - type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Subject = Unset; type CreatedBy = Unset; type Event = Unset; - type Subject = Unset; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData St>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Subject = Set; + type CreatedBy = St::CreatedBy; + type Event = St::Event; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData St>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { + type Subject = St::Subject; type CreatedBy = Set; type Event = St::Event; - type Subject = St::Subject; } ///State transition - sets the `event` field to Set pub struct SetEvent(PhantomData St>); impl sealed::Sealed for SetEvent {} impl State for SetEvent { - type CreatedBy = St::CreatedBy; - type Event = Set; type Subject = St::Subject; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData St>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { type CreatedBy = St::CreatedBy; - type Event = St::Event; - type Subject = Set; + type Event = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `subject` field + pub struct subject(()); ///Marker type for the `created_by` field pub struct created_by(()); ///Marker type for the `event` field pub struct event(()); - ///Marker type for the `subject` field - pub struct subject(()); } } @@ -275,6 +335,7 @@ pub struct EmitEventBuilder { Option>, Option, Option>, + Option>, Option>, Option>>, ), @@ -293,7 +354,7 @@ impl EmitEventBuilder { pub fn new() -> Self { EmitEventBuilder { _state: PhantomData, - _fields: (None, None, None, None, None, None), + _fields: (None, None, None, None, None, None, None), _type: PhantomData, } } @@ -363,6 +424,25 @@ impl EmitEventBuilder { } } +impl EmitEventBuilder { + /// Set the `reportAction` field (optional) + pub fn report_action( + mut self, + value: impl Into>>, + ) -> Self { + self._fields.4 = value.into(); + self + } + /// Set the `reportAction` field to an Option value (optional) + pub fn maybe_report_action( + mut self, + value: Option>, + ) -> Self { + self._fields.4 = value; + self + } +} + impl EmitEventBuilder where St: emit_event_state::State, @@ -373,7 +453,7 @@ where mut self, value: impl Into>, ) -> EmitEventBuilder> { - self._fields.4 = Option::Some(value.into()); + self._fields.5 = Option::Some(value.into()); EmitEventBuilder { _state: PhantomData, _fields: self._fields, @@ -385,12 +465,12 @@ where impl EmitEventBuilder { /// Set the `subjectBlobCids` field (optional) pub fn subject_blob_cids(mut self, value: impl Into>>>) -> Self { - self._fields.5 = value.into(); + self._fields.6 = value.into(); self } /// Set the `subjectBlobCids` field to an Option value (optional) pub fn maybe_subject_blob_cids(mut self, value: Option>>) -> Self { - self._fields.5 = value; + self._fields.6 = value; self } } @@ -398,9 +478,9 @@ impl EmitEventBuilder { impl EmitEventBuilder where St: emit_event_state::State, + St::Subject: emit_event_state::IsSet, St::CreatedBy: emit_event_state::IsSet, St::Event: emit_event_state::IsSet, - St::Subject: emit_event_state::IsSet, { /// Build the final struct. pub fn build(self) -> EmitEvent { @@ -409,8 +489,9 @@ where event: self._fields.1.unwrap(), external_id: self._fields.2, mod_tool: self._fields.3, - subject: self._fields.4.unwrap(), - subject_blob_cids: self._fields.5, + report_action: self._fields.4, + subject: self._fields.5.unwrap(), + subject_blob_cids: self._fields.6, extra_data: Default::default(), } } @@ -424,9 +505,199 @@ where event: self._fields.1.unwrap(), external_id: self._fields.2, mod_tool: self._fields.3, - subject: self._fields.4.unwrap(), - subject_blob_cids: self._fields.5, + report_action: self._fields.4, + subject: self._fields.5.unwrap(), + subject_blob_cids: self._fields.6, extra_data: Some(extra_data), } } +} + +fn lexicon_doc_tools_ozone_moderation_emitEvent() -> LexiconDoc<'static> { + #[allow(unused_imports)] + use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType}; + use jacquard_lexicon::lexicon::*; + use alloc::collections::BTreeMap; + LexiconDoc { + lexicon: Lexicon::Lexicon1, + id: CowStr::new_static("tools.ozone.moderation.emitEvent"), + defs: { + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("main"), + LexUserType::XrpcProcedure(LexXrpcProcedure { + input: Some(LexXrpcBody { + encoding: CowStr::new_static("application/json"), + schema: Some( + LexXrpcBodySchema::Object(LexObject { + required: Some( + vec![ + SmolStr::new_static("event"), + SmolStr::new_static("subject"), + SmolStr::new_static("createdBy") + ], + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("createdBy"), + LexObjectProperty::String(LexString { + format: Some(LexStringFormat::Did), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("event"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("tools.ozone.moderation.defs#modEventTakedown"), + CowStr::new_static("tools.ozone.moderation.defs#modEventAcknowledge"), + CowStr::new_static("tools.ozone.moderation.defs#modEventEscalate"), + CowStr::new_static("tools.ozone.moderation.defs#modEventComment"), + CowStr::new_static("tools.ozone.moderation.defs#modEventLabel"), + CowStr::new_static("tools.ozone.moderation.defs#modEventReport"), + CowStr::new_static("tools.ozone.moderation.defs#modEventMute"), + CowStr::new_static("tools.ozone.moderation.defs#modEventUnmute"), + CowStr::new_static("tools.ozone.moderation.defs#modEventMuteReporter"), + CowStr::new_static("tools.ozone.moderation.defs#modEventUnmuteReporter"), + CowStr::new_static("tools.ozone.moderation.defs#modEventReverseTakedown"), + CowStr::new_static("tools.ozone.moderation.defs#modEventResolveAppeal"), + CowStr::new_static("tools.ozone.moderation.defs#modEventEmail"), + CowStr::new_static("tools.ozone.moderation.defs#modEventDivert"), + CowStr::new_static("tools.ozone.moderation.defs#modEventTag"), + CowStr::new_static("tools.ozone.moderation.defs#accountEvent"), + CowStr::new_static("tools.ozone.moderation.defs#identityEvent"), + CowStr::new_static("tools.ozone.moderation.defs#recordEvent"), + CowStr::new_static("tools.ozone.moderation.defs#modEventPriorityScore"), + CowStr::new_static("tools.ozone.moderation.defs#ageAssuranceEvent"), + CowStr::new_static("tools.ozone.moderation.defs#ageAssuranceOverrideEvent"), + CowStr::new_static("tools.ozone.moderation.defs#ageAssurancePurgeEvent"), + CowStr::new_static("tools.ozone.moderation.defs#revokeAccountCredentialsEvent"), + CowStr::new_static("tools.ozone.moderation.defs#scheduleTakedownEvent"), + CowStr::new_static("tools.ozone.moderation.defs#cancelScheduledTakedownEvent") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("externalId"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "An optional external ID for the event, used to deduplicate events from external systems. Fails when an event of same type with the same external ID exists for the same subject.", + ), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("modTool"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static( + "tools.ozone.moderation.defs#modTool", + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("reportAction"), + LexObjectProperty::Ref(LexRef { + r#ref: CowStr::new_static("#reportAction"), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("subject"), + LexObjectProperty::Union(LexRefUnion { + refs: vec![ + CowStr::new_static("com.atproto.admin.defs#repoRef"), + CowStr::new_static("com.atproto.repo.strongRef") + ], + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("subjectBlobCids"), + LexObjectProperty::Array(LexArray { + items: LexArrayItem::String(LexString { + format: Some(LexStringFormat::Cid), + ..Default::default() + }), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ), + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("reportAction"), + LexUserType::Object(LexObject { + description: Some( + CowStr::new_static( + "Target specific reports when emitting a moderation event", + ), + ), + properties: { + #[allow(unused_mut)] + let mut map = BTreeMap::new(); + map.insert( + SmolStr::new_static("all"), + LexObjectProperty::Boolean(LexBoolean { + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("ids"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static("Target specific report IDs"), + ), + items: LexArrayItem::Integer(LexInteger { + ..Default::default() + }), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("note"), + LexObjectProperty::String(LexString { + description: Some( + CowStr::new_static( + "Note to send to reporter(s) when actioning their report", + ), + ), + ..Default::default() + }), + ); + map.insert( + SmolStr::new_static("types"), + LexObjectProperty::Array(LexArray { + description: Some( + CowStr::new_static( + "Target reports matching these report types on the subject (fully qualified NSIDs)", + ), + ), + items: LexArrayItem::String(LexString { + ..Default::default() + }), + ..Default::default() + }), + ); + map + }, + ..Default::default() + }), + ); + map + }, + ..Default::default() + } } \ No newline at end of file diff --git a/services/types/src/tools_ozone/moderation/query_events.rs b/services/types/src/tools_ozone/moderation/query_events.rs index da78026..21c4c65 100644 --- a/services/types/src/tools_ozone/moderation/query_events.rs +++ b/services/types/src/tools_ozone/moderation/query_events.rs @@ -28,6 +28,8 @@ pub struct QueryEvents { #[serde(skip_serializing_if = "Option::is_none")] pub age_assurance_state: Option, #[serde(skip_serializing_if = "Option::is_none")] + pub batch_id: Option, + #[serde(skip_serializing_if = "Option::is_none")] pub collections: Option>>, #[serde(skip_serializing_if = "Option::is_none")] pub comment: Option, @@ -69,6 +71,8 @@ pub struct QueryEvents { pub subject_type: Option, #[serde(skip_serializing_if = "Option::is_none")] pub types: Option>, + #[serde(skip_serializing_if = "Option::is_none")] + pub with_strike: Option, } @@ -144,6 +148,7 @@ pub struct QueryEventsBuilder { Option>, Option>, Option, + Option, Option>>, Option, Option, @@ -162,6 +167,7 @@ pub struct QueryEventsBuilder { Option>, Option, Option>, + Option, ), _type: PhantomData S>, } @@ -200,6 +206,8 @@ impl QueryEventsBuilder { None, None, None, + None, + None, ), _type: PhantomData, } @@ -245,15 +253,28 @@ impl QueryEventsBuilder { } } +impl QueryEventsBuilder { + /// Set the `batchId` field (optional) + pub fn batch_id(mut self, value: impl Into>) -> Self { + self._fields.3 = value.into(); + self + } + /// Set the `batchId` field to an Option value (optional) + pub fn maybe_batch_id(mut self, value: Option) -> Self { + self._fields.3 = value; + self + } +} + impl QueryEventsBuilder { /// Set the `collections` field (optional) pub fn collections(mut self, value: impl Into>>>) -> Self { - self._fields.3 = value.into(); + self._fields.4 = value.into(); self } /// Set the `collections` field to an Option value (optional) pub fn maybe_collections(mut self, value: Option>>) -> Self { - self._fields.3 = value; + self._fields.4 = value; self } } @@ -261,12 +282,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `comment` field (optional) pub fn comment(mut self, value: impl Into>) -> Self { - self._fields.4 = value.into(); + self._fields.5 = value.into(); self } /// Set the `comment` field to an Option value (optional) pub fn maybe_comment(mut self, value: Option) -> Self { - self._fields.4 = value; + self._fields.5 = value; self } } @@ -274,12 +295,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `createdAfter` field (optional) pub fn created_after(mut self, value: impl Into>) -> Self { - self._fields.5 = value.into(); + self._fields.6 = value.into(); self } /// Set the `createdAfter` field to an Option value (optional) pub fn maybe_created_after(mut self, value: Option) -> Self { - self._fields.5 = value; + self._fields.6 = value; self } } @@ -287,12 +308,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `createdBefore` field (optional) pub fn created_before(mut self, value: impl Into>) -> Self { - self._fields.6 = value.into(); + self._fields.7 = value.into(); self } /// Set the `createdBefore` field to an Option value (optional) pub fn maybe_created_before(mut self, value: Option) -> Self { - self._fields.6 = value; + self._fields.7 = value; self } } @@ -300,12 +321,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `createdBy` field (optional) pub fn created_by(mut self, value: impl Into>>) -> Self { - self._fields.7 = value.into(); + self._fields.8 = value.into(); self } /// Set the `createdBy` field to an Option value (optional) pub fn maybe_created_by(mut self, value: Option>) -> Self { - self._fields.7 = value; + self._fields.8 = value; self } } @@ -313,12 +334,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `cursor` field (optional) pub fn cursor(mut self, value: impl Into>) -> Self { - self._fields.8 = value.into(); + self._fields.9 = value.into(); self } /// Set the `cursor` field to an Option value (optional) pub fn maybe_cursor(mut self, value: Option) -> Self { - self._fields.8 = value; + self._fields.9 = value; self } } @@ -326,12 +347,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `hasComment` field (optional) pub fn has_comment(mut self, value: impl Into>) -> Self { - self._fields.9 = value.into(); + self._fields.10 = value.into(); self } /// Set the `hasComment` field to an Option value (optional) pub fn maybe_has_comment(mut self, value: Option) -> Self { - self._fields.9 = value; + self._fields.10 = value; self } } @@ -339,12 +360,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `includeAllUserRecords` field (optional) pub fn include_all_user_records(mut self, value: impl Into>) -> Self { - self._fields.10 = value.into(); + self._fields.11 = value.into(); self } /// Set the `includeAllUserRecords` field to an Option value (optional) pub fn maybe_include_all_user_records(mut self, value: Option) -> Self { - self._fields.10 = value; + self._fields.11 = value; self } } @@ -352,12 +373,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `limit` field (optional) pub fn limit(mut self, value: impl Into>) -> Self { - self._fields.11 = value.into(); + self._fields.12 = value.into(); self } /// Set the `limit` field to an Option value (optional) pub fn maybe_limit(mut self, value: Option) -> Self { - self._fields.11 = value; + self._fields.12 = value; self } } @@ -365,12 +386,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `modTool` field (optional) pub fn mod_tool(mut self, value: impl Into>>) -> Self { - self._fields.12 = value.into(); + self._fields.13 = value.into(); self } /// Set the `modTool` field to an Option value (optional) pub fn maybe_mod_tool(mut self, value: Option>) -> Self { - self._fields.12 = value; + self._fields.13 = value; self } } @@ -378,12 +399,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `policies` field (optional) pub fn policies(mut self, value: impl Into>>) -> Self { - self._fields.13 = value.into(); + self._fields.14 = value.into(); self } /// Set the `policies` field to an Option value (optional) pub fn maybe_policies(mut self, value: Option>) -> Self { - self._fields.13 = value; + self._fields.14 = value; self } } @@ -391,12 +412,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `removedLabels` field (optional) pub fn removed_labels(mut self, value: impl Into>>) -> Self { - self._fields.14 = value.into(); + self._fields.15 = value.into(); self } /// Set the `removedLabels` field to an Option value (optional) pub fn maybe_removed_labels(mut self, value: Option>) -> Self { - self._fields.14 = value; + self._fields.15 = value; self } } @@ -404,12 +425,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `removedTags` field (optional) pub fn removed_tags(mut self, value: impl Into>>) -> Self { - self._fields.15 = value.into(); + self._fields.16 = value.into(); self } /// Set the `removedTags` field to an Option value (optional) pub fn maybe_removed_tags(mut self, value: Option>) -> Self { - self._fields.15 = value; + self._fields.16 = value; self } } @@ -417,12 +438,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `reportTypes` field (optional) pub fn report_types(mut self, value: impl Into>>) -> Self { - self._fields.16 = value.into(); + self._fields.17 = value.into(); self } /// Set the `reportTypes` field to an Option value (optional) pub fn maybe_report_types(mut self, value: Option>) -> Self { - self._fields.16 = value; + self._fields.17 = value; self } } @@ -430,12 +451,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `sortDirection` field (optional) pub fn sort_direction(mut self, value: impl Into>) -> Self { - self._fields.17 = value.into(); + self._fields.18 = value.into(); self } /// Set the `sortDirection` field to an Option value (optional) pub fn maybe_sort_direction(mut self, value: Option) -> Self { - self._fields.17 = value; + self._fields.18 = value; self } } @@ -443,12 +464,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `subject` field (optional) pub fn subject(mut self, value: impl Into>>) -> Self { - self._fields.18 = value.into(); + self._fields.19 = value.into(); self } /// Set the `subject` field to an Option value (optional) pub fn maybe_subject(mut self, value: Option>) -> Self { - self._fields.18 = value; + self._fields.19 = value; self } } @@ -456,12 +477,12 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `subjectType` field (optional) pub fn subject_type(mut self, value: impl Into>) -> Self { - self._fields.19 = value.into(); + self._fields.20 = value.into(); self } /// Set the `subjectType` field to an Option value (optional) pub fn maybe_subject_type(mut self, value: Option) -> Self { - self._fields.19 = value; + self._fields.20 = value; self } } @@ -469,12 +490,25 @@ impl QueryEventsBuilder { impl QueryEventsBuilder { /// Set the `types` field (optional) pub fn types(mut self, value: impl Into>>) -> Self { - self._fields.20 = value.into(); + self._fields.21 = value.into(); self } /// Set the `types` field to an Option value (optional) pub fn maybe_types(mut self, value: Option>) -> Self { - self._fields.20 = value; + self._fields.21 = value; + self + } +} + +impl QueryEventsBuilder { + /// Set the `withStrike` field (optional) + pub fn with_strike(mut self, value: impl Into>) -> Self { + self._fields.22 = value.into(); + self + } + /// Set the `withStrike` field to an Option value (optional) + pub fn maybe_with_strike(mut self, value: Option) -> Self { + self._fields.22 = value; self } } @@ -489,24 +523,26 @@ where added_labels: self._fields.0, added_tags: self._fields.1, age_assurance_state: self._fields.2, - collections: self._fields.3, - comment: self._fields.4, - created_after: self._fields.5, - created_before: self._fields.6, - created_by: self._fields.7, - cursor: self._fields.8, - has_comment: self._fields.9, - include_all_user_records: self._fields.10, - limit: self._fields.11, - mod_tool: self._fields.12, - policies: self._fields.13, - removed_labels: self._fields.14, - removed_tags: self._fields.15, - report_types: self._fields.16, - sort_direction: self._fields.17, - subject: self._fields.18, - subject_type: self._fields.19, - types: self._fields.20, + batch_id: self._fields.3, + collections: self._fields.4, + comment: self._fields.5, + created_after: self._fields.6, + created_before: self._fields.7, + created_by: self._fields.8, + cursor: self._fields.9, + has_comment: self._fields.10, + include_all_user_records: self._fields.11, + limit: self._fields.12, + mod_tool: self._fields.13, + policies: self._fields.14, + removed_labels: self._fields.15, + removed_tags: self._fields.16, + report_types: self._fields.17, + sort_direction: self._fields.18, + subject: self._fields.19, + subject_type: self._fields.20, + types: self._fields.21, + with_strike: self._fields.22, } } } \ No newline at end of file diff --git a/services/types/src/tools_ozone/moderation/query_statuses.rs b/services/types/src/tools_ozone/moderation/query_statuses.rs index d360ef8..3d956ac 100644 --- a/services/types/src/tools_ozone/moderation/query_statuses.rs +++ b/services/types/src/tools_ozone/moderation/query_statuses.rs @@ -62,6 +62,9 @@ pub struct QueryStatuses { pub min_priority_score: Option, #[serde(skip_serializing_if = "Option::is_none")] pub min_reported_records_count: Option, + ///(min: 1) + #[serde(skip_serializing_if = "Option::is_none")] + pub min_strike_count: Option, #[serde(skip_serializing_if = "Option::is_none")] pub min_takendown_records_count: Option, #[serde(skip_serializing_if = "Option::is_none")] @@ -190,6 +193,7 @@ pub struct QueryStatusesBuilder { Option, Option, Option, + Option, Option, Option, Option, @@ -257,6 +261,7 @@ impl QueryStatusesBuilder { None, None, None, + None, ), _type: PhantomData, } @@ -513,15 +518,28 @@ impl QueryStatusesBuilder { } } +impl QueryStatusesBuilder { + /// Set the `minStrikeCount` field (optional) + pub fn min_strike_count(mut self, value: impl Into>) -> Self { + self._fields.19 = value.into(); + self + } + /// Set the `minStrikeCount` field to an Option value (optional) + pub fn maybe_min_strike_count(mut self, value: Option) -> Self { + self._fields.19 = value; + self + } +} + impl QueryStatusesBuilder { /// Set the `minTakendownRecordsCount` field (optional) pub fn min_takendown_records_count(mut self, value: impl Into>) -> Self { - self._fields.19 = value.into(); + self._fields.20 = value.into(); self } /// Set the `minTakendownRecordsCount` field to an Option value (optional) pub fn maybe_min_takendown_records_count(mut self, value: Option) -> Self { - self._fields.19 = value; + self._fields.20 = value; self } } @@ -529,12 +547,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `onlyMuted` field (optional) pub fn only_muted(mut self, value: impl Into>) -> Self { - self._fields.20 = value.into(); + self._fields.21 = value.into(); self } /// Set the `onlyMuted` field to an Option value (optional) pub fn maybe_only_muted(mut self, value: Option) -> Self { - self._fields.20 = value; + self._fields.21 = value; self } } @@ -542,12 +560,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `queueCount` field (optional) pub fn queue_count(mut self, value: impl Into>) -> Self { - self._fields.21 = value.into(); + self._fields.22 = value.into(); self } /// Set the `queueCount` field to an Option value (optional) pub fn maybe_queue_count(mut self, value: Option) -> Self { - self._fields.21 = value; + self._fields.22 = value; self } } @@ -555,12 +573,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `queueIndex` field (optional) pub fn queue_index(mut self, value: impl Into>) -> Self { - self._fields.22 = value.into(); + self._fields.23 = value.into(); self } /// Set the `queueIndex` field to an Option value (optional) pub fn maybe_queue_index(mut self, value: Option) -> Self { - self._fields.22 = value; + self._fields.23 = value; self } } @@ -568,12 +586,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `queueSeed` field (optional) pub fn queue_seed(mut self, value: impl Into>) -> Self { - self._fields.23 = value.into(); + self._fields.24 = value.into(); self } /// Set the `queueSeed` field to an Option value (optional) pub fn maybe_queue_seed(mut self, value: Option) -> Self { - self._fields.23 = value; + self._fields.24 = value; self } } @@ -581,12 +599,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `reportedAfter` field (optional) pub fn reported_after(mut self, value: impl Into>) -> Self { - self._fields.24 = value.into(); + self._fields.25 = value.into(); self } /// Set the `reportedAfter` field to an Option value (optional) pub fn maybe_reported_after(mut self, value: Option) -> Self { - self._fields.24 = value; + self._fields.25 = value; self } } @@ -594,12 +612,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `reportedBefore` field (optional) pub fn reported_before(mut self, value: impl Into>) -> Self { - self._fields.25 = value.into(); + self._fields.26 = value.into(); self } /// Set the `reportedBefore` field to an Option value (optional) pub fn maybe_reported_before(mut self, value: Option) -> Self { - self._fields.25 = value; + self._fields.26 = value; self } } @@ -607,12 +625,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `reviewState` field (optional) pub fn review_state(mut self, value: impl Into>) -> Self { - self._fields.26 = value.into(); + self._fields.27 = value.into(); self } /// Set the `reviewState` field to an Option value (optional) pub fn maybe_review_state(mut self, value: Option) -> Self { - self._fields.26 = value; + self._fields.27 = value; self } } @@ -620,12 +638,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `reviewedAfter` field (optional) pub fn reviewed_after(mut self, value: impl Into>) -> Self { - self._fields.27 = value.into(); + self._fields.28 = value.into(); self } /// Set the `reviewedAfter` field to an Option value (optional) pub fn maybe_reviewed_after(mut self, value: Option) -> Self { - self._fields.27 = value; + self._fields.28 = value; self } } @@ -633,12 +651,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `reviewedBefore` field (optional) pub fn reviewed_before(mut self, value: impl Into>) -> Self { - self._fields.28 = value.into(); + self._fields.29 = value.into(); self } /// Set the `reviewedBefore` field to an Option value (optional) pub fn maybe_reviewed_before(mut self, value: Option) -> Self { - self._fields.28 = value; + self._fields.29 = value; self } } @@ -646,12 +664,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `sortDirection` field (optional) pub fn sort_direction(mut self, value: impl Into>) -> Self { - self._fields.29 = value.into(); + self._fields.30 = value.into(); self } /// Set the `sortDirection` field to an Option value (optional) pub fn maybe_sort_direction(mut self, value: Option) -> Self { - self._fields.29 = value; + self._fields.30 = value; self } } @@ -659,12 +677,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `sortField` field (optional) pub fn sort_field(mut self, value: impl Into>) -> Self { - self._fields.30 = value.into(); + self._fields.31 = value.into(); self } /// Set the `sortField` field to an Option value (optional) pub fn maybe_sort_field(mut self, value: Option) -> Self { - self._fields.30 = value; + self._fields.31 = value; self } } @@ -672,12 +690,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `subject` field (optional) pub fn subject(mut self, value: impl Into>>) -> Self { - self._fields.31 = value.into(); + self._fields.32 = value.into(); self } /// Set the `subject` field to an Option value (optional) pub fn maybe_subject(mut self, value: Option>) -> Self { - self._fields.31 = value; + self._fields.32 = value; self } } @@ -685,12 +703,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `subjectType` field (optional) pub fn subject_type(mut self, value: impl Into>) -> Self { - self._fields.32 = value.into(); + self._fields.33 = value.into(); self } /// Set the `subjectType` field to an Option value (optional) pub fn maybe_subject_type(mut self, value: Option) -> Self { - self._fields.32 = value; + self._fields.33 = value; self } } @@ -698,12 +716,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `tags` field (optional) pub fn tags(mut self, value: impl Into>>) -> Self { - self._fields.33 = value.into(); + self._fields.34 = value.into(); self } /// Set the `tags` field to an Option value (optional) pub fn maybe_tags(mut self, value: Option>) -> Self { - self._fields.33 = value; + self._fields.34 = value; self } } @@ -711,12 +729,12 @@ impl QueryStatusesBuilder { impl QueryStatusesBuilder { /// Set the `takendown` field (optional) pub fn takendown(mut self, value: impl Into>) -> Self { - self._fields.34 = value.into(); + self._fields.35 = value.into(); self } /// Set the `takendown` field to an Option value (optional) pub fn maybe_takendown(mut self, value: Option) -> Self { - self._fields.34 = value; + self._fields.35 = value; self } } @@ -747,22 +765,23 @@ where min_account_suspend_count: self._fields.16, min_priority_score: self._fields.17, min_reported_records_count: self._fields.18, - min_takendown_records_count: self._fields.19, - only_muted: self._fields.20, - queue_count: self._fields.21, - queue_index: self._fields.22, - queue_seed: self._fields.23, - reported_after: self._fields.24, - reported_before: self._fields.25, - review_state: self._fields.26, - reviewed_after: self._fields.27, - reviewed_before: self._fields.28, - sort_direction: self._fields.29, - sort_field: self._fields.30, - subject: self._fields.31, - subject_type: self._fields.32, - tags: self._fields.33, - takendown: self._fields.34, + min_strike_count: self._fields.19, + min_takendown_records_count: self._fields.20, + only_muted: self._fields.21, + queue_count: self._fields.22, + queue_index: self._fields.23, + queue_seed: self._fields.24, + reported_after: self._fields.25, + reported_before: self._fields.26, + review_state: self._fields.27, + reviewed_after: self._fields.28, + reviewed_before: self._fields.29, + sort_direction: self._fields.30, + sort_field: self._fields.31, + subject: self._fields.32, + subject_type: self._fields.33, + tags: self._fields.34, + takendown: self._fields.35, } } } \ No newline at end of file diff --git a/services/types/src/tools_ozone/safelink.rs b/services/types/src/tools_ozone/safelink.rs index 1d492a1..cfd84d2 100644 --- a/services/types/src/tools_ozone/safelink.rs +++ b/services/types/src/tools_ozone/safelink.rs @@ -422,151 +422,151 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Action; - type CreatedAt; - type CreatedBy; + type Url; type EventType; type Id; - type Pattern; + type Action; type Reason; - type Url; + type Pattern; + type CreatedAt; + type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Action = Unset; - type CreatedAt = Unset; - type CreatedBy = Unset; + type Url = Unset; type EventType = Unset; type Id = Unset; - type Pattern = Unset; + type Action = Unset; type Reason = Unset; - type Url = Unset; + type Pattern = Unset; + type CreatedAt = Unset; + type CreatedBy = Unset; } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData St>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type Action = Set; - type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData St>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type Url = Set; type EventType = St::EventType; type Id = St::Id; - type Pattern = St::Pattern; - type Reason = St::Reason; - type Url = St::Url; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { type Action = St::Action; - type CreatedAt = Set; - type CreatedBy = St::CreatedBy; - type EventType = St::EventType; - type Id = St::Id; - type Pattern = St::Pattern; type Reason = St::Reason; - type Url = St::Url; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData St>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type Action = St::Action; - type CreatedAt = St::CreatedAt; - type CreatedBy = Set; - type EventType = St::EventType; - type Id = St::Id; type Pattern = St::Pattern; - type Reason = St::Reason; - type Url = St::Url; + type CreatedAt = St::CreatedAt; + type CreatedBy = St::CreatedBy; } ///State transition - sets the `event_type` field to Set pub struct SetEventType(PhantomData St>); impl sealed::Sealed for SetEventType {} impl State for SetEventType { - type Action = St::Action; - type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; + type Url = St::Url; type EventType = Set; type Id = St::Id; - type Pattern = St::Pattern; + type Action = St::Action; type Reason = St::Reason; - type Url = St::Url; + type Pattern = St::Pattern; + type CreatedAt = St::CreatedAt; + type CreatedBy = St::CreatedBy; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData St>); impl sealed::Sealed for SetId {} impl State for SetId { - type Action = St::Action; - type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; + type Url = St::Url; type EventType = St::EventType; type Id = Set; - type Pattern = St::Pattern; - type Reason = St::Reason; - type Url = St::Url; - } - ///State transition - sets the `pattern` field to Set - pub struct SetPattern(PhantomData St>); - impl sealed::Sealed for SetPattern {} - impl State for SetPattern { type Action = St::Action; + type Reason = St::Reason; + type Pattern = St::Pattern; type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData St>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { + type Url = St::Url; type EventType = St::EventType; type Id = St::Id; - type Pattern = Set; + type Action = Set; type Reason = St::Reason; - type Url = St::Url; + type Pattern = St::Pattern; + type CreatedAt = St::CreatedAt; + type CreatedBy = St::CreatedBy; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData St>); impl sealed::Sealed for SetReason {} impl State for SetReason { + type Url = St::Url; + type EventType = St::EventType; + type Id = St::Id; type Action = St::Action; + type Reason = Set; + type Pattern = St::Pattern; type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; + } + ///State transition - sets the `pattern` field to Set + pub struct SetPattern(PhantomData St>); + impl sealed::Sealed for SetPattern {} + impl State for SetPattern { + type Url = St::Url; type EventType = St::EventType; type Id = St::Id; - type Pattern = St::Pattern; - type Reason = Set; - type Url = St::Url; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData St>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { type Action = St::Action; + type Reason = St::Reason; + type Pattern = Set; type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Url = St::Url; type EventType = St::EventType; type Id = St::Id; + type Action = St::Action; + type Reason = St::Reason; type Pattern = St::Pattern; + type CreatedAt = Set; + type CreatedBy = St::CreatedBy; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData St>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type Url = St::Url; + type EventType = St::EventType; + type Id = St::Id; + type Action = St::Action; type Reason = St::Reason; - type Url = Set; + type Pattern = St::Pattern; + type CreatedAt = St::CreatedAt; + type CreatedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `action` field - pub struct action(()); - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `created_by` field - pub struct created_by(()); + ///Marker type for the `url` field + pub struct url(()); ///Marker type for the `event_type` field pub struct event_type(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `pattern` field - pub struct pattern(()); + ///Marker type for the `action` field + pub struct action(()); ///Marker type for the `reason` field pub struct reason(()); - ///Marker type for the `url` field - pub struct url(()); + ///Marker type for the `pattern` field + pub struct pattern(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `created_by` field + pub struct created_by(()); } } @@ -773,14 +773,14 @@ where impl EventBuilder where St: event_state::State, - St::Action: event_state::IsSet, - St::CreatedAt: event_state::IsSet, - St::CreatedBy: event_state::IsSet, + St::Url: event_state::IsSet, St::EventType: event_state::IsSet, St::Id: event_state::IsSet, - St::Pattern: event_state::IsSet, + St::Action: event_state::IsSet, St::Reason: event_state::IsSet, - St::Url: event_state::IsSet, + St::Pattern: event_state::IsSet, + St::CreatedAt: event_state::IsSet, + St::CreatedBy: event_state::IsSet, { /// Build the final struct. pub fn build(self) -> Event { @@ -1042,127 +1042,127 @@ pub mod url_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Action; - type CreatedAt; type CreatedBy; - type Pattern; - type Reason; + type CreatedAt; type UpdatedAt; + type Pattern; type Url; + type Action; + type Reason; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Action = Unset; - type CreatedAt = Unset; type CreatedBy = Unset; - type Pattern = Unset; - type Reason = Unset; + type CreatedAt = Unset; type UpdatedAt = Unset; + type Pattern = Unset; type Url = Unset; + type Action = Unset; + type Reason = Unset; } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData St>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type Action = Set; + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData St>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type CreatedBy = Set; type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; - type Pattern = St::Pattern; - type Reason = St::Reason; type UpdatedAt = St::UpdatedAt; + type Pattern = St::Pattern; type Url = St::Url; + type Action = St::Action; + type Reason = St::Reason; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData St>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Action = St::Action; - type CreatedAt = Set; type CreatedBy = St::CreatedBy; - type Pattern = St::Pattern; - type Reason = St::Reason; + type CreatedAt = Set; type UpdatedAt = St::UpdatedAt; + type Pattern = St::Pattern; type Url = St::Url; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData St>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { type Action = St::Action; + type Reason = St::Reason; + } + ///State transition - sets the `updated_at` field to Set + pub struct SetUpdatedAt(PhantomData St>); + impl sealed::Sealed for SetUpdatedAt {} + impl State for SetUpdatedAt { + type CreatedBy = St::CreatedBy; type CreatedAt = St::CreatedAt; - type CreatedBy = Set; + type UpdatedAt = Set; type Pattern = St::Pattern; - type Reason = St::Reason; - type UpdatedAt = St::UpdatedAt; type Url = St::Url; + type Action = St::Action; + type Reason = St::Reason; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData St>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { - type Action = St::Action; - type CreatedAt = St::CreatedAt; type CreatedBy = St::CreatedBy; - type Pattern = Set; - type Reason = St::Reason; - type UpdatedAt = St::UpdatedAt; - type Url = St::Url; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData St>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type Action = St::Action; type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; - type Pattern = St::Pattern; - type Reason = Set; type UpdatedAt = St::UpdatedAt; + type Pattern = Set; type Url = St::Url; - } - ///State transition - sets the `updated_at` field to Set - pub struct SetUpdatedAt(PhantomData St>); - impl sealed::Sealed for SetUpdatedAt {} - impl State for SetUpdatedAt { type Action = St::Action; - type CreatedAt = St::CreatedAt; - type CreatedBy = St::CreatedBy; - type Pattern = St::Pattern; type Reason = St::Reason; - type UpdatedAt = Set; - type Url = St::Url; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData St>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { - type Action = St::Action; + type CreatedBy = St::CreatedBy; type CreatedAt = St::CreatedAt; + type UpdatedAt = St::UpdatedAt; + type Pattern = St::Pattern; + type Url = Set; + type Action = St::Action; + type Reason = St::Reason; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData St>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { type CreatedBy = St::CreatedBy; + type CreatedAt = St::CreatedAt; + type UpdatedAt = St::UpdatedAt; type Pattern = St::Pattern; + type Url = St::Url; + type Action = Set; type Reason = St::Reason; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData St>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type CreatedBy = St::CreatedBy; + type CreatedAt = St::CreatedAt; type UpdatedAt = St::UpdatedAt; - type Url = Set; + type Pattern = St::Pattern; + type Url = St::Url; + type Action = St::Action; + type Reason = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `action` field - pub struct action(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `created_by` field pub struct created_by(()); - ///Marker type for the `pattern` field - pub struct pattern(()); - ///Marker type for the `reason` field - pub struct reason(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `updated_at` field pub struct updated_at(()); + ///Marker type for the `pattern` field + pub struct pattern(()); ///Marker type for the `url` field pub struct url(()); + ///Marker type for the `action` field + pub struct action(()); + ///Marker type for the `reason` field + pub struct reason(()); } } @@ -1349,13 +1349,13 @@ where impl UrlRuleBuilder where St: url_rule_state::State, - St::Action: url_rule_state::IsSet, - St::CreatedAt: url_rule_state::IsSet, St::CreatedBy: url_rule_state::IsSet, - St::Pattern: url_rule_state::IsSet, - St::Reason: url_rule_state::IsSet, + St::CreatedAt: url_rule_state::IsSet, St::UpdatedAt: url_rule_state::IsSet, + St::Pattern: url_rule_state::IsSet, St::Url: url_rule_state::IsSet, + St::Action: url_rule_state::IsSet, + St::Reason: url_rule_state::IsSet, { /// Build the final struct. pub fn build(self) -> UrlRule { diff --git a/services/types/src/tools_ozone/safelink/add_rule.rs b/services/types/src/tools_ozone/safelink/add_rule.rs index eaec7a6..054d8fa 100644 --- a/services/types/src/tools_ozone/safelink/add_rule.rs +++ b/services/types/src/tools_ozone/safelink/add_rule.rs @@ -140,67 +140,67 @@ pub mod add_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Action; + type Url; type Pattern; + type Action; type Reason; - type Url; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Action = Unset; + type Url = Unset; type Pattern = Unset; + type Action = Unset; type Reason = Unset; - type Url = Unset; } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData St>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type Action = Set; + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData St>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type Url = Set; type Pattern = St::Pattern; + type Action = St::Action; type Reason = St::Reason; - type Url = St::Url; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData St>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { - type Action = St::Action; + type Url = St::Url; type Pattern = Set; + type Action = St::Action; type Reason = St::Reason; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData St>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { type Url = St::Url; + type Pattern = St::Pattern; + type Action = Set; + type Reason = St::Reason; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData St>); impl sealed::Sealed for SetReason {} impl State for SetReason { - type Action = St::Action; - type Pattern = St::Pattern; - type Reason = Set; type Url = St::Url; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData St>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { - type Action = St::Action; type Pattern = St::Pattern; - type Reason = St::Reason; - type Url = Set; + type Action = St::Action; + type Reason = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `action` field - pub struct action(()); + ///Marker type for the `url` field + pub struct url(()); ///Marker type for the `pattern` field pub struct pattern(()); + ///Marker type for the `action` field + pub struct action(()); ///Marker type for the `reason` field pub struct reason(()); - ///Marker type for the `url` field - pub struct url(()); } } @@ -341,10 +341,10 @@ where impl AddRuleBuilder where St: add_rule_state::State, - St::Action: add_rule_state::IsSet, + St::Url: add_rule_state::IsSet, St::Pattern: add_rule_state::IsSet, + St::Action: add_rule_state::IsSet, St::Reason: add_rule_state::IsSet, - St::Url: add_rule_state::IsSet, { /// Build the final struct. pub fn build(self) -> AddRule { diff --git a/services/types/src/tools_ozone/safelink/update_rule.rs b/services/types/src/tools_ozone/safelink/update_rule.rs index 4b95df9..8717896 100644 --- a/services/types/src/tools_ozone/safelink/update_rule.rs +++ b/services/types/src/tools_ozone/safelink/update_rule.rs @@ -130,67 +130,67 @@ pub mod update_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Action; + type Url; type Pattern; + type Action; type Reason; - type Url; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Action = Unset; + type Url = Unset; type Pattern = Unset; + type Action = Unset; type Reason = Unset; - type Url = Unset; } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData St>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type Action = Set; + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData St>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type Url = Set; type Pattern = St::Pattern; + type Action = St::Action; type Reason = St::Reason; - type Url = St::Url; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData St>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { - type Action = St::Action; + type Url = St::Url; type Pattern = Set; + type Action = St::Action; type Reason = St::Reason; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData St>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { type Url = St::Url; + type Pattern = St::Pattern; + type Action = Set; + type Reason = St::Reason; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData St>); impl sealed::Sealed for SetReason {} impl State for SetReason { - type Action = St::Action; - type Pattern = St::Pattern; - type Reason = Set; type Url = St::Url; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData St>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { - type Action = St::Action; type Pattern = St::Pattern; - type Reason = St::Reason; - type Url = Set; + type Action = St::Action; + type Reason = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `action` field - pub struct action(()); + ///Marker type for the `url` field + pub struct url(()); ///Marker type for the `pattern` field pub struct pattern(()); + ///Marker type for the `action` field + pub struct action(()); ///Marker type for the `reason` field pub struct reason(()); - ///Marker type for the `url` field - pub struct url(()); } } @@ -331,10 +331,10 @@ where impl UpdateRuleBuilder where St: update_rule_state::State, - St::Action: update_rule_state::IsSet, + St::Url: update_rule_state::IsSet, St::Pattern: update_rule_state::IsSet, + St::Action: update_rule_state::IsSet, St::Reason: update_rule_state::IsSet, - St::Url: update_rule_state::IsSet, { /// Build the final struct. pub fn build(self) -> UpdateRule { diff --git a/services/types/src/tools_ozone/set.rs b/services/types/src/tools_ozone/set.rs index a42e546..9964f4c 100644 --- a/services/types/src/tools_ozone/set.rs +++ b/services/types/src/tools_ozone/set.rs @@ -283,65 +283,65 @@ pub mod set_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; - type Name; type SetSize; + type Name; + type CreatedAt; type UpdatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; - type Name = Unset; type SetSize = Unset; + type Name = Unset; + type CreatedAt = Unset; type UpdatedAt = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; + ///State transition - sets the `set_size` field to Set + pub struct SetSetSize(PhantomData St>); + impl sealed::Sealed for SetSetSize {} + impl State for SetSetSize { + type SetSize = Set; type Name = St::Name; - type SetSize = St::SetSize; + type CreatedAt = St::CreatedAt; type UpdatedAt = St::UpdatedAt; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData St>); impl sealed::Sealed for SetName {} impl State for SetName { - type CreatedAt = St::CreatedAt; - type Name = Set; type SetSize = St::SetSize; + type Name = Set; + type CreatedAt = St::CreatedAt; type UpdatedAt = St::UpdatedAt; } - ///State transition - sets the `set_size` field to Set - pub struct SetSetSize(PhantomData St>); - impl sealed::Sealed for SetSetSize {} - impl State for SetSetSize { - type CreatedAt = St::CreatedAt; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type SetSize = St::SetSize; type Name = St::Name; - type SetSize = Set; + type CreatedAt = Set; type UpdatedAt = St::UpdatedAt; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData St>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { - type CreatedAt = St::CreatedAt; - type Name = St::Name; type SetSize = St::SetSize; + type Name = St::Name; + type CreatedAt = St::CreatedAt; type UpdatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `name` field - pub struct name(()); ///Marker type for the `set_size` field pub struct set_size(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `updated_at` field pub struct updated_at(()); } @@ -464,9 +464,9 @@ where impl SetViewBuilder where St: set_view_state::State, - St::CreatedAt: set_view_state::IsSet, - St::Name: set_view_state::IsSet, St::SetSize: set_view_state::IsSet, + St::Name: set_view_state::IsSet, + St::CreatedAt: set_view_state::IsSet, St::UpdatedAt: set_view_state::IsSet, { /// Build the final struct. diff --git a/services/types/src/tools_ozone/setting.rs b/services/types/src/tools_ozone/setting.rs index bf35d84..e67a1a5 100644 --- a/services/types/src/tools_ozone/setting.rs +++ b/services/types/src/tools_ozone/setting.rs @@ -264,105 +264,105 @@ pub mod defs_option_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedBy; - type Did; type Key; + type CreatedBy; type LastUpdatedBy; - type Scope; + type Did; type Value; + type Scope; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedBy = Unset; - type Did = Unset; type Key = Unset; + type CreatedBy = Unset; type LastUpdatedBy = Unset; - type Scope = Unset; + type Did = Unset; type Value = Unset; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData St>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type CreatedBy = Set; - type Did = St::Did; - type Key = St::Key; - type LastUpdatedBy = St::LastUpdatedBy; - type Scope = St::Scope; - type Value = St::Value; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type CreatedBy = St::CreatedBy; - type Did = Set; - type Key = St::Key; - type LastUpdatedBy = St::LastUpdatedBy; - type Scope = St::Scope; - type Value = St::Value; + type Scope = Unset; } ///State transition - sets the `key` field to Set pub struct SetKey(PhantomData St>); impl sealed::Sealed for SetKey {} impl State for SetKey { - type CreatedBy = St::CreatedBy; - type Did = St::Did; type Key = Set; + type CreatedBy = St::CreatedBy; type LastUpdatedBy = St::LastUpdatedBy; + type Did = St::Did; + type Value = St::Value; type Scope = St::Scope; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData St>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type Key = St::Key; + type CreatedBy = Set; + type LastUpdatedBy = St::LastUpdatedBy; + type Did = St::Did; type Value = St::Value; + type Scope = St::Scope; } ///State transition - sets the `last_updated_by` field to Set pub struct SetLastUpdatedBy(PhantomData St>); impl sealed::Sealed for SetLastUpdatedBy {} impl State for SetLastUpdatedBy { - type CreatedBy = St::CreatedBy; - type Did = St::Did; type Key = St::Key; + type CreatedBy = St::CreatedBy; type LastUpdatedBy = Set; - type Scope = St::Scope; + type Did = St::Did; type Value = St::Value; + type Scope = St::Scope; } - ///State transition - sets the `scope` field to Set - pub struct SetScope(PhantomData St>); - impl sealed::Sealed for SetScope {} - impl State for SetScope { - type CreatedBy = St::CreatedBy; - type Did = St::Did; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { type Key = St::Key; + type CreatedBy = St::CreatedBy; type LastUpdatedBy = St::LastUpdatedBy; - type Scope = Set; + type Did = Set; type Value = St::Value; + type Scope = St::Scope; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData St>); impl sealed::Sealed for SetValue {} impl State for SetValue { + type Key = St::Key; type CreatedBy = St::CreatedBy; + type LastUpdatedBy = St::LastUpdatedBy; type Did = St::Did; + type Value = Set; + type Scope = St::Scope; + } + ///State transition - sets the `scope` field to Set + pub struct SetScope(PhantomData St>); + impl sealed::Sealed for SetScope {} + impl State for SetScope { type Key = St::Key; + type CreatedBy = St::CreatedBy; type LastUpdatedBy = St::LastUpdatedBy; - type Scope = St::Scope; - type Value = Set; + type Did = St::Did; + type Value = St::Value; + type Scope = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_by` field - pub struct created_by(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `key` field pub struct key(()); + ///Marker type for the `created_by` field + pub struct created_by(()); ///Marker type for the `last_updated_by` field pub struct last_updated_by(()); - ///Marker type for the `scope` field - pub struct scope(()); + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `scope` field + pub struct scope(()); } } @@ -577,12 +577,12 @@ where impl DefsOptionBuilder where St: defs_option_state::State, - St::CreatedBy: defs_option_state::IsSet, - St::Did: defs_option_state::IsSet, St::Key: defs_option_state::IsSet, + St::CreatedBy: defs_option_state::IsSet, St::LastUpdatedBy: defs_option_state::IsSet, - St::Scope: defs_option_state::IsSet, + St::Did: defs_option_state::IsSet, St::Value: defs_option_state::IsSet, + St::Scope: defs_option_state::IsSet, { /// Build the final struct. pub fn build(self) -> DefsOption { diff --git a/services/types/src/tools_ozone/setting/remove_options.rs b/services/types/src/tools_ozone/setting/remove_options.rs index fae6a70..bb6d492 100644 --- a/services/types/src/tools_ozone/setting/remove_options.rs +++ b/services/types/src/tools_ozone/setting/remove_options.rs @@ -150,37 +150,37 @@ pub mod remove_options_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Keys; type Scope; + type Keys; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Keys = Unset; type Scope = Unset; - } - ///State transition - sets the `keys` field to Set - pub struct SetKeys(PhantomData St>); - impl sealed::Sealed for SetKeys {} - impl State for SetKeys { - type Keys = Set; - type Scope = St::Scope; + type Keys = Unset; } ///State transition - sets the `scope` field to Set pub struct SetScope(PhantomData St>); impl sealed::Sealed for SetScope {} impl State for SetScope { - type Keys = St::Keys; type Scope = Set; + type Keys = St::Keys; + } + ///State transition - sets the `keys` field to Set + pub struct SetKeys(PhantomData St>); + impl sealed::Sealed for SetKeys {} + impl State for SetKeys { + type Scope = St::Scope; + type Keys = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `keys` field - pub struct keys(()); ///Marker type for the `scope` field pub struct scope(()); + ///Marker type for the `keys` field + pub struct keys(()); } } @@ -250,8 +250,8 @@ where impl RemoveOptionsBuilder where St: remove_options_state::State, - St::Keys: remove_options_state::IsSet, St::Scope: remove_options_state::IsSet, + St::Keys: remove_options_state::IsSet, { /// Build the final struct. pub fn build(self) -> RemoveOptions { diff --git a/services/types/src/tools_ozone/team.rs b/services/types/src/tools_ozone/team.rs index b767302..ad63bb8 100644 --- a/services/types/src/tools_ozone/team.rs +++ b/services/types/src/tools_ozone/team.rs @@ -64,20 +64,20 @@ pub enum MemberRole { impl MemberRole { pub fn as_str(&self) -> &str { match self { - Self::RoleAdmin => "#roleAdmin", - Self::RoleModerator => "#roleModerator", - Self::RoleTriage => "#roleTriage", - Self::RoleVerifier => "#roleVerifier", + Self::RoleAdmin => "tools.ozone.team.defs#roleAdmin", + Self::RoleModerator => "tools.ozone.team.defs#roleModerator", + Self::RoleTriage => "tools.ozone.team.defs#roleTriage", + Self::RoleVerifier => "tools.ozone.team.defs#roleVerifier", Self::Other(s) => s.as_ref(), } } /// Construct from a string-like value, matching known values. pub fn from_value(s: S) -> Self { match s.as_ref() { - "#roleAdmin" => Self::RoleAdmin, - "#roleModerator" => Self::RoleModerator, - "#roleTriage" => Self::RoleTriage, - "#roleVerifier" => Self::RoleVerifier, + "tools.ozone.team.defs#roleAdmin" => Self::RoleAdmin, + "tools.ozone.team.defs#roleModerator" => Self::RoleModerator, + "tools.ozone.team.defs#roleTriage" => Self::RoleTriage, + "tools.ozone.team.defs#roleVerifier" => Self::RoleVerifier, _ => Self::Other(s), } } @@ -202,37 +202,37 @@ pub mod member_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Role; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Role = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Role = St::Role; + type Did = Unset; } ///State transition - sets the `role` field to Set pub struct SetRole(PhantomData St>); impl sealed::Sealed for SetRole {} impl State for SetRole { - type Did = St::Did; type Role = Set; + type Did = St::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Role = St::Role; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `role` field pub struct role(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -375,8 +375,8 @@ impl MemberBuilder { impl MemberBuilder where St: member_state::State, - St::Did: member_state::IsSet, St::Role: member_state::IsSet, + St::Did: member_state::IsSet, { /// Build the final struct. pub fn build(self) -> Member { diff --git a/services/types/src/tools_ozone/team/add_member.rs b/services/types/src/tools_ozone/team/add_member.rs index 318c966..2c9c7eb 100644 --- a/services/types/src/tools_ozone/team/add_member.rs +++ b/services/types/src/tools_ozone/team/add_member.rs @@ -204,37 +204,37 @@ pub mod add_member_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Role; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Role = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData St>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Role = St::Role; + type Did = Unset; } ///State transition - sets the `role` field to Set pub struct SetRole(PhantomData St>); impl sealed::Sealed for SetRole {} impl State for SetRole { - type Did = St::Did; type Role = Set; + type Did = St::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData St>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Role = St::Role; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `role` field pub struct role(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -304,8 +304,8 @@ where impl AddMemberBuilder where St: add_member_state::State, - St::Did: add_member_state::IsSet, St::Role: add_member_state::IsSet, + St::Did: add_member_state::IsSet, { /// Build the final struct. pub fn build(self) -> AddMember { diff --git a/services/types/src/tools_ozone/verification.rs b/services/types/src/tools_ozone/verification.rs index 24f6639..a6692df 100644 --- a/services/types/src/tools_ozone/verification.rs +++ b/services/types/src/tools_ozone/verification.rs @@ -116,105 +116,105 @@ pub mod verification_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type DisplayName; - type Handle; + type CreatedAt; + type Uri; type Issuer; type Subject; - type Uri; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type DisplayName = Unset; - type Handle = Unset; + type CreatedAt = Unset; + type Uri = Unset; type Issuer = Unset; type Subject = Unset; - type Uri = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData St>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type DisplayName = St::DisplayName; - type Handle = St::Handle; - type Issuer = St::Issuer; - type Subject = St::Subject; - type Uri = St::Uri; + type Handle = Unset; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData St>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type CreatedAt = St::CreatedAt; type DisplayName = Set; - type Handle = St::Handle; + type CreatedAt = St::CreatedAt; + type Uri = St::Uri; type Issuer = St::Issuer; type Subject = St::Subject; + type Handle = St::Handle; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData St>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type DisplayName = St::DisplayName; + type CreatedAt = Set; type Uri = St::Uri; + type Issuer = St::Issuer; + type Subject = St::Subject; + type Handle = St::Handle; } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData St>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type CreatedAt = St::CreatedAt; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData St>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type DisplayName = St::DisplayName; - type Handle = Set; + type CreatedAt = St::CreatedAt; + type Uri = Set; type Issuer = St::Issuer; type Subject = St::Subject; - type Uri = St::Uri; + type Handle = St::Handle; } ///State transition - sets the `issuer` field to Set pub struct SetIssuer(PhantomData St>); impl sealed::Sealed for SetIssuer {} impl State for SetIssuer { - type CreatedAt = St::CreatedAt; type DisplayName = St::DisplayName; - type Handle = St::Handle; + type CreatedAt = St::CreatedAt; + type Uri = St::Uri; type Issuer = Set; type Subject = St::Subject; - type Uri = St::Uri; + type Handle = St::Handle; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = St::CreatedAt; type DisplayName = St::DisplayName; - type Handle = St::Handle; + type CreatedAt = St::CreatedAt; + type Uri = St::Uri; type Issuer = St::Issuer; type Subject = Set; - type Uri = St::Uri; + type Handle = St::Handle; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData St>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type CreatedAt = St::CreatedAt; + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData St>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { type DisplayName = St::DisplayName; - type Handle = St::Handle; + type CreatedAt = St::CreatedAt; + type Uri = St::Uri; type Issuer = St::Issuer; type Subject = St::Subject; - type Uri = Set; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `handle` field - pub struct handle(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `issuer` field pub struct issuer(()); ///Marker type for the `subject` field pub struct subject(()); - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -491,12 +491,12 @@ where impl VerificationViewBuilder where St: verification_view_state::State, - St::CreatedAt: verification_view_state::IsSet, St::DisplayName: verification_view_state::IsSet, - St::Handle: verification_view_state::IsSet, + St::CreatedAt: verification_view_state::IsSet, + St::Uri: verification_view_state::IsSet, St::Issuer: verification_view_state::IsSet, St::Subject: verification_view_state::IsSet, - St::Uri: verification_view_state::IsSet, + St::Handle: verification_view_state::IsSet, { /// Build the final struct. pub fn build(self) -> VerificationView { diff --git a/services/types/src/tools_ozone/verification/grant_verifications.rs b/services/types/src/tools_ozone/verification/grant_verifications.rs index 9c6f774..ac0d657 100644 --- a/services/types/src/tools_ozone/verification/grant_verifications.rs +++ b/services/types/src/tools_ozone/verification/grant_verifications.rs @@ -144,37 +144,37 @@ pub mod grant_error_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Error; type Subject; + type Error; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Error = Unset; type Subject = Unset; - } - ///State transition - sets the `error` field to Set - pub struct SetError(PhantomData St>); - impl sealed::Sealed for SetError {} - impl State for SetError { - type Error = Set; - type Subject = St::Subject; + type Error = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Error = St::Error; type Subject = Set; + type Error = St::Error; + } + ///State transition - sets the `error` field to Set + pub struct SetError(PhantomData St>); + impl sealed::Sealed for SetError {} + impl State for SetError { + type Subject = St::Subject; + type Error = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `error` field - pub struct error(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `error` field + pub struct error(()); } } @@ -244,8 +244,8 @@ where impl GrantErrorBuilder where St: grant_error_state::State, - St::Error: grant_error_state::IsSet, St::Subject: grant_error_state::IsSet, + St::Error: grant_error_state::IsSet, { /// Build the final struct. pub fn build(self) -> GrantError { @@ -535,50 +535,50 @@ pub mod verification_input_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type DisplayName; - type Handle; type Subject; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type DisplayName = Unset; - type Handle = Unset; type Subject = Unset; + type Handle = Unset; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData St>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { type DisplayName = Set; - type Handle = St::Handle; - type Subject = St::Subject; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData St>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type DisplayName = St::DisplayName; - type Handle = Set; type Subject = St::Subject; + type Handle = St::Handle; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData St>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { type DisplayName = St::DisplayName; - type Handle = St::Handle; type Subject = Set; + type Handle = St::Handle; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData St>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type DisplayName = St::DisplayName; + type Subject = St::Subject; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -681,8 +681,8 @@ impl VerificationInputBuilder where St: verification_input_state::State, St::DisplayName: verification_input_state::IsSet, - St::Handle: verification_input_state::IsSet, St::Subject: verification_input_state::IsSet, + St::Handle: verification_input_state::IsSet, { /// Build the final struct. pub fn build(self) -> VerificationInput { diff --git a/services/types/src/tools_ozone/verification/revoke_verifications.rs b/services/types/src/tools_ozone/verification/revoke_verifications.rs index 498d13b..f2f0d14 100644 --- a/services/types/src/tools_ozone/verification/revoke_verifications.rs +++ b/services/types/src/tools_ozone/verification/revoke_verifications.rs @@ -234,37 +234,37 @@ pub mod revoke_error_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Error; type Uri; + type Error; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Error = Unset; type Uri = Unset; - } - ///State transition - sets the `error` field to Set - pub struct SetError(PhantomData St>); - impl sealed::Sealed for SetError {} - impl State for SetError { - type Error = Set; - type Uri = St::Uri; + type Error = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData St>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Error = St::Error; type Uri = Set; + type Error = St::Error; + } + ///State transition - sets the `error` field to Set + pub struct SetError(PhantomData St>); + impl sealed::Sealed for SetError {} + impl State for SetError { + type Uri = St::Uri; + type Error = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `error` field - pub struct error(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `error` field + pub struct error(()); } } @@ -334,8 +334,8 @@ where impl RevokeErrorBuilder where St: revoke_error_state::State, - St::Error: revoke_error_state::IsSet, St::Uri: revoke_error_state::IsSet, + St::Error: revoke_error_state::IsSet, { /// Build the final struct. pub fn build(self) -> RevokeError { -- 2.51.2 From 142248f009535e122dca8bdaa4874bc5f35e5914 Mon Sep 17 00:00:00 2001 From: Matt Morris Date: Thu, 13 Aug 2026 12:13:14 -0500 Subject: [PATCH 16/16] fix: address review findings --- Cargo.toml | 6 +- .../lib/__tests__/onboardingRecords.test.ts | 61 ++++++--- .../cadet/src/ingestors/car/car_import.rs | 118 +++++++++++++++++- todo.md | 1 + 4 files changed, 162 insertions(+), 24 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 17ba4cb..5cfe408 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,9 +20,9 @@ sqlx = { version = "0.8", features = [ "chrono", "tls-rustls", ] } -jacquard-common = { version = "0.12.0-beta.2", features = ["reqwest-client"] } -jacquard-derive = { version = "0.12.0-beta.2" } -jacquard-lexicon = { version = "0.12.0-beta.2" } +jacquard-common = { version = "0.12.1", features = ["reqwest-client"] } +jacquard-derive = { version = "0.12.1" } +jacquard-lexicon = { version = "0.12.1" } serde = { version = "1.0", features = ["derive"] } anyhow = "1.0" serde_json = "1.0" diff --git a/apps/amethyst/lib/__tests__/onboardingRecords.test.ts b/apps/amethyst/lib/__tests__/onboardingRecords.test.ts index 9ce8ca7..65c522a 100644 --- a/apps/amethyst/lib/__tests__/onboardingRecords.test.ts +++ b/apps/amethyst/lib/__tests__/onboardingRecords.test.ts @@ -2,18 +2,34 @@ import { getBlobHash, LEGACY_PROFILE_COLLECTION, readRepoRecordWithLegacyFallback, + type RepoRecordAgent, STABLE_PROFILE_COLLECTION, } from "../atp/onboardingRecords"; +type MockRepoRecordAgent = RepoRecordAgent & { + call: jest.MockedFunction; +}; + +function createAgent(): MockRepoRecordAgent { + return { + call: jest.fn< + ReturnType, + Parameters + >(), + did: "did:plc:test", + }; +} + describe("readRepoRecordWithLegacyFallback", () => { it("uses the stable record when it exists", async () => { - const call = jest.fn().mockResolvedValue({ + const agent = createAgent(); + const { call } = agent; + call.mockResolvedValue({ data: { cid: "stable-cid", value: { displayName: "Stable" } }, }); - const agent = { call, did: "did:plc:test" }; const result = await readRepoRecordWithLegacyFallback( - agent as never, + agent, STABLE_PROFILE_COLLECTION, LEGACY_PROFILE_COLLECTION, ); @@ -32,16 +48,16 @@ describe("readRepoRecordWithLegacyFallback", () => { }); it("falls back to the legacy record when stable is missing", async () => { - const call = jest - .fn() + const agent = createAgent(); + const { call } = agent; + call .mockRejectedValueOnce({ error: "RecordNotFound", message: "missing" }) .mockResolvedValueOnce({ data: { cid: "legacy-cid", value: { displayName: "Legacy" } }, }); - const agent = { call, did: "did:plc:test" }; const result = await readRepoRecordWithLegacyFallback( - agent as never, + agent, STABLE_PROFILE_COLLECTION, LEGACY_PROFILE_COLLECTION, ); @@ -59,18 +75,23 @@ describe("readRepoRecordWithLegacyFallback", () => { }); it("returns null when neither namespace has a record", async () => { - const call = jest - .fn() - .mockRejectedValue({ error: "RecordNotFound", message: "missing" }); - const agent = { call, did: "did:plc:test" }; + const agent = createAgent(); + const { call } = agent; + call.mockRejectedValue({ error: "RecordNotFound", message: "missing" }); await expect( readRepoRecordWithLegacyFallback( - agent as never, + agent, STABLE_PROFILE_COLLECTION, LEGACY_PROFILE_COLLECTION, ), ).resolves.toBeNull(); + expect(call).toHaveBeenCalledTimes(2); + expect(call).toHaveBeenNthCalledWith(2, "com.atproto.repo.getRecord", { + repo: "did:plc:test", + collection: LEGACY_PROFILE_COLLECTION, + rkey: "self", + }); }); it("propagates a legacy read failure when the stable record is missing", async () => { @@ -78,15 +99,15 @@ describe("readRepoRecordWithLegacyFallback", () => { error: "NetworkError", message: "legacy read failed", }; - const call = jest - .fn() + const agent = createAgent(); + const { call } = agent; + call .mockRejectedValueOnce({ error: "RecordNotFound", message: "missing" }) .mockRejectedValueOnce(legacyError); - const agent = { call, did: "did:plc:test" }; await expect( readRepoRecordWithLegacyFallback( - agent as never, + agent, STABLE_PROFILE_COLLECTION, LEGACY_PROFILE_COLLECTION, ), @@ -98,15 +119,15 @@ describe("readRepoRecordWithLegacyFallback", () => { error: "NetworkError", message: "stable read failed", }; - const call = jest - .fn() + const agent = createAgent(); + const { call } = agent; + call .mockRejectedValueOnce(stableError) .mockRejectedValueOnce({ error: "RecordNotFound", message: "missing" }); - const agent = { call, did: "did:plc:test" }; await expect( readRepoRecordWithLegacyFallback( - agent as never, + agent, STABLE_PROFILE_COLLECTION, LEGACY_PROFILE_COLLECTION, ), diff --git a/services/cadet/src/ingestors/car/car_import.rs b/services/cadet/src/ingestors/car/car_import.rs index de03018..0582fe4 100644 --- a/services/cadet/src/ingestors/car/car_import.rs +++ b/services/cadet/src/ingestors/car/car_import.rs @@ -43,6 +43,7 @@ use redis::AsyncCommands; use rocketman::{ingestion::LexiconIngestor, types::event::Event}; use serde_json::Value; use sqlx::PgPool; +use std::collections::HashMap; use tracing::{info, warn}; /// Helper struct for extracted records @@ -88,6 +89,49 @@ fn stable_collection_for(collection: &str) -> Option<&'static str> { } } +fn is_legacy_collection(collection: &str) -> bool { + collection.starts_with("fm.teal.alpha.") +} + +/// Drop duplicate stable/alpha records from a repository snapshot. +/// +/// Records are duplicates when their canonical collection, rkey, and +/// normalized JSON are identical. Stable records win when both namespace +/// variants are present. +fn deduplicate_records(records: Vec) -> Vec { + let mut deduplicated: Vec<(ExtractedRecord, Value)> = Vec::with_capacity(records.len()); + let mut positions_by_key: HashMap<(&'static str, String), Vec> = HashMap::new(); + + for record in records { + let normalized_data = normalize_legacy_record_type(&record.data); + let Some(canonical_collection) = stable_collection_for(&record.collection) else { + deduplicated.push((record, normalized_data)); + continue; + }; + let key = (canonical_collection, record.rkey.clone()); + let duplicate_index = positions_by_key.get(&key).and_then(|positions| { + positions + .iter() + .copied() + .find(|&index| deduplicated[index].1 == normalized_data) + }); + + if let Some(index) = duplicate_index { + if is_legacy_collection(&deduplicated[index].0.collection) + && !is_legacy_collection(&record.collection) + { + deduplicated[index] = (record, normalized_data); + } + } else { + let index = deduplicated.len(); + deduplicated.push((record, normalized_data)); + positions_by_key.entry(key).or_default().push(index); + } + } + + deduplicated.into_iter().map(|(record, _)| record).collect() +} + /// CAR Import Ingestor handles importing Teal records from CAR files using atmst pub struct CarImportIngestor { sql: PgPool, @@ -151,8 +195,14 @@ impl CarImportIngestor { let records = self .extract_records_from_mst(&mst, &data_importer, did) .await?; + let extracted_count = records.len(); + let records = deduplicate_records(records); - info!("Extracted {} records from MST", records.len()); + info!( + "Extracted {} records from MST ({} after namespace deduplication)", + extracted_count, + records.len() + ); // Process each record through the appropriate ingestor let mut processed_count = 0_usize; @@ -879,6 +929,72 @@ mod tests { assert!(!is_teal_record_key("fm.teal.alpha.feed.play")); // No rkey } + #[test] + fn test_deduplicate_identical_alpha_and_stable_records_prefers_stable() { + let record_fields = serde_json::json!({ + "trackName": "Same recording", + "playedTime": "2024-01-01T00:00:00Z" + }); + let mut legacy_data = record_fields.clone(); + legacy_data["$type"] = serde_json::json!("fm.teal.alpha.feed.play"); + let mut stable_data = record_fields; + stable_data["$type"] = serde_json::json!("fm.teal.feed.play"); + + let records = deduplicate_records(vec![ + ExtractedRecord { + collection: "fm.teal.alpha.feed.play".to_string(), + rkey: "same-rkey".to_string(), + cid: "legacy-cid".to_string(), + data: legacy_data, + }, + ExtractedRecord { + collection: "fm.teal.feed.play".to_string(), + rkey: "same-rkey".to_string(), + cid: "stable-cid".to_string(), + data: stable_data, + }, + ]); + + assert_eq!(records.len(), 1); + assert_eq!(records[0].collection, "fm.teal.feed.play"); + assert_eq!(records[0].cid, "stable-cid"); + } + + #[test] + fn test_deduplicate_compares_only_matching_collection_and_rkey() { + let records = deduplicate_records(vec![ + ExtractedRecord { + collection: "fm.teal.alpha.actor.status".to_string(), + rkey: "same-rkey".to_string(), + cid: "status-cid".to_string(), + data: serde_json::json!({ + "$type": "fm.teal.alpha.actor.status", + "time": "2024-01-01T00:00:00Z" + }), + }, + ExtractedRecord { + collection: "fm.teal.feed.play".to_string(), + rkey: "same-rkey".to_string(), + cid: "play-cid".to_string(), + data: serde_json::json!({ + "$type": "fm.teal.feed.play", + "time": "2024-01-01T00:00:00Z" + }), + }, + ExtractedRecord { + collection: "fm.teal.actor.status".to_string(), + rkey: "different-rkey".to_string(), + cid: "other-status-cid".to_string(), + data: serde_json::json!({ + "$type": "fm.teal.actor.status", + "time": "2024-01-01T00:00:00Z" + }), + }, + ]); + + assert_eq!(records.len(), 3); + } + #[test] fn test_ipld_to_json_conversion() { // Test IPLD to JSON conversion logic directly diff --git a/todo.md b/todo.md index 55dda3e..ca8fca2 100644 --- a/todo.md +++ b/todo.md @@ -18,6 +18,7 @@ Last synced with GitHub and Linear issues: 2026-06-14. - Dark mode preview refresh (2026-08-11): added the cohesive dark palette across Amethyst shells, feeds, social surfaces, profile/stats views, manual stamping, onboarding, web chrome, and native tab colors. Rebuilt the named Cloudflare preview from `codex/manual-listens` after cherry-picking `07e4af5`; `https://sigilyph.teal.fm` metadata and latest-listens XRPC verification pass. - Manual theme toggle (2026-08-11): the Teal shell now exposes an accessible light/dark toggle on desktop and mobile; Settings retains the System option, and web theme choices persist via localStorage. - Focused code-health pass (2026-07-10): fixed `did:web` path resolution and resolver error handling in Cadet, avoided 10-second Postgres connection churn in Aqua/Cadet/Satellite, returned proper 404s for missing feed plays, and preserved delimiter-containing artist names in Satellite's latest-play response. Verified with targeted Rust checks and Cadet resolver tests. +- Review follow-up (2026-08-13): indexed CAR namespace deduplication by canonical collection/rkey, strengthened onboarding legacy-fallback tests with typed repo-agent mocks, and aligned workspace Jacquard dependencies with the 0.12.1 generator. Aqua actor-feed pagination and Cadet play-link cleanup were already implemented and required no changes. - Focused Amethyst code-health pass (2026-07-10): moved color-scheme initialization out of render, made Escape handling safe on native clients, kept independent home and right-rail requests visible when a sibling request fails, and migrated linting to ESLint 9 flat config while ignoring generated Expo output. Verified with TypeScript, focused lint, Jest, and a web export built against `https://sigilyph.teal.fm`. - Dependency refresh (2026-07-10): updated the Rust lockfile, root and standalone lexicon CLI pnpm locks, Expo SDK 57/RN 0.86, AT Protocol clients and lexicon generator, plus current compatible workspace tooling. Regenerated lexicons now normalize TypeScript relative imports for Metro; Amethyst record creation supplies required `$type` fields. Verified with offline Rust tests/checks, TypeScript, Jest, and full workspace builds. - Cadet live-ingestion recovery (2026-07-11): the preview consumer was repeatedly stalling because every incoming play synchronously refreshed four materialized views. The Compose Cadet service now enables its existing deferred-refresh mode so Jetstream events can drain without blocking for several seconds per play. Follow-up: add a periodic materialized-view refresh path before relying on live aggregate counts.