#[allow(unused_imports)]
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use core::marker::PhantomData;
use jacquard_common::{BosStr, CowStr, DefaultStr, FromStaticStr};
#[allow(unused_imports)]
use jacquard_common::deps::codegen::unicode_segmentation::UnicodeSegmentation;
use jacquard_common::deps::smol_str::SmolStr;
use jacquard_common::types::collection::{Collection, RecordError};
use jacquard_common::types::string::{AtUri, Cid, Datetime};
use jacquard_common::types::uri::{RecordUri, UriError};
use jacquard_common::types::value::Data;
use jacquard_common::xrpc::XrpcResp;
use jacquard_derive::{IntoStatic, lexicon};
use jacquard_lexicon::lexicon::LexiconDoc;
use jacquard_lexicon::schema::LexiconSchema;
use crate::net_anisota::beta::game::achievement;
#[allow(unused_imports)]
use jacquard_lexicon::validation::{ConstraintError, ValidationPath};
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
rename = "net.anisota.beta.game.achievement",
tag = "$type",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Achievement<S: BosStr = DefaultStr> {
pub achievement_id: S,
pub category: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub description: Option<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub metadata: Option<Data<S>>,
pub name: S,
#[serde(skip_serializing_if = "Option::is_none")]
pub rarity: Option<S>,
pub signature: achievement::Signature<S>,
#[serde(skip_serializing_if = "Option::is_none")]
pub tier: Option<i64>,
pub unlocked_at: Datetime,
#[serde(skip_serializing_if = "Option::is_none")]
pub verification_uri: Option<AtUri<S>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub xp_reward: Option<i64>,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(rename_all = "camelCase")]
pub struct AchievementGetRecordOutput<S: BosStr = DefaultStr> {
#[serde(skip_serializing_if = "Option::is_none")]
pub cid: Option<Cid<S>>,
pub uri: AtUri<S>,
pub value: Achievement<S>,
}
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic)]
#[serde(
rename_all = "camelCase",
bound(deserialize = "S: Deserialize<'de> + BosStr")
)]
pub struct Signature<S: BosStr = DefaultStr> {
pub issuer: S,
pub sig: S,
pub signed_at: Datetime,
#[serde(flatten, default, skip_serializing_if = "Option::is_none")]
pub extra_data: Option<BTreeMap<SmolStr, Data<S>>>,
}
impl<S: BosStr> Achievement<S> {
pub fn uri(uri: S) -> Result<RecordUri<S, AchievementRecord>, UriError> {
RecordUri::try_from_uri(AtUri::new(uri)?)
}
}
#[derive(Debug, Serialize, Deserialize)]
pub struct AchievementRecord;
impl XrpcResp for AchievementRecord {
const NSID: &'static str = "net.anisota.beta.game.achievement";
const ENCODING: &'static str = "application/json";
type Output<S: BosStr> = AchievementGetRecordOutput<S>;
type Err = RecordError;
}
impl<S: BosStr> From<AchievementGetRecordOutput<S>> for Achievement<S> {
fn from(output: AchievementGetRecordOutput<S>) -> Self {
output.value
}
}
impl<S: BosStr> Collection for Achievement<S> {
const NSID: &'static str = "net.anisota.beta.game.achievement";
type Record = AchievementRecord;
}
impl Collection for AchievementRecord {
const NSID: &'static str = "net.anisota.beta.game.achievement";
type Record = AchievementRecord;
}
impl<S: BosStr> LexiconSchema for Achievement<S> {
fn nsid() -> &'static str {
"net.anisota.beta.game.achievement"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_net_anisota_beta_game_achievement()
}
fn validate(&self) -> Result<(), ConstraintError> {
{
let value = &self.achievement_id;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("achievement_id"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.description {
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 500usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("description"),
max: 500usize,
actual: <str>::len(value.as_ref()),
});
}
}
{
let value = &self.name;
#[allow(unused_comparisons)]
if <str>::len(value.as_ref()) > 100usize {
return Err(ConstraintError::MaxLength {
path: ValidationPath::from_field("name"),
max: 100usize,
actual: <str>::len(value.as_ref()),
});
}
}
if let Some(ref value) = self.tier {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("tier"),
min: 0i64,
actual: *value,
});
}
}
if let Some(ref value) = self.xp_reward {
if *value < 0i64 {
return Err(ConstraintError::Minimum {
path: ValidationPath::from_field("xp_reward"),
min: 0i64,
actual: *value,
});
}
}
Ok(())
}
}
impl<S: BosStr> LexiconSchema for Signature<S> {
fn nsid() -> &'static str {
"net.anisota.beta.game.achievement"
}
fn def_name() -> &'static str {
"signature"
}
fn lexicon_doc() -> LexiconDoc<'static> {
lexicon_doc_net_anisota_beta_game_achievement()
}
fn validate(&self) -> Result<(), ConstraintError> {
Ok(())
}
}
pub mod achievement_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type AchievementId;
type Category;
type Name;
type Signature;
type UnlockedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type AchievementId = Unset;
type Category = Unset;
type Name = Unset;
type Signature = Unset;
type UnlockedAt = Unset;
}
pub struct SetAchievementId<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetAchievementId<St> {}
impl<St: State> State for SetAchievementId<St> {
type AchievementId = Set<members::achievement_id>;
type Category = St::Category;
type Name = St::Name;
type Signature = St::Signature;
type UnlockedAt = St::UnlockedAt;
}
pub struct SetCategory<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetCategory<St> {}
impl<St: State> State for SetCategory<St> {
type AchievementId = St::AchievementId;
type Category = Set<members::category>;
type Name = St::Name;
type Signature = St::Signature;
type UnlockedAt = St::UnlockedAt;
}
pub struct SetName<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetName<St> {}
impl<St: State> State for SetName<St> {
type AchievementId = St::AchievementId;
type Category = St::Category;
type Name = Set<members::name>;
type Signature = St::Signature;
type UnlockedAt = St::UnlockedAt;
}
pub struct SetSignature<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSignature<St> {}
impl<St: State> State for SetSignature<St> {
type AchievementId = St::AchievementId;
type Category = St::Category;
type Name = St::Name;
type Signature = Set<members::signature>;
type UnlockedAt = St::UnlockedAt;
}
pub struct SetUnlockedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetUnlockedAt<St> {}
impl<St: State> State for SetUnlockedAt<St> {
type AchievementId = St::AchievementId;
type Category = St::Category;
type Name = St::Name;
type Signature = St::Signature;
type UnlockedAt = Set<members::unlocked_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct achievement_id(());
pub struct category(());
pub struct name(());
pub struct signature(());
pub struct unlocked_at(());
}
}
pub struct AchievementBuilder<St: achievement_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (
Option<S>,
Option<S>,
Option<S>,
Option<Data<S>>,
Option<S>,
Option<S>,
Option<achievement::Signature<S>>,
Option<i64>,
Option<Datetime>,
Option<AtUri<S>>,
Option<i64>,
),
_type: PhantomData<fn() -> S>,
}
impl Achievement<DefaultStr> {
pub fn new() -> AchievementBuilder<achievement_state::Empty, DefaultStr> {
AchievementBuilder::new()
}
}
impl<S: BosStr> Achievement<S> {
pub fn builder() -> AchievementBuilder<achievement_state::Empty, S> {
AchievementBuilder::builder()
}
}
impl AchievementBuilder<achievement_state::Empty, DefaultStr> {
pub fn new() -> Self {
AchievementBuilder {
_state: PhantomData,
_fields: (
None, None, None, None, None, None, None, None, None, None, None,
),
_type: PhantomData,
}
}
}
impl<S: BosStr> AchievementBuilder<achievement_state::Empty, S> {
pub fn builder() -> Self {
AchievementBuilder {
_state: PhantomData,
_fields: (
None, None, None, None, None, None, None, None, None, None, None,
),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> AchievementBuilder<St, S>
where
St: achievement_state::State,
St::AchievementId: achievement_state::IsUnset,
{
pub fn achievement_id(
mut self,
value: impl Into<S>,
) -> AchievementBuilder<achievement_state::SetAchievementId<St>, S> {
self._fields.0 = Option::Some(value.into());
AchievementBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> AchievementBuilder<St, S>
where
St: achievement_state::State,
St::Category: achievement_state::IsUnset,
{
pub fn category(
mut self,
value: impl Into<S>,
) -> AchievementBuilder<achievement_state::SetCategory<St>, S> {
self._fields.1 = Option::Some(value.into());
AchievementBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St: achievement_state::State, S: BosStr> AchievementBuilder<St, S> {
pub fn description(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.2 = value.into();
self
}
pub fn maybe_description(mut self, value: Option<S>) -> Self {
self._fields.2 = value;
self
}
}
impl<St: achievement_state::State, S: BosStr> AchievementBuilder<St, S> {
pub fn metadata(mut self, value: impl Into<Option<Data<S>>>) -> Self {
self._fields.3 = value.into();
self
}
pub fn maybe_metadata(mut self, value: Option<Data<S>>) -> Self {
self._fields.3 = value;
self
}
}
impl<St, S: BosStr> AchievementBuilder<St, S>
where
St: achievement_state::State,
St::Name: achievement_state::IsUnset,
{
pub fn name(
mut self,
value: impl Into<S>,
) -> AchievementBuilder<achievement_state::SetName<St>, S> {
self._fields.4 = Option::Some(value.into());
AchievementBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St: achievement_state::State, S: BosStr> AchievementBuilder<St, S> {
pub fn rarity(mut self, value: impl Into<Option<S>>) -> Self {
self._fields.5 = value.into();
self
}
pub fn maybe_rarity(mut self, value: Option<S>) -> Self {
self._fields.5 = value;
self
}
}
impl<St, S: BosStr> AchievementBuilder<St, S>
where
St: achievement_state::State,
St::Signature: achievement_state::IsUnset,
{
pub fn signature(
mut self,
value: impl Into<achievement::Signature<S>>,
) -> AchievementBuilder<achievement_state::SetSignature<St>, S> {
self._fields.6 = Option::Some(value.into());
AchievementBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St: achievement_state::State, S: BosStr> AchievementBuilder<St, S> {
pub fn tier(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.7 = value.into();
self
}
pub fn maybe_tier(mut self, value: Option<i64>) -> Self {
self._fields.7 = value;
self
}
}
impl<St, S: BosStr> AchievementBuilder<St, S>
where
St: achievement_state::State,
St::UnlockedAt: achievement_state::IsUnset,
{
pub fn unlocked_at(
mut self,
value: impl Into<Datetime>,
) -> AchievementBuilder<achievement_state::SetUnlockedAt<St>, S> {
self._fields.8 = Option::Some(value.into());
AchievementBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St: achievement_state::State, S: BosStr> AchievementBuilder<St, S> {
pub fn verification_uri(mut self, value: impl Into<Option<AtUri<S>>>) -> Self {
self._fields.9 = value.into();
self
}
pub fn maybe_verification_uri(mut self, value: Option<AtUri<S>>) -> Self {
self._fields.9 = value;
self
}
}
impl<St: achievement_state::State, S: BosStr> AchievementBuilder<St, S> {
pub fn xp_reward(mut self, value: impl Into<Option<i64>>) -> Self {
self._fields.10 = value.into();
self
}
pub fn maybe_xp_reward(mut self, value: Option<i64>) -> Self {
self._fields.10 = value;
self
}
}
impl<St, S: BosStr> AchievementBuilder<St, S>
where
St: achievement_state::State,
St::AchievementId: achievement_state::IsSet,
St::Category: achievement_state::IsSet,
St::Name: achievement_state::IsSet,
St::Signature: achievement_state::IsSet,
St::UnlockedAt: achievement_state::IsSet,
{
pub fn build(self) -> Achievement<S> {
Achievement {
achievement_id: self._fields.0.unwrap(),
category: self._fields.1.unwrap(),
description: self._fields.2,
metadata: self._fields.3,
name: self._fields.4.unwrap(),
rarity: self._fields.5,
signature: self._fields.6.unwrap(),
tier: self._fields.7,
unlocked_at: self._fields.8.unwrap(),
verification_uri: self._fields.9,
xp_reward: self._fields.10,
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Achievement<S> {
Achievement {
achievement_id: self._fields.0.unwrap(),
category: self._fields.1.unwrap(),
description: self._fields.2,
metadata: self._fields.3,
name: self._fields.4.unwrap(),
rarity: self._fields.5,
signature: self._fields.6.unwrap(),
tier: self._fields.7,
unlocked_at: self._fields.8.unwrap(),
verification_uri: self._fields.9,
xp_reward: self._fields.10,
extra_data: Some(extra_data),
}
}
}
fn lexicon_doc_net_anisota_beta_game_achievement() -> LexiconDoc<'static> {
use alloc::collections::BTreeMap;
#[allow(unused_imports)]
use jacquard_common::{CowStr, deps::smol_str::SmolStr, types::blob::MimeType};
use jacquard_lexicon::lexicon::*;
LexiconDoc {
lexicon: Lexicon::Lexicon1,
id: CowStr::new_static("net.anisota.beta.game.achievement"),
defs: {
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("main"),
LexUserType::Record(LexRecord {
description: Some(
CowStr::new_static(
"Record representing an achievement unlocked by a player",
),
),
key: Some(CowStr::new_static("any")),
record: LexRecordRecord::Object(LexObject {
required: Some(
vec![
SmolStr::new_static("achievementId"),
SmolStr::new_static("category"),
SmolStr::new_static("name"),
SmolStr::new_static("unlockedAt"),
SmolStr::new_static("signature")
],
),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("achievementId"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"Unique identifier for the achievement (e.g., 'followers-1000', 'level-10')",
),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("category"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Category of the achievement"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("description"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Description of what was accomplished"),
),
max_length: Some(500usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("metadata"),
LexObjectProperty::Unknown(LexUnknown {
..Default::default()
}),
);
map.insert(
SmolStr::new_static("name"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Display name of the achievement"),
),
max_length: Some(100usize),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("rarity"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("Rarity tier of the achievement"),
),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("signature"),
LexObjectProperty::Ref(LexRef {
r#ref: CowStr::new_static("#signature"),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("tier"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("unlockedAt"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static("When the achievement was unlocked"),
),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("verificationUri"),
LexObjectProperty::String(LexString {
description: Some(
CowStr::new_static(
"AT URI linking to the verification record on the Anisota brand PDS",
),
),
format: Some(LexStringFormat::AtUri),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("xpReward"),
LexObjectProperty::Integer(LexInteger {
minimum: Some(0i64),
..Default::default()
}),
);
map
},
..Default::default()
}),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("signature"),
LexUserType::Object(LexObject {
description: Some(CowStr::new_static(
"Cryptographic signature proving authenticity",
)),
required: Some(vec![
SmolStr::new_static("issuer"),
SmolStr::new_static("signedAt"),
SmolStr::new_static("sig"),
]),
properties: {
#[allow(unused_mut)]
let mut map = BTreeMap::new();
map.insert(
SmolStr::new_static("issuer"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"DID of the signing authority (Anisota backend)",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("sig"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"Base64-encoded cryptographic signature",
)),
..Default::default()
}),
);
map.insert(
SmolStr::new_static("signedAt"),
LexObjectProperty::String(LexString {
description: Some(CowStr::new_static(
"When the achievement was signed",
)),
format: Some(LexStringFormat::Datetime),
..Default::default()
}),
);
map
},
..Default::default()
}),
);
map
},
..Default::default()
}
}
pub mod signature_state {
pub use crate::builder_types::{IsSet, IsUnset, Set, Unset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Issuer;
type Sig;
type SignedAt;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Issuer = Unset;
type Sig = Unset;
type SignedAt = Unset;
}
pub struct SetIssuer<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetIssuer<St> {}
impl<St: State> State for SetIssuer<St> {
type Issuer = Set<members::issuer>;
type Sig = St::Sig;
type SignedAt = St::SignedAt;
}
pub struct SetSig<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSig<St> {}
impl<St: State> State for SetSig<St> {
type Issuer = St::Issuer;
type Sig = Set<members::sig>;
type SignedAt = St::SignedAt;
}
pub struct SetSignedAt<St: State = Empty>(PhantomData<fn() -> St>);
impl<St: State> sealed::Sealed for SetSignedAt<St> {}
impl<St: State> State for SetSignedAt<St> {
type Issuer = St::Issuer;
type Sig = St::Sig;
type SignedAt = Set<members::signed_at>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct issuer(());
pub struct sig(());
pub struct signed_at(());
}
}
pub struct SignatureBuilder<St: signature_state::State, S: BosStr = DefaultStr> {
_state: PhantomData<fn() -> St>,
_fields: (Option<S>, Option<S>, Option<Datetime>),
_type: PhantomData<fn() -> S>,
}
impl Signature<DefaultStr> {
pub fn new() -> SignatureBuilder<signature_state::Empty, DefaultStr> {
SignatureBuilder::new()
}
}
impl<S: BosStr> Signature<S> {
pub fn builder() -> SignatureBuilder<signature_state::Empty, S> {
SignatureBuilder::builder()
}
}
impl SignatureBuilder<signature_state::Empty, DefaultStr> {
pub fn new() -> Self {
SignatureBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<S: BosStr> SignatureBuilder<signature_state::Empty, S> {
pub fn builder() -> Self {
SignatureBuilder {
_state: PhantomData,
_fields: (None, None, None),
_type: PhantomData,
}
}
}
impl<St, S: BosStr> SignatureBuilder<St, S>
where
St: signature_state::State,
St::Issuer: signature_state::IsUnset,
{
pub fn issuer(
mut self,
value: impl Into<S>,
) -> SignatureBuilder<signature_state::SetIssuer<St>, S> {
self._fields.0 = Option::Some(value.into());
SignatureBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> SignatureBuilder<St, S>
where
St: signature_state::State,
St::Sig: signature_state::IsUnset,
{
pub fn sig(mut self, value: impl Into<S>) -> SignatureBuilder<signature_state::SetSig<St>, S> {
self._fields.1 = Option::Some(value.into());
SignatureBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> SignatureBuilder<St, S>
where
St: signature_state::State,
St::SignedAt: signature_state::IsUnset,
{
pub fn signed_at(
mut self,
value: impl Into<Datetime>,
) -> SignatureBuilder<signature_state::SetSignedAt<St>, S> {
self._fields.2 = Option::Some(value.into());
SignatureBuilder {
_state: PhantomData,
_fields: self._fields,
_type: PhantomData,
}
}
}
impl<St, S: BosStr> SignatureBuilder<St, S>
where
St: signature_state::State,
St::Issuer: signature_state::IsSet,
St::Sig: signature_state::IsSet,
St::SignedAt: signature_state::IsSet,
{
pub fn build(self) -> Signature<S> {
Signature {
issuer: self._fields.0.unwrap(),
sig: self._fields.1.unwrap(),
signed_at: self._fields.2.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(self, extra_data: BTreeMap<SmolStr, Data<S>>) -> Signature<S> {
Signature {
issuer: self._fields.0.unwrap(),
sig: self._fields.1.unwrap(),
signed_at: self._fields.2.unwrap(),
extra_data: Some(extra_data),
}
}
}