atproto blogging
at main 688 lines 26 kB view raw
1// @generated by jacquard-lexicon. DO NOT EDIT. 2// 3// Lexicon: sh.weaver.notebook.getSuggestedNotebooks 4// 5// This file was automatically generated from Lexicon schemas. 6// Any manual changes will be overwritten on the next regeneration. 7 8#[derive( 9 serde::Serialize, 10 serde::Deserialize, 11 Debug, 12 Clone, 13 PartialEq, 14 Eq, 15 jacquard_derive::IntoStatic 16)] 17#[serde(rename_all = "camelCase")] 18pub struct GetSuggestedNotebooks { 19 ///(default: 20, min: 1, max: 50) 20 #[serde(skip_serializing_if = "std::option::Option::is_none")] 21 pub limit: std::option::Option<i64>, 22} 23 24pub mod get_suggested_notebooks_state { 25 26 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 27 #[allow(unused)] 28 use ::core::marker::PhantomData; 29 mod sealed { 30 pub trait Sealed {} 31 } 32 /// State trait tracking which required fields have been set 33 pub trait State: sealed::Sealed {} 34 /// Empty state - all required fields are unset 35 pub struct Empty(()); 36 impl sealed::Sealed for Empty {} 37 impl State for Empty {} 38 /// Marker types for field names 39 #[allow(non_camel_case_types)] 40 pub mod members {} 41} 42 43/// Builder for constructing an instance of this type 44pub struct GetSuggestedNotebooksBuilder<S: get_suggested_notebooks_state::State> { 45 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 46 __unsafe_private_named: (::core::option::Option<i64>,), 47} 48 49impl GetSuggestedNotebooks { 50 /// Create a new builder for this type 51 pub fn new() -> GetSuggestedNotebooksBuilder<get_suggested_notebooks_state::Empty> { 52 GetSuggestedNotebooksBuilder::new() 53 } 54} 55 56impl GetSuggestedNotebooksBuilder<get_suggested_notebooks_state::Empty> { 57 /// Create a new builder with all fields unset 58 pub fn new() -> Self { 59 GetSuggestedNotebooksBuilder { 60 _phantom_state: ::core::marker::PhantomData, 61 __unsafe_private_named: (None,), 62 } 63 } 64} 65 66impl<S: get_suggested_notebooks_state::State> GetSuggestedNotebooksBuilder<S> { 67 /// Set the `limit` field (optional) 68 pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self { 69 self.__unsafe_private_named.0 = value.into(); 70 self 71 } 72 /// Set the `limit` field to an Option value (optional) 73 pub fn maybe_limit(mut self, value: Option<i64>) -> Self { 74 self.__unsafe_private_named.0 = value; 75 self 76 } 77} 78 79impl<S> GetSuggestedNotebooksBuilder<S> 80where 81 S: get_suggested_notebooks_state::State, 82{ 83 /// Build the final struct 84 pub fn build(self) -> GetSuggestedNotebooks { 85 GetSuggestedNotebooks { 86 limit: self.__unsafe_private_named.0, 87 } 88 } 89} 90 91#[jacquard_derive::lexicon] 92#[derive( 93 serde::Serialize, 94 serde::Deserialize, 95 Debug, 96 Clone, 97 PartialEq, 98 Eq, 99 jacquard_derive::IntoStatic 100)] 101#[serde(rename_all = "camelCase")] 102pub struct GetSuggestedNotebooksOutput<'a> { 103 #[serde(borrow)] 104 pub notebooks: Vec< 105 crate::sh_weaver::notebook::get_suggested_notebooks::SuggestedNotebook<'a>, 106 >, 107} 108 109/// Response type for 110///sh.weaver.notebook.getSuggestedNotebooks 111pub struct GetSuggestedNotebooksResponse; 112impl jacquard_common::xrpc::XrpcResp for GetSuggestedNotebooksResponse { 113 const NSID: &'static str = "sh.weaver.notebook.getSuggestedNotebooks"; 114 const ENCODING: &'static str = "application/json"; 115 type Output<'de> = GetSuggestedNotebooksOutput<'de>; 116 type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 117} 118 119impl jacquard_common::xrpc::XrpcRequest for GetSuggestedNotebooks { 120 const NSID: &'static str = "sh.weaver.notebook.getSuggestedNotebooks"; 121 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 122 type Response = GetSuggestedNotebooksResponse; 123} 124 125/// Endpoint type for 126///sh.weaver.notebook.getSuggestedNotebooks 127pub struct GetSuggestedNotebooksRequest; 128impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestedNotebooksRequest { 129 const PATH: &'static str = "/xrpc/sh.weaver.notebook.getSuggestedNotebooks"; 130 const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 131 type Request<'de> = GetSuggestedNotebooks; 132 type Response = GetSuggestedNotebooksResponse; 133} 134 135#[jacquard_derive::lexicon] 136#[derive( 137 serde::Serialize, 138 serde::Deserialize, 139 Debug, 140 Clone, 141 PartialEq, 142 Eq, 143 jacquard_derive::IntoStatic 144)] 145#[serde(rename_all = "camelCase")] 146pub struct SuggestedNotebook<'a> { 147 #[serde(borrow)] 148 pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, 149 #[serde(borrow)] 150 pub reason: crate::sh_weaver::notebook::get_suggested_notebooks::SuggestionReason< 151 'a, 152 >, 153 /// Appview-computed relevance score. 154 #[serde(skip_serializing_if = "std::option::Option::is_none")] 155 pub score: std::option::Option<i64>, 156} 157 158pub mod suggested_notebook_state { 159 160 pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 161 #[allow(unused)] 162 use ::core::marker::PhantomData; 163 mod sealed { 164 pub trait Sealed {} 165 } 166 /// State trait tracking which required fields have been set 167 pub trait State: sealed::Sealed { 168 type Notebook; 169 type Reason; 170 } 171 /// Empty state - all required fields are unset 172 pub struct Empty(()); 173 impl sealed::Sealed for Empty {} 174 impl State for Empty { 175 type Notebook = Unset; 176 type Reason = Unset; 177 } 178 ///State transition - sets the `notebook` field to Set 179 pub struct SetNotebook<S: State = Empty>(PhantomData<fn() -> S>); 180 impl<S: State> sealed::Sealed for SetNotebook<S> {} 181 impl<S: State> State for SetNotebook<S> { 182 type Notebook = Set<members::notebook>; 183 type Reason = S::Reason; 184 } 185 ///State transition - sets the `reason` field to Set 186 pub struct SetReason<S: State = Empty>(PhantomData<fn() -> S>); 187 impl<S: State> sealed::Sealed for SetReason<S> {} 188 impl<S: State> State for SetReason<S> { 189 type Notebook = S::Notebook; 190 type Reason = Set<members::reason>; 191 } 192 /// Marker types for field names 193 #[allow(non_camel_case_types)] 194 pub mod members { 195 ///Marker type for the `notebook` field 196 pub struct notebook(()); 197 ///Marker type for the `reason` field 198 pub struct reason(()); 199 } 200} 201 202/// Builder for constructing an instance of this type 203pub struct SuggestedNotebookBuilder<'a, S: suggested_notebook_state::State> { 204 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 205 __unsafe_private_named: ( 206 ::core::option::Option<crate::sh_weaver::notebook::NotebookView<'a>>, 207 ::core::option::Option< 208 crate::sh_weaver::notebook::get_suggested_notebooks::SuggestionReason<'a>, 209 >, 210 ::core::option::Option<i64>, 211 ), 212 _phantom: ::core::marker::PhantomData<&'a ()>, 213} 214 215impl<'a> SuggestedNotebook<'a> { 216 /// Create a new builder for this type 217 pub fn new() -> SuggestedNotebookBuilder<'a, suggested_notebook_state::Empty> { 218 SuggestedNotebookBuilder::new() 219 } 220} 221 222impl<'a> SuggestedNotebookBuilder<'a, suggested_notebook_state::Empty> { 223 /// Create a new builder with all fields unset 224 pub fn new() -> Self { 225 SuggestedNotebookBuilder { 226 _phantom_state: ::core::marker::PhantomData, 227 __unsafe_private_named: (None, None, None), 228 _phantom: ::core::marker::PhantomData, 229 } 230 } 231} 232 233impl<'a, S> SuggestedNotebookBuilder<'a, S> 234where 235 S: suggested_notebook_state::State, 236 S::Notebook: suggested_notebook_state::IsUnset, 237{ 238 /// Set the `notebook` field (required) 239 pub fn notebook( 240 mut self, 241 value: impl Into<crate::sh_weaver::notebook::NotebookView<'a>>, 242 ) -> SuggestedNotebookBuilder<'a, suggested_notebook_state::SetNotebook<S>> { 243 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 244 SuggestedNotebookBuilder { 245 _phantom_state: ::core::marker::PhantomData, 246 __unsafe_private_named: self.__unsafe_private_named, 247 _phantom: ::core::marker::PhantomData, 248 } 249 } 250} 251 252impl<'a, S> SuggestedNotebookBuilder<'a, S> 253where 254 S: suggested_notebook_state::State, 255 S::Reason: suggested_notebook_state::IsUnset, 256{ 257 /// Set the `reason` field (required) 258 pub fn reason( 259 mut self, 260 value: impl Into< 261 crate::sh_weaver::notebook::get_suggested_notebooks::SuggestionReason<'a>, 262 >, 263 ) -> SuggestedNotebookBuilder<'a, suggested_notebook_state::SetReason<S>> { 264 self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 265 SuggestedNotebookBuilder { 266 _phantom_state: ::core::marker::PhantomData, 267 __unsafe_private_named: self.__unsafe_private_named, 268 _phantom: ::core::marker::PhantomData, 269 } 270 } 271} 272 273impl<'a, S: suggested_notebook_state::State> SuggestedNotebookBuilder<'a, S> { 274 /// Set the `score` field (optional) 275 pub fn score(mut self, value: impl Into<Option<i64>>) -> Self { 276 self.__unsafe_private_named.2 = value.into(); 277 self 278 } 279 /// Set the `score` field to an Option value (optional) 280 pub fn maybe_score(mut self, value: Option<i64>) -> Self { 281 self.__unsafe_private_named.2 = value; 282 self 283 } 284} 285 286impl<'a, S> SuggestedNotebookBuilder<'a, S> 287where 288 S: suggested_notebook_state::State, 289 S::Notebook: suggested_notebook_state::IsSet, 290 S::Reason: suggested_notebook_state::IsSet, 291{ 292 /// Build the final struct 293 pub fn build(self) -> SuggestedNotebook<'a> { 294 SuggestedNotebook { 295 notebook: self.__unsafe_private_named.0.unwrap(), 296 reason: self.__unsafe_private_named.1.unwrap(), 297 score: self.__unsafe_private_named.2, 298 extra_data: Default::default(), 299 } 300 } 301 /// Build the final struct with custom extra_data 302 pub fn build_with_data( 303 self, 304 extra_data: std::collections::BTreeMap< 305 jacquard_common::smol_str::SmolStr, 306 jacquard_common::types::value::Data<'a>, 307 >, 308 ) -> SuggestedNotebook<'a> { 309 SuggestedNotebook { 310 notebook: self.__unsafe_private_named.0.unwrap(), 311 reason: self.__unsafe_private_named.1.unwrap(), 312 score: self.__unsafe_private_named.2, 313 extra_data: Some(extra_data), 314 } 315 } 316} 317 318fn lexicon_doc_sh_weaver_notebook_getSuggestedNotebooks() -> ::jacquard_lexicon::lexicon::LexiconDoc< 319 'static, 320> { 321 ::jacquard_lexicon::lexicon::LexiconDoc { 322 lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 323 id: ::jacquard_common::CowStr::new_static( 324 "sh.weaver.notebook.getSuggestedNotebooks", 325 ), 326 revision: None, 327 description: None, 328 defs: { 329 let mut map = ::alloc::collections::BTreeMap::new(); 330 map.insert( 331 ::jacquard_common::smol_str::SmolStr::new_static("main"), 332 ::jacquard_lexicon::lexicon::LexUserType::XrpcQuery(::jacquard_lexicon::lexicon::LexXrpcQuery { 333 description: None, 334 parameters: Some( 335 ::jacquard_lexicon::lexicon::LexXrpcQueryParameter::Params(::jacquard_lexicon::lexicon::LexXrpcParameters { 336 description: None, 337 required: None, 338 properties: { 339 #[allow(unused_mut)] 340 let mut map = ::alloc::collections::BTreeMap::new(); 341 map.insert( 342 ::jacquard_common::smol_str::SmolStr::new_static("limit"), 343 ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 344 description: None, 345 default: None, 346 minimum: None, 347 maximum: None, 348 r#enum: None, 349 r#const: None, 350 }), 351 ); 352 map 353 }, 354 }), 355 ), 356 output: None, 357 errors: None, 358 }), 359 ); 360 map.insert( 361 ::jacquard_common::smol_str::SmolStr::new_static("suggestedNotebook"), 362 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 363 description: None, 364 required: Some( 365 vec![ 366 ::jacquard_common::smol_str::SmolStr::new_static("notebook"), 367 ::jacquard_common::smol_str::SmolStr::new_static("reason") 368 ], 369 ), 370 nullable: None, 371 properties: { 372 #[allow(unused_mut)] 373 let mut map = ::alloc::collections::BTreeMap::new(); 374 map.insert( 375 ::jacquard_common::smol_str::SmolStr::new_static("notebook"), 376 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 377 description: None, 378 r#ref: ::jacquard_common::CowStr::new_static( 379 "sh.weaver.notebook.defs#notebookView", 380 ), 381 }), 382 ); 383 map.insert( 384 ::jacquard_common::smol_str::SmolStr::new_static("reason"), 385 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 386 description: None, 387 r#ref: ::jacquard_common::CowStr::new_static( 388 "#suggestionReason", 389 ), 390 }), 391 ); 392 map.insert( 393 ::jacquard_common::smol_str::SmolStr::new_static("score"), 394 ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 395 description: None, 396 default: None, 397 minimum: None, 398 maximum: None, 399 r#enum: None, 400 r#const: None, 401 }), 402 ); 403 map 404 }, 405 }), 406 ); 407 map.insert( 408 ::jacquard_common::smol_str::SmolStr::new_static("suggestionReason"), 409 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 410 description: Some( 411 ::jacquard_common::CowStr::new_static( 412 "Why this notebook was suggested.", 413 ), 414 ), 415 required: Some( 416 vec![::jacquard_common::smol_str::SmolStr::new_static("type")], 417 ), 418 nullable: None, 419 properties: { 420 #[allow(unused_mut)] 421 let mut map = ::alloc::collections::BTreeMap::new(); 422 map.insert( 423 ::jacquard_common::smol_str::SmolStr::new_static( 424 "relatedAuthor", 425 ), 426 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 427 description: None, 428 r#ref: ::jacquard_common::CowStr::new_static( 429 "sh.weaver.actor.defs#profileViewBasic", 430 ), 431 }), 432 ); 433 map.insert( 434 ::jacquard_common::smol_str::SmolStr::new_static( 435 "relatedList", 436 ), 437 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 438 description: None, 439 r#ref: ::jacquard_common::CowStr::new_static( 440 "sh.weaver.graph.defs#listView", 441 ), 442 }), 443 ); 444 map.insert( 445 ::jacquard_common::smol_str::SmolStr::new_static( 446 "relatedNotebook", 447 ), 448 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 449 description: None, 450 r#ref: ::jacquard_common::CowStr::new_static( 451 "sh.weaver.notebook.defs#notebookView", 452 ), 453 }), 454 ); 455 map.insert( 456 ::jacquard_common::smol_str::SmolStr::new_static( 457 "relatedTags", 458 ), 459 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 460 description: Some( 461 ::jacquard_common::CowStr::new_static("Tags that matched."), 462 ), 463 items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 464 description: None, 465 format: None, 466 default: None, 467 min_length: None, 468 max_length: None, 469 min_graphemes: None, 470 max_graphemes: None, 471 r#enum: None, 472 r#const: None, 473 known_values: None, 474 }), 475 min_length: None, 476 max_length: None, 477 }), 478 ); 479 map.insert( 480 ::jacquard_common::smol_str::SmolStr::new_static("type"), 481 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 482 description: None, 483 format: None, 484 default: None, 485 min_length: None, 486 max_length: None, 487 min_graphemes: None, 488 max_graphemes: None, 489 r#enum: None, 490 r#const: None, 491 known_values: None, 492 }), 493 ); 494 map 495 }, 496 }), 497 ); 498 map 499 }, 500 } 501} 502 503impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SuggestedNotebook<'a> { 504 fn nsid() -> &'static str { 505 "sh.weaver.notebook.getSuggestedNotebooks" 506 } 507 fn def_name() -> &'static str { 508 "suggestedNotebook" 509 } 510 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 511 lexicon_doc_sh_weaver_notebook_getSuggestedNotebooks() 512 } 513 fn validate( 514 &self, 515 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 516 Ok(()) 517 } 518} 519 520/// Why this notebook was suggested. 521#[jacquard_derive::lexicon] 522#[derive( 523 serde::Serialize, 524 serde::Deserialize, 525 Debug, 526 Clone, 527 PartialEq, 528 Eq, 529 jacquard_derive::IntoStatic, 530 Default 531)] 532#[serde(rename_all = "camelCase")] 533pub struct SuggestionReason<'a> { 534 /// If followed-author, the author. 535 #[serde(skip_serializing_if = "std::option::Option::is_none")] 536 #[serde(borrow)] 537 pub related_author: std::option::Option< 538 crate::sh_weaver::actor::ProfileViewBasic<'a>, 539 >, 540 /// If from-list, the list it's from. 541 #[serde(skip_serializing_if = "std::option::Option::is_none")] 542 #[serde(borrow)] 543 pub related_list: std::option::Option<crate::sh_weaver::graph::ListView<'a>>, 544 /// If similar-to-X, the notebook it's similar to. 545 #[serde(skip_serializing_if = "std::option::Option::is_none")] 546 #[serde(borrow)] 547 pub related_notebook: std::option::Option< 548 crate::sh_weaver::notebook::NotebookView<'a>, 549 >, 550 /// Tags that matched. 551 #[serde(skip_serializing_if = "std::option::Option::is_none")] 552 #[serde(borrow)] 553 pub related_tags: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 554 #[serde(borrow)] 555 pub r#type: SuggestionReasonType<'a>, 556} 557 558#[derive(Debug, Clone, PartialEq, Eq, Hash)] 559pub enum SuggestionReasonType<'a> { 560 SimilarTags, 561 SimilarToLiked, 562 SimilarToRead, 563 FollowedAuthor, 564 PopularInTag, 565 Trending, 566 FromList, 567 Other(jacquard_common::CowStr<'a>), 568} 569 570impl<'a> SuggestionReasonType<'a> { 571 pub fn as_str(&self) -> &str { 572 match self { 573 Self::SimilarTags => "similar-tags", 574 Self::SimilarToLiked => "similar-to-liked", 575 Self::SimilarToRead => "similar-to-read", 576 Self::FollowedAuthor => "followed-author", 577 Self::PopularInTag => "popular-in-tag", 578 Self::Trending => "trending", 579 Self::FromList => "from-list", 580 Self::Other(s) => s.as_ref(), 581 } 582 } 583} 584 585impl<'a> From<&'a str> for SuggestionReasonType<'a> { 586 fn from(s: &'a str) -> Self { 587 match s { 588 "similar-tags" => Self::SimilarTags, 589 "similar-to-liked" => Self::SimilarToLiked, 590 "similar-to-read" => Self::SimilarToRead, 591 "followed-author" => Self::FollowedAuthor, 592 "popular-in-tag" => Self::PopularInTag, 593 "trending" => Self::Trending, 594 "from-list" => Self::FromList, 595 _ => Self::Other(jacquard_common::CowStr::from(s)), 596 } 597 } 598} 599 600impl<'a> From<String> for SuggestionReasonType<'a> { 601 fn from(s: String) -> Self { 602 match s.as_str() { 603 "similar-tags" => Self::SimilarTags, 604 "similar-to-liked" => Self::SimilarToLiked, 605 "similar-to-read" => Self::SimilarToRead, 606 "followed-author" => Self::FollowedAuthor, 607 "popular-in-tag" => Self::PopularInTag, 608 "trending" => Self::Trending, 609 "from-list" => Self::FromList, 610 _ => Self::Other(jacquard_common::CowStr::from(s)), 611 } 612 } 613} 614 615impl<'a> core::fmt::Display for SuggestionReasonType<'a> { 616 fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 617 write!(f, "{}", self.as_str()) 618 } 619} 620 621impl<'a> AsRef<str> for SuggestionReasonType<'a> { 622 fn as_ref(&self) -> &str { 623 self.as_str() 624 } 625} 626 627impl<'a> serde::Serialize for SuggestionReasonType<'a> { 628 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> 629 where 630 S: serde::Serializer, 631 { 632 serializer.serialize_str(self.as_str()) 633 } 634} 635 636impl<'de, 'a> serde::Deserialize<'de> for SuggestionReasonType<'a> 637where 638 'de: 'a, 639{ 640 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> 641 where 642 D: serde::Deserializer<'de>, 643 { 644 let s = <&'de str>::deserialize(deserializer)?; 645 Ok(Self::from(s)) 646 } 647} 648 649impl<'a> Default for SuggestionReasonType<'a> { 650 fn default() -> Self { 651 Self::Other(Default::default()) 652 } 653} 654 655impl jacquard_common::IntoStatic for SuggestionReasonType<'_> { 656 type Output = SuggestionReasonType<'static>; 657 fn into_static(self) -> Self::Output { 658 match self { 659 SuggestionReasonType::SimilarTags => SuggestionReasonType::SimilarTags, 660 SuggestionReasonType::SimilarToLiked => SuggestionReasonType::SimilarToLiked, 661 SuggestionReasonType::SimilarToRead => SuggestionReasonType::SimilarToRead, 662 SuggestionReasonType::FollowedAuthor => SuggestionReasonType::FollowedAuthor, 663 SuggestionReasonType::PopularInTag => SuggestionReasonType::PopularInTag, 664 SuggestionReasonType::Trending => SuggestionReasonType::Trending, 665 SuggestionReasonType::FromList => SuggestionReasonType::FromList, 666 SuggestionReasonType::Other(v) => { 667 SuggestionReasonType::Other(v.into_static()) 668 } 669 } 670 } 671} 672 673impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SuggestionReason<'a> { 674 fn nsid() -> &'static str { 675 "sh.weaver.notebook.getSuggestedNotebooks" 676 } 677 fn def_name() -> &'static str { 678 "suggestionReason" 679 } 680 fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 681 lexicon_doc_sh_weaver_notebook_getSuggestedNotebooks() 682 } 683 fn validate( 684 &self, 685 ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 686 Ok(()) 687 } 688}