#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct TestingPolisVoteV1<'a> {
pub created_at: jacquard_common::types::string::Datetime,
#[serde(borrow)]
pub poll: crate::scot_comhairle::testing_polis_vote_v1::PollRef<'a>,
#[serde(borrow)]
pub subject: crate::scot_comhairle::testing_polis_vote_v1::StatementRef<'a>,
#[serde(borrow)]
pub value: jacquard_common::CowStr<'a>,
}
pub mod testing_polis_vote_v1_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Subject;
type CreatedAt;
type Value;
type Poll;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Subject = Unset;
type CreatedAt = Unset;
type Value = Unset;
type Poll = Unset;
}
pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetSubject<S> {}
impl<S: State> State for SetSubject<S> {
type Subject = Set<members::subject>;
type CreatedAt = S::CreatedAt;
type Value = S::Value;
type Poll = S::Poll;
}
pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCreatedAt<S> {}
impl<S: State> State for SetCreatedAt<S> {
type Subject = S::Subject;
type CreatedAt = Set<members::created_at>;
type Value = S::Value;
type Poll = S::Poll;
}
pub struct SetValue<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetValue<S> {}
impl<S: State> State for SetValue<S> {
type Subject = S::Subject;
type CreatedAt = S::CreatedAt;
type Value = Set<members::value>;
type Poll = S::Poll;
}
pub struct SetPoll<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetPoll<S> {}
impl<S: State> State for SetPoll<S> {
type Subject = S::Subject;
type CreatedAt = S::CreatedAt;
type Value = S::Value;
type Poll = Set<members::poll>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct subject(());
pub struct created_at(());
pub struct value(());
pub struct poll(());
}
}
pub struct TestingPolisVoteV1Builder<'a, S: testing_polis_vote_v1_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Datetime>,
::core::option::Option<
crate::scot_comhairle::testing_polis_vote_v1::PollRef<'a>,
>,
::core::option::Option<
crate::scot_comhairle::testing_polis_vote_v1::StatementRef<'a>,
>,
::core::option::Option<jacquard_common::CowStr<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> TestingPolisVoteV1<'a> {
pub fn new() -> TestingPolisVoteV1Builder<'a, testing_polis_vote_v1_state::Empty> {
TestingPolisVoteV1Builder::new()
}
}
impl<'a> TestingPolisVoteV1Builder<'a, testing_polis_vote_v1_state::Empty> {
pub fn new() -> Self {
TestingPolisVoteV1Builder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None, None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TestingPolisVoteV1Builder<'a, S>
where
S: testing_polis_vote_v1_state::State,
S::CreatedAt: testing_polis_vote_v1_state::IsUnset,
{
pub fn created_at(
mut self,
value: impl Into<jacquard_common::types::string::Datetime>,
) -> TestingPolisVoteV1Builder<'a, testing_polis_vote_v1_state::SetCreatedAt<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
TestingPolisVoteV1Builder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TestingPolisVoteV1Builder<'a, S>
where
S: testing_polis_vote_v1_state::State,
S::Poll: testing_polis_vote_v1_state::IsUnset,
{
pub fn poll(
mut self,
value: impl Into<crate::scot_comhairle::testing_polis_vote_v1::PollRef<'a>>,
) -> TestingPolisVoteV1Builder<'a, testing_polis_vote_v1_state::SetPoll<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
TestingPolisVoteV1Builder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TestingPolisVoteV1Builder<'a, S>
where
S: testing_polis_vote_v1_state::State,
S::Subject: testing_polis_vote_v1_state::IsUnset,
{
pub fn subject(
mut self,
value: impl Into<crate::scot_comhairle::testing_polis_vote_v1::StatementRef<'a>>,
) -> TestingPolisVoteV1Builder<'a, testing_polis_vote_v1_state::SetSubject<S>> {
self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into());
TestingPolisVoteV1Builder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TestingPolisVoteV1Builder<'a, S>
where
S: testing_polis_vote_v1_state::State,
S::Value: testing_polis_vote_v1_state::IsUnset,
{
pub fn value(
mut self,
value: impl Into<jacquard_common::CowStr<'a>>,
) -> TestingPolisVoteV1Builder<'a, testing_polis_vote_v1_state::SetValue<S>> {
self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into());
TestingPolisVoteV1Builder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> TestingPolisVoteV1Builder<'a, S>
where
S: testing_polis_vote_v1_state::State,
S::Subject: testing_polis_vote_v1_state::IsSet,
S::CreatedAt: testing_polis_vote_v1_state::IsSet,
S::Value: testing_polis_vote_v1_state::IsSet,
S::Poll: testing_polis_vote_v1_state::IsSet,
{
pub fn build(self) -> TestingPolisVoteV1<'a> {
TestingPolisVoteV1 {
created_at: self.__unsafe_private_named.0.unwrap(),
poll: self.__unsafe_private_named.1.unwrap(),
subject: self.__unsafe_private_named.2.unwrap(),
value: self.__unsafe_private_named.3.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> TestingPolisVoteV1<'a> {
TestingPolisVoteV1 {
created_at: self.__unsafe_private_named.0.unwrap(),
poll: self.__unsafe_private_named.1.unwrap(),
subject: self.__unsafe_private_named.2.unwrap(),
value: self.__unsafe_private_named.3.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> TestingPolisVoteV1<'a> {
pub fn uri(
uri: impl Into<jacquard_common::CowStr<'a>>,
) -> Result<
jacquard_common::types::uri::RecordUri<'a, TestingPolisVoteV1Record>,
jacquard_common::types::uri::UriError,
> {
jacquard_common::types::uri::RecordUri::try_from_uri(
jacquard_common::types::string::AtUri::new_cow(uri.into())?,
)
}
}
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct TestingPolisVoteV1GetRecordOutput<'a> {
#[serde(skip_serializing_if = "std::option::Option::is_none")]
#[serde(borrow)]
pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
#[serde(borrow)]
pub value: TestingPolisVoteV1<'a>,
}
impl From<TestingPolisVoteV1GetRecordOutput<'_>> for TestingPolisVoteV1<'_> {
fn from(output: TestingPolisVoteV1GetRecordOutput<'_>) -> Self {
use jacquard_common::IntoStatic;
output.value.into_static()
}
}
impl jacquard_common::types::collection::Collection for TestingPolisVoteV1<'_> {
const NSID: &'static str = "scot.comhairle.testingPolisVoteV1";
type Record = TestingPolisVoteV1Record;
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct TestingPolisVoteV1Record;
impl jacquard_common::xrpc::XrpcResp for TestingPolisVoteV1Record {
const NSID: &'static str = "scot.comhairle.testingPolisVoteV1";
const ENCODING: &'static str = "application/json";
type Output<'de> = TestingPolisVoteV1GetRecordOutput<'de>;
type Err<'de> = jacquard_common::types::collection::RecordError<'de>;
}
impl jacquard_common::types::collection::Collection for TestingPolisVoteV1Record {
const NSID: &'static str = "scot.comhairle.testingPolisVoteV1";
type Record = TestingPolisVoteV1Record;
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TestingPolisVoteV1<'a> {
fn nsid() -> &'static str {
"scot.comhairle.testingPolisVoteV1"
}
fn def_name() -> &'static str {
"main"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_scot_comhairle_testingPolisVoteV1()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
fn lexicon_doc_scot_comhairle_testingPolisVoteV1() -> ::jacquard_lexicon::lexicon::LexiconDoc<
'static,
> {
::jacquard_lexicon::lexicon::LexiconDoc {
lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1,
id: ::jacquard_common::CowStr::new_static("scot.comhairle.testingPolisVoteV1"),
revision: None,
description: None,
defs: {
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("main"),
::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord {
description: Some(
::jacquard_common::CowStr::new_static(
"A vote on a statement in the Polis-style deliberation system",
),
),
key: Some(::jacquard_common::CowStr::new_static("tid")),
record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject {
description: None,
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("value"),
::jacquard_common::deps::smol_str::SmolStr::new_static("subject"),
::jacquard_common::deps::smol_str::SmolStr::new_static("poll"),
::jacquard_common::deps::smol_str::SmolStr::new_static("createdAt")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"createdAt",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Timestamp when the vote was created",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Datetime,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"poll",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static("#pollRef"),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"subject",
),
::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef {
description: None,
r#ref: ::jacquard_common::CowStr::new_static(
"#statementRef",
),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"value",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static("The vote value"),
),
format: None,
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("pollRef"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Reference to a poll record",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Content identifier of the poll record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"AT-URI of the poll record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static("statementRef"),
::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject {
description: Some(
::jacquard_common::CowStr::new_static(
"Reference to a statement record",
),
),
required: Some(
vec![
::jacquard_common::deps::smol_str::SmolStr::new_static("uri"),
::jacquard_common::deps::smol_str::SmolStr::new_static("cid")
],
),
nullable: None,
properties: {
#[allow(unused_mut)]
let mut map = ::alloc::collections::BTreeMap::new();
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"cid",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"Content identifier of the statement record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::Cid,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map.insert(
::jacquard_common::deps::smol_str::SmolStr::new_static(
"uri",
),
::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString {
description: Some(
::jacquard_common::CowStr::new_static(
"AT-URI of the statement record",
),
),
format: Some(
::jacquard_lexicon::lexicon::LexStringFormat::AtUri,
),
default: None,
min_length: None,
max_length: None,
min_graphemes: None,
max_graphemes: None,
r#enum: None,
r#const: None,
known_values: None,
}),
);
map
},
}),
);
map
},
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct PollRef<'a> {
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod poll_ref_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Uri;
type Cid;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Uri = Unset;
type Cid = Unset;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Uri = Set<members::uri>;
type Cid = S::Cid;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Uri = S::Uri;
type Cid = Set<members::cid>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct uri(());
pub struct cid(());
}
}
pub struct PollRefBuilder<'a, S: poll_ref_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> PollRef<'a> {
pub fn new() -> PollRefBuilder<'a, poll_ref_state::Empty> {
PollRefBuilder::new()
}
}
impl<'a> PollRefBuilder<'a, poll_ref_state::Empty> {
pub fn new() -> Self {
PollRefBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PollRefBuilder<'a, S>
where
S: poll_ref_state::State,
S::Cid: poll_ref_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> PollRefBuilder<'a, poll_ref_state::SetCid<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
PollRefBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PollRefBuilder<'a, S>
where
S: poll_ref_state::State,
S::Uri: poll_ref_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> PollRefBuilder<'a, poll_ref_state::SetUri<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
PollRefBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> PollRefBuilder<'a, S>
where
S: poll_ref_state::State,
S::Uri: poll_ref_state::IsSet,
S::Cid: poll_ref_state::IsSet,
{
pub fn build(self) -> PollRef<'a> {
PollRef {
cid: self.__unsafe_private_named.0.unwrap(),
uri: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> PollRef<'a> {
PollRef {
cid: self.__unsafe_private_named.0.unwrap(),
uri: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PollRef<'a> {
fn nsid() -> &'static str {
"scot.comhairle.testingPolisVoteV1"
}
fn def_name() -> &'static str {
"pollRef"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_scot_comhairle_testingPolisVoteV1()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}
#[jacquard_derive::lexicon]
#[derive(
serde::Serialize,
serde::Deserialize,
Debug,
Clone,
PartialEq,
Eq,
jacquard_derive::IntoStatic
)]
#[serde(rename_all = "camelCase")]
pub struct StatementRef<'a> {
#[serde(borrow)]
pub cid: jacquard_common::types::string::Cid<'a>,
#[serde(borrow)]
pub uri: jacquard_common::types::string::AtUri<'a>,
}
pub mod statement_ref_state {
pub use crate::builder_types::{Set, Unset, IsSet, IsUnset};
#[allow(unused)]
use ::core::marker::PhantomData;
mod sealed {
pub trait Sealed {}
}
pub trait State: sealed::Sealed {
type Cid;
type Uri;
}
pub struct Empty(());
impl sealed::Sealed for Empty {}
impl State for Empty {
type Cid = Unset;
type Uri = Unset;
}
pub struct SetCid<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetCid<S> {}
impl<S: State> State for SetCid<S> {
type Cid = Set<members::cid>;
type Uri = S::Uri;
}
pub struct SetUri<S: State = Empty>(PhantomData<fn() -> S>);
impl<S: State> sealed::Sealed for SetUri<S> {}
impl<S: State> State for SetUri<S> {
type Cid = S::Cid;
type Uri = Set<members::uri>;
}
#[allow(non_camel_case_types)]
pub mod members {
pub struct cid(());
pub struct uri(());
}
}
pub struct StatementRefBuilder<'a, S: statement_ref_state::State> {
_phantom_state: ::core::marker::PhantomData<fn() -> S>,
__unsafe_private_named: (
::core::option::Option<jacquard_common::types::string::Cid<'a>>,
::core::option::Option<jacquard_common::types::string::AtUri<'a>>,
),
_phantom: ::core::marker::PhantomData<&'a ()>,
}
impl<'a> StatementRef<'a> {
pub fn new() -> StatementRefBuilder<'a, statement_ref_state::Empty> {
StatementRefBuilder::new()
}
}
impl<'a> StatementRefBuilder<'a, statement_ref_state::Empty> {
pub fn new() -> Self {
StatementRefBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: (None, None),
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> StatementRefBuilder<'a, S>
where
S: statement_ref_state::State,
S::Cid: statement_ref_state::IsUnset,
{
pub fn cid(
mut self,
value: impl Into<jacquard_common::types::string::Cid<'a>>,
) -> StatementRefBuilder<'a, statement_ref_state::SetCid<S>> {
self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into());
StatementRefBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> StatementRefBuilder<'a, S>
where
S: statement_ref_state::State,
S::Uri: statement_ref_state::IsUnset,
{
pub fn uri(
mut self,
value: impl Into<jacquard_common::types::string::AtUri<'a>>,
) -> StatementRefBuilder<'a, statement_ref_state::SetUri<S>> {
self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into());
StatementRefBuilder {
_phantom_state: ::core::marker::PhantomData,
__unsafe_private_named: self.__unsafe_private_named,
_phantom: ::core::marker::PhantomData,
}
}
}
impl<'a, S> StatementRefBuilder<'a, S>
where
S: statement_ref_state::State,
S::Cid: statement_ref_state::IsSet,
S::Uri: statement_ref_state::IsSet,
{
pub fn build(self) -> StatementRef<'a> {
StatementRef {
cid: self.__unsafe_private_named.0.unwrap(),
uri: self.__unsafe_private_named.1.unwrap(),
extra_data: Default::default(),
}
}
pub fn build_with_data(
self,
extra_data: std::collections::BTreeMap<
jacquard_common::deps::smol_str::SmolStr,
jacquard_common::types::value::Data<'a>,
>,
) -> StatementRef<'a> {
StatementRef {
cid: self.__unsafe_private_named.0.unwrap(),
uri: self.__unsafe_private_named.1.unwrap(),
extra_data: Some(extra_data),
}
}
}
impl<'a> ::jacquard_lexicon::schema::LexiconSchema for StatementRef<'a> {
fn nsid() -> &'static str {
"scot.comhairle.testingPolisVoteV1"
}
fn def_name() -> &'static str {
"statementRef"
}
fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> {
lexicon_doc_scot_comhairle_testingPolisVoteV1()
}
fn validate(
&self,
) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> {
Ok(())
}
}