diff --git a/atrium-api/src/app/bsky/actor/defs.rs b/atrium-api/src/app/bsky/actor/defs.rs index 8af84af5..bf427265 100644 --- a/atrium-api/src/app/bsky/actor/defs.rs +++ b/atrium-api/src/app/bsky/actor/defs.rs @@ -49,13 +49,13 @@ pub struct InterestsPref { } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModPrefItem { +pub struct LabelerPrefItem { pub did: crate::types::string::Did, } #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] -pub struct ModsPref { - pub mods: Vec, +pub struct LabelersPref { + pub labelers: Vec, } ///A word that the account owner has muted. #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] diff --git a/atrium-api/src/com/atproto/label/defs.rs b/atrium-api/src/com/atproto/label/defs.rs index fab9569e..c0bd0b3a 100644 --- a/atrium-api/src/com/atproto/label/defs.rs +++ b/atrium-api/src/com/atproto/label/defs.rs @@ -16,6 +16,7 @@ pub struct Label { #[serde(skip_serializing_if = "Option::is_none")] pub neg: Option, ///Signature of dag-cbor encoded label. + #[serde(default)] #[serde(with = "serde_bytes")] #[serde(skip_serializing_if = "Option::is_none")] pub sig: Option>, @@ -34,8 +35,14 @@ pub type LabelValue = String; #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] pub struct LabelValueDefinition { + ///Does the user need to have adult content enabled in order to configure this label? + #[serde(skip_serializing_if = "Option::is_none")] + pub adult_only: Option, ///What should this label hide in the UI, if applied? 'content' hides all of the target; 'media' hides the images/video/audio; 'none' hides nothing. pub blurs: String, + ///The default setting for this label. + #[serde(skip_serializing_if = "Option::is_none")] + pub default_setting: Option, ///The value of the label being defined. Must only include lowercase ascii and the '-' character ([a-z-]+). pub identifier: String, pub locales: Vec, diff --git a/atrium-api/src/com/atproto/server/describe_server.rs b/atrium-api/src/com/atproto/server/describe_server.rs index 5472bf41..392ed1f7 100644 --- a/atrium-api/src/com/atproto/server/describe_server.rs +++ b/atrium-api/src/com/atproto/server/describe_server.rs @@ -5,6 +5,9 @@ pub struct Output { ///List of domain suffixes that can be used in account handles. pub available_user_domains: Vec, + ///Contact information + #[serde(skip_serializing_if = "Option::is_none")] + pub contact: Option, pub did: crate::types::string::Did, ///If true, an invite code must be supplied to create an account on this instance. #[serde(skip_serializing_if = "Option::is_none")] @@ -21,6 +24,12 @@ pub struct Output { pub enum Error {} #[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] #[serde(rename_all = "camelCase")] +pub struct Contact { + #[serde(skip_serializing_if = "Option::is_none")] + pub email: Option, +} +#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq)] +#[serde(rename_all = "camelCase")] pub struct Links { #[serde(skip_serializing_if = "Option::is_none")] pub privacy_policy: Option, diff --git a/lexicon/atrium-codegen/src/token_stream.rs b/lexicon/atrium-codegen/src/token_stream.rs index d9fac557..043eae70 100644 --- a/lexicon/atrium-codegen/src/token_stream.rs +++ b/lexicon/atrium-codegen/src/token_stream.rs @@ -294,9 +294,17 @@ fn lex_object_property( } ); let mut attributes = match property { - LexObjectProperty::Bytes(_) => quote! { - #[serde(with = "serde_bytes")] - }, + LexObjectProperty::Bytes(_) => { + let default = if is_required { + quote!() + } else { + quote!(#[serde(default)]) + }; + quote! { + #default + #[serde(with = "serde_bytes")] + } + } _ => quote!(), }; if !is_required {