A better Rust ATProto crate

latest lexicons

+9397 -702
+3 -3
crates/jacquard-api/Cargo.toml
··· 38 38 bluesky = [ "com_atproto", "app_bsky", "chat_bsky", "tools_ozone", "minimal"] 39 39 other = ["sh_tangled", "sh_weaver", "pub_leaflet", "net_anisota", "network_slices", "com_whtwnd", "place_stream", "blue__2048", "minimal" ] 40 40 lexicon_community = ["community_lexicon", "my_skylights", "com_whtwnd", "social_psky", "blue_linkat", "tools_smokesignal", "minimal"] 41 - ufos = [ "moe_karashiiro", "dev_regnault", "buzz_bookhive", "uk_ewancroft", "win_tomo_x", "dev_fudgeu", "dev_ocbwoy3", "blog_pckt", "net_bnewbold", "club_stellz", "dev_baileytownsend", "net_aftertheinter", "org_devcon","org_robocracy", "garden_lexicon", "social_clippr", "social_grain", "social_pmsky", "com_crabdance", "app_blebbit", "app_ocho", "uk_skyblur", "us_polhem", "blue_atplane", "net_mmatt", "minimal", "app_rocksky"] 41 + ufos = [ "moe_karashiiro", "dev_regnault", "buzz_bookhive", "uk_ewancroft", "win_tomo_x", "dev_fudgeu", "dev_ocbwoy3", "blog_pckt", "net_bnewbold", "club_stellz", "dev_baileytownsend", "net_aftertheinter", "org_devcon","org_robocracy", "garden_lexicon", "social_clippr", "social_grain", "social_pmsky", "app_blebbit", "app_ocho", "uk_skyblur", "us_polhem", "blue_atplane", "net_mmatt", "minimal", "app_rocksky"] 42 42 43 43 streaming = ["jacquard-common/websocket"] 44 44 ··· 60 60 club_stellz = [] 61 61 com_atproto = [] 62 62 com_bad_example = [] 63 - com_crabdance = [] 64 63 com_shinolabs = [] 65 64 com_whtwnd = [] 66 65 community_lexicon = [] 66 + computer_aesthetic = [] 67 67 dev_baileytownsend = [] 68 68 dev_fudgeu = [] 69 69 dev_ocbwoy3 = [] 70 70 dev_regnault = [] 71 - events_smokesignal = [] 72 71 fm_teal = [] 73 72 fyi_frontpage = [] 74 73 fyi_unravel = [] ··· 82 81 net_mmatt = [] 83 82 network_slices = [] 84 83 org_devcon = [] 84 + org_farmapps = [] 85 85 org_robocracy = [] 86 86 place_atwork = [] 87 87 place_stream = ["app_bsky"]
+12
crates/jacquard-api/lexicons/app_bsky_actor_defs.json
··· 432 432 "type": "string", 433 433 "format": "datetime" 434 434 }, 435 + "debug": { 436 + "type": "unknown", 437 + "description": "Debug information for internal development" 438 + }, 435 439 "description": { 436 440 "type": "string", 437 441 "maxLength": 2560, ··· 497 501 "type": "string", 498 502 "format": "datetime" 499 503 }, 504 + "debug": { 505 + "type": "unknown", 506 + "description": "Debug information for internal development" 507 + }, 500 508 "did": { 501 509 "type": "string", 502 510 "format": "did" ··· 556 564 "createdAt": { 557 565 "type": "string", 558 566 "format": "datetime" 567 + }, 568 + "debug": { 569 + "type": "unknown", 570 + "description": "Debug information for internal development" 559 571 }, 560 572 "description": { 561 573 "type": "string",
+4
crates/jacquard-api/lexicons/app_bsky_feed_defs.json
··· 281 281 "type": "string", 282 282 "format": "cid" 283 283 }, 284 + "debug": { 285 + "type": "unknown", 286 + "description": "Debug information for internal development" 287 + }, 284 288 "embed": { 285 289 "type": "union", 286 290 "refs": [
+4
crates/jacquard-api/lexicons/app_bsky_graph_follow.json
··· 20 20 "subject": { 21 21 "type": "string", 22 22 "format": "did" 23 + }, 24 + "via": { 25 + "type": "ref", 26 + "ref": "com.atproto.repo.strongRef" 23 27 } 24 28 } 25 29 }
-59
crates/jacquard-api/lexicons/com_crabdance_nandi_post.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "com.crabdance.nandi.post", 4 - "defs": { 5 - "main": { 6 - "type": "record", 7 - "key": "tid", 8 - "record": { 9 - "type": "object", 10 - "required": [ 11 - "title", 12 - "content", 13 - "createdAt" 14 - ], 15 - "properties": { 16 - "content": { 17 - "type": "string", 18 - "description": "The main content of the blog post in markdown", 19 - "minLength": 1, 20 - "maxLength": 10000 21 - }, 22 - "createdAt": { 23 - "type": "string", 24 - "format": "datetime" 25 - }, 26 - "published": { 27 - "type": "boolean", 28 - "description": "Whether the post is published or draft", 29 - "default": false 30 - }, 31 - "summary": { 32 - "type": "string", 33 - "description": "Optional summary/excerpt of the post", 34 - "maxLength": 500 35 - }, 36 - "tags": { 37 - "type": "array", 38 - "description": "Tags for categorizing the post", 39 - "items": { 40 - "type": "string", 41 - "maxLength": 50 42 - }, 43 - "maxLength": 10 44 - }, 45 - "title": { 46 - "type": "string", 47 - "description": "The title of the blog post", 48 - "minLength": 1, 49 - "maxLength": 200 50 - }, 51 - "updatedAt": { 52 - "type": "string", 53 - "format": "datetime" 54 - } 55 - } 56 - } 57 - } 58 - } 59 - }
+42
crates/jacquard-api/lexicons/computer_aesthetic_kidlisp.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "computer.aesthetic.kidlisp", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A KidLisp code snippet from Aesthetic Computer", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "source", 13 + "code", 14 + "when", 15 + "ref" 16 + ], 17 + "properties": { 18 + "code": { 19 + "type": "string", 20 + "description": "Short alphanumeric code for easy lookup", 21 + "maxLength": 10 22 + }, 23 + "ref": { 24 + "type": "string", 25 + "description": "MongoDB ObjectId reference for bidirectional sync", 26 + "maxLength": 24 27 + }, 28 + "source": { 29 + "type": "string", 30 + "description": "The KidLisp source code", 31 + "maxLength": 50000 32 + }, 33 + "when": { 34 + "type": "string", 35 + "description": "Creation timestamp (ISO 8601)", 36 + "format": "datetime" 37 + } 38 + } 39 + } 40 + } 41 + } 42 + }
+35
crates/jacquard-api/lexicons/computer_aesthetic_mood.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "computer.aesthetic.mood", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A mood entry from Aesthetic Computer", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "mood", 13 + "when", 14 + "ref" 15 + ], 16 + "properties": { 17 + "mood": { 18 + "type": "string", 19 + "description": "The mood text content", 20 + "maxLength": 5000 21 + }, 22 + "ref": { 23 + "type": "string", 24 + "description": "Reference to source database record for bidirectional sync" 25 + }, 26 + "when": { 27 + "type": "string", 28 + "description": "When the mood was created (ISO 8601)", 29 + "format": "datetime" 30 + } 31 + } 32 + } 33 + } 34 + } 35 + }
+64
crates/jacquard-api/lexicons/computer_aesthetic_painting.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "computer.aesthetic.painting", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A digital painting created on aesthetic.computer", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "slug", 13 + "code", 14 + "imageUrl", 15 + "when", 16 + "ref" 17 + ], 18 + "properties": { 19 + "code": { 20 + "type": "string", 21 + "description": "Short alphanumeric code for easy lookup (e.g., 'a3b')", 22 + "maxLength": 10 23 + }, 24 + "imageUrl": { 25 + "type": "string", 26 + "description": "URL to full resolution PNG", 27 + "format": "uri", 28 + "maxLength": 512 29 + }, 30 + "recordingUrl": { 31 + "type": "string", 32 + "description": "URL to .zip recording file (if available)", 33 + "format": "uri", 34 + "maxLength": 512 35 + }, 36 + "ref": { 37 + "type": "string", 38 + "description": "MongoDB ObjectId reference for bidirectional sync", 39 + "maxLength": 24 40 + }, 41 + "slug": { 42 + "type": "string", 43 + "description": "Timestamp slug (may include recording: imageSlug:recordingSlug)", 44 + "maxLength": 128 45 + }, 46 + "thumbnail": { 47 + "type": "blob", 48 + "description": "Thumbnail preview (max 1MB)", 49 + "accept": [ 50 + "image/png", 51 + "image/jpeg" 52 + ], 53 + "maxSize": 1048576 54 + }, 55 + "when": { 56 + "type": "string", 57 + "description": "Creation timestamp (ISO 8601)", 58 + "format": "datetime" 59 + } 60 + } 61 + } 62 + } 63 + } 64 + }
+36
crates/jacquard-api/lexicons/computer_aesthetic_piece.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "computer.aesthetic.piece", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A piece (interactive program) from Aesthetic Computer", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "slug", 13 + "when", 14 + "ref" 15 + ], 16 + "properties": { 17 + "ref": { 18 + "type": "string", 19 + "description": "MongoDB ObjectId reference for bidirectional sync", 20 + "maxLength": 24 21 + }, 22 + "slug": { 23 + "type": "string", 24 + "description": "The piece identifier (e.g., 'wand')", 25 + "maxLength": 100 26 + }, 27 + "when": { 28 + "type": "string", 29 + "description": "Creation timestamp (ISO 8601)", 30 + "format": "datetime" 31 + } 32 + } 33 + } 34 + } 35 + } 36 + }
+62
crates/jacquard-api/lexicons/computer_aesthetic_tape.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "computer.aesthetic.tape", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "key": "tid", 8 + "record": { 9 + "type": "object", 10 + "required": [ 11 + "slug", 12 + "code", 13 + "when" 14 + ], 15 + "properties": { 16 + "acUrl": { 17 + "type": "string", 18 + "description": "Permanent link to view on aesthetic.computer (e.g., https://aesthetic.computer/!a3x)" 19 + }, 20 + "code": { 21 + "type": "string", 22 + "description": "Short alphanumeric code for easy lookup (e.g., 'a3x')" 23 + }, 24 + "ref": { 25 + "type": "string", 26 + "description": "MongoDB ObjectId reference for bi-directional sync" 27 + }, 28 + "slug": { 29 + "type": "string", 30 + "description": "The unique slug identifier for this tape (e.g., wand-1729177200000)" 31 + }, 32 + "thumbnail": { 33 + "type": "blob", 34 + "description": "Thumbnail image from midpoint frame, 3x scaled with nearest neighbor (max 1MB)", 35 + "accept": [ 36 + "image/jpeg", 37 + "image/png" 38 + ], 39 + "maxSize": 1048576 40 + }, 41 + "video": { 42 + "type": "blob", 43 + "description": "MP4 video with 3x pixel scaling and audio soundtrack (max 50MB)", 44 + "accept": [ 45 + "video/mp4" 46 + ], 47 + "maxSize": 52428800 48 + }, 49 + "when": { 50 + "type": "string", 51 + "description": "ISO 8601 timestamp when the tape was created", 52 + "format": "datetime" 53 + }, 54 + "zipUrl": { 55 + "type": "string", 56 + "description": "Direct URL to download the original ZIP file with frames and audio" 57 + } 58 + } 59 + } 60 + } 61 + } 62 + }
+58
crates/jacquard-api/lexicons/dev_fudgeu_experimental_atforumv1_feed_question.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "dev.fudgeu.experimental.atforumv1.feed.question", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "An initial question that starts a discussion", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "title", 13 + "content", 14 + "createdAt", 15 + "forum", 16 + "tags", 17 + "isOpen" 18 + ], 19 + "properties": { 20 + "content": { 21 + "type": "string", 22 + "minLength": 1, 23 + "maxLength": 10000 24 + }, 25 + "createdAt": { 26 + "type": "string", 27 + "format": "datetime" 28 + }, 29 + "forum": { 30 + "type": "string", 31 + "format": "at-identifier" 32 + }, 33 + "isOpen": { 34 + "type": "boolean" 35 + }, 36 + "tags": { 37 + "type": "array", 38 + "items": { 39 + "type": "string", 40 + "minLength": 1, 41 + "maxLength": 25 42 + }, 43 + "maxLength": 20 44 + }, 45 + "title": { 46 + "type": "string", 47 + "minLength": 1, 48 + "maxLength": 100 49 + }, 50 + "updatedAt": { 51 + "type": "string", 52 + "format": "datetime" 53 + } 54 + } 55 + } 56 + } 57 + } 58 + }
-46
crates/jacquard-api/lexicons/events_smokesignal_automation_InvokeWebhook.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "events.smokesignal.automation.InvokeWebhook", 4 - "defs": { 5 - "main": { 6 - "type": "procedure", 7 - "description": "Process a Smoke Signal webhook event.", 8 - "input": { 9 - "encoding": "application/json", 10 - "schema": { 11 - "type": "object", 12 - "required": [ 13 - "event", 14 - "record", 15 - "context" 16 - ], 17 - "properties": { 18 - "context": { 19 - "type": "object", 20 - "properties": {} 21 - }, 22 - "event": { 23 - "type": "string", 24 - "knownValues": [ 25 - "test", 26 - "rsvp.created", 27 - "event.created" 28 - ] 29 - }, 30 - "record": { 31 - "type": "object", 32 - "properties": {} 33 - } 34 - } 35 - } 36 - }, 37 - "output": { 38 - "encoding": "application/json", 39 - "schema": { 40 - "type": "object", 41 - "properties": {} 42 - } 43 - } 44 - } 45 - } 46 - }
+76
crates/jacquard-api/lexicons/org_farmapps_temp_agroconnect_cl022.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "org.farmapps.temp.agroconnect.cl022", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Fertilizer codelist", 8 + "key": "any", 9 + "record": { 10 + "type": "object", 11 + "description": "Codelist ferilizers", 12 + "required": [ 13 + "id", 14 + "description" 15 + ], 16 + "properties": { 17 + "added": { 18 + "type": "string", 19 + "description": "Date when added to the list", 20 + "format": "datetime" 21 + }, 22 + "comment": { 23 + "type": "string", 24 + "description": "Comment" 25 + }, 26 + "denominator": { 27 + "type": "integer", 28 + "description": "Denominator used for all fertilizer content properties", 29 + "minimum": 1 30 + }, 31 + "description": { 32 + "type": "string", 33 + "description": "Description / name of the fertilizer" 34 + }, 35 + "id": { 36 + "type": "ref", 37 + "description": "Id off the fertilizer", 38 + "ref": "org.farmapps.temp.ecrop.defs#codeType" 39 + }, 40 + "k2o": { 41 + "type": "integer", 42 + "description": "<unit> Potassium oxide content of this fertilizer ", 43 + "minimum": 0 44 + }, 45 + "n": { 46 + "type": "integer", 47 + "description": "<unit> Nitrogen content of this fertilizer ", 48 + "minimum": 0 49 + }, 50 + "p2o5": { 51 + "type": "integer", 52 + "description": "<unit> Phosphate content of this fertilizer ", 53 + "minimum": 0 54 + }, 55 + "type": { 56 + "type": "string", 57 + "description": "Fertlizer type", 58 + "enum": [ 59 + "Organic", 60 + "Inorganic" 61 + ] 62 + }, 63 + "unit": { 64 + "type": "string", 65 + "description": "Unit " 66 + }, 67 + "updated": { 68 + "type": "string", 69 + "description": "Date when updated", 70 + "format": "datetime" 71 + } 72 + } 73 + } 74 + } 75 + } 76 + }
+26
crates/jacquard-api/lexicons/org_farmapps_temp_ecrop_defs.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "org.farmapps.temp.ecrop.defs", 4 + "description": "Generic eCrop definitions", 5 + "defs": { 6 + "codeType": { 7 + "type": "object", 8 + "description": "Generic class to represent the code list and code that is used", 9 + "required": [ 10 + "listId", 11 + "code" 12 + ], 13 + "properties": { 14 + "code": { 15 + "type": "string", 16 + "format": "record-key" 17 + }, 18 + "listId": { 19 + "type": "string", 20 + "description": "Identifier of the standard code list that contains the allowed codes.", 21 + "format": "nsid" 22 + } 23 + } 24 + } 25 + } 26 + }
+5
crates/jacquard-api/lexicons/place_stream_broadcast_origin.json
··· 38 38 "type": "string", 39 39 "description": "Periodically updated timestamp when this origin last saw a livestream", 40 40 "format": "datetime" 41 + }, 42 + "websocketURL": { 43 + "type": "string", 44 + "description": "URL of the websocket endpoint for the livestream", 45 + "format": "uri" 41 46 } 42 47 } 43 48 }
+35
crates/jacquard-api/lexicons/place_stream_live_subscribeSegments.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "place.stream.live.subscribeSegments", 4 + "defs": { 5 + "main": { 6 + "type": "subscription", 7 + "description": "Subscribe to a stream's new segments as they come in!", 8 + "parameters": { 9 + "type": "params", 10 + "required": [ 11 + "streamer" 12 + ], 13 + "properties": { 14 + "streamer": { 15 + "type": "string", 16 + "description": "The DID of the streamer to subscribe to" 17 + } 18 + } 19 + }, 20 + "message": { 21 + "schema": { 22 + "type": "union", 23 + "refs": [ 24 + "#segment" 25 + ] 26 + } 27 + }, 28 + "errors": [] 29 + }, 30 + "segment": { 31 + "type": "bytes", 32 + "description": "MP4 file of a user's signed livestream segment" 33 + } 34 + } 35 + }
+15
crates/jacquard-api/lexicons/place_wisp_fs.json
··· 50 50 "blob" 51 51 ], 52 52 "properties": { 53 + "base64": { 54 + "type": "boolean", 55 + "description": "True if blob content is base64-encoded (used to bypass PDS content sniffing)" 56 + }, 53 57 "blob": { 54 58 "type": "blob", 55 59 "description": "Content blob ref", ··· 57 61 "*/*" 58 62 ], 59 63 "maxSize": 1000000 64 + }, 65 + "encoding": { 66 + "type": "string", 67 + "description": "Content encoding (e.g., gzip for compressed files)", 68 + "enum": [ 69 + "gzip" 70 + ] 71 + }, 72 + "mimeType": { 73 + "type": "string", 74 + "description": "Original MIME type before compression" 60 75 }, 61 76 "type": { 62 77 "type": "string",
+22
crates/jacquard-api/lexicons/pub_leaflet_blocks_button.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "pub.leaflet.blocks.button", 4 + "defs": { 5 + "main": { 6 + "type": "object", 7 + "required": [ 8 + "text", 9 + "url" 10 + ], 11 + "properties": { 12 + "text": { 13 + "type": "string" 14 + }, 15 + "url": { 16 + "type": "string", 17 + "format": "uri" 18 + } 19 + } 20 + } 21 + } 22 + }
+5 -2
crates/jacquard-api/lexicons/pub_leaflet_pages_canvas.json
··· 25 25 "pub.leaflet.blocks.code", 26 26 "pub.leaflet.blocks.horizontalRule", 27 27 "pub.leaflet.blocks.bskyPost", 28 - "pub.leaflet.blocks.page" 28 + "pub.leaflet.blocks.page", 29 + "pub.leaflet.blocks.poll", 30 + "pub.leaflet.blocks.button" 29 31 ] 30 32 }, 31 33 "height": { 32 34 "type": "integer" 33 35 }, 34 36 "rotation": { 35 - "type": "integer" 37 + "type": "integer", 38 + "description": "The rotation of the block in degrees" 36 39 }, 37 40 "width": { 38 41 "type": "integer"
+5 -1
crates/jacquard-api/lexicons/pub_leaflet_pages_linearDocument.json
··· 32 32 "pub.leaflet.blocks.horizontalRule", 33 33 "pub.leaflet.blocks.bskyPost", 34 34 "pub.leaflet.blocks.page", 35 - "pub.leaflet.blocks.poll" 35 + "pub.leaflet.blocks.poll", 36 + "pub.leaflet.blocks.button" 36 37 ] 37 38 } 38 39 } ··· 91 92 } 92 93 }, 93 94 "textAlignCenter": { 95 + "type": "token" 96 + }, 97 + "textAlignJustify": { 94 98 "type": "token" 95 99 }, 96 100 "textAlignLeft": {
+110 -5
crates/jacquard-api/lexicons/sh_weaver_actor_defs.json
··· 24 24 } 25 25 } 26 26 }, 27 + "pinnedList": { 28 + "type": "array", 29 + "items": { 30 + "type": "ref", 31 + "ref": "com.atproto.repo.strongRef" 32 + } 33 + }, 27 34 "profileDataView": { 28 35 "type": "object", 29 36 "required": [ ··· 33 40 "inner": { 34 41 "type": "union", 35 42 "refs": [ 36 - "sh.weaver.actor.defs#profileView", 37 - "app.bsky.actor.defs#profileViewDetailed" 43 + "#profileView", 44 + "app.bsky.actor.defs#profileViewDetailed", 45 + "#tangledProfileView" 46 + ] 47 + } 48 + } 49 + }, 50 + "profileDataViewBasic": { 51 + "type": "object", 52 + "required": [ 53 + "inner" 54 + ], 55 + "properties": { 56 + "inner": { 57 + "type": "union", 58 + "refs": [ 59 + "#profileViewBasic", 60 + "app.bsky.actor.defs#profileViewBasic", 61 + "#tangledProfileView" 38 62 ] 39 63 } 40 64 } ··· 50 74 "type": "string", 51 75 "format": "uri" 52 76 }, 77 + "banner": { 78 + "type": "string", 79 + "format": "uri" 80 + }, 53 81 "createdAt": { 54 82 "type": "string", 55 83 "format": "datetime" 56 84 }, 57 85 "description": { 58 86 "type": "string", 59 - "maxLength": 2560, 60 - "maxGraphemes": 256 87 + "maxLength": 10240, 88 + "maxGraphemes": 1024 61 89 }, 62 90 "did": { 63 91 "type": "string", ··· 99 127 "maxLength": 400, 100 128 "maxGraphemes": 40 101 129 }, 130 + "pinned": { 131 + "type": "ref", 132 + "description": "Notebooks or other records pinned for display.", 133 + "ref": "#pinnedList" 134 + }, 102 135 "pronouns": { 103 136 "type": "ref", 104 137 "description": "Pronouns to use in user-generated content.", 105 - "ref": "sh.weaver.actor.profile#pronounsList" 138 + "ref": "#pronounsList" 139 + }, 140 + "subscribedCount": { 141 + "type": "integer" 142 + }, 143 + "subscriberCount": { 144 + "type": "integer" 145 + } 146 + } 147 + }, 148 + "profileViewBasic": { 149 + "type": "object", 150 + "required": [ 151 + "did", 152 + "handle" 153 + ], 154 + "properties": { 155 + "avatar": { 156 + "type": "string", 157 + "format": "uri" 158 + }, 159 + "createdAt": { 160 + "type": "string", 161 + "format": "datetime" 162 + }, 163 + "did": { 164 + "type": "string", 165 + "format": "did" 166 + }, 167 + "displayName": { 168 + "type": "string", 169 + "maxLength": 640, 170 + "maxGraphemes": 64 171 + }, 172 + "handle": { 173 + "type": "string", 174 + "format": "handle" 175 + }, 176 + "indexedAt": { 177 + "type": "string", 178 + "format": "datetime" 179 + }, 180 + "labels": { 181 + "type": "array", 182 + "items": { 183 + "type": "ref", 184 + "ref": "com.atproto.label.defs#label" 185 + } 186 + }, 187 + "pronouns": { 188 + "type": "ref", 189 + "description": "Pronouns to use in user-generated content.", 190 + "ref": "#pronounsList" 106 191 } 107 192 } 193 + }, 194 + "pronounsList": { 195 + "type": "array", 196 + "items": { 197 + "type": "string", 198 + "maxLength": 500, 199 + "maxGraphemes": 50, 200 + "knownValues": [ 201 + "she/her", 202 + "he/him", 203 + "they/them", 204 + "it/its", 205 + "she/they", 206 + "he/they", 207 + "they/he", 208 + "they/she", 209 + "any/all" 210 + ] 211 + }, 212 + "maxLength": 5 108 213 }, 109 214 "tangledProfileView": { 110 215 "type": "object",
+26 -21
crates/jacquard-api/lexicons/sh_weaver_actor_profile.json
··· 18 18 ], 19 19 "maxSize": 1000000 20 20 }, 21 + "banner": { 22 + "type": "blob", 23 + "description": "Larger horizontal image to display behind profile view.", 24 + "accept": [ 25 + "image/png", 26 + "image/jpeg" 27 + ], 28 + "maxSize": 1000000 29 + }, 21 30 "bluesky": { 22 31 "type": "boolean", 23 32 "description": "Include link to this account on Bluesky." ··· 29 38 "description": { 30 39 "type": "string", 31 40 "description": "Free-form profile description text.", 32 - "maxLength": 2560, 33 - "maxGraphemes": 256 41 + "maxLength": 10240, 42 + "maxGraphemes": 1024 34 43 }, 35 44 "displayName": { 36 45 "type": "string", 37 46 "maxLength": 640, 38 47 "maxGraphemes": 64 48 + }, 49 + "labels": { 50 + "type": "union", 51 + "description": "Self-label values, specific to the application, on the overall account.", 52 + "refs": [ 53 + "com.atproto.label.defs#selfLabels" 54 + ] 39 55 }, 40 56 "links": { 41 57 "type": "array", ··· 53 69 "maxLength": 400, 54 70 "maxGraphemes": 40 55 71 }, 56 - "pinnedPost": { 72 + "pinned": { 57 73 "type": "ref", 58 - "ref": "com.atproto.repo.strongRef" 74 + "description": "Notebooks or other records pinned for display.", 75 + "ref": "sh.weaver.actor.defs#pinnedList" 59 76 }, 60 77 "pronouns": { 61 78 "type": "ref", 62 79 "description": "Pronouns to use in user-generated content.", 63 - "ref": "#pronounsList" 80 + "ref": "sh.weaver.actor.defs#pronounsList" 81 + }, 82 + "streamplace": { 83 + "type": "boolean", 84 + "description": "Include link to this account on stream.place." 64 85 }, 65 86 "tangled": { 66 87 "type": "boolean", 67 88 "description": "Include link to this account on Tangled." 68 89 } 69 90 } 70 - } 71 - }, 72 - "pronounsList": { 73 - "type": "array", 74 - "items": { 75 - "type": "string", 76 - "enum": [ 77 - "she/her", 78 - "he/him", 79 - "they/them", 80 - "it/its", 81 - "she/they", 82 - "he/they", 83 - "they/he", 84 - "they/she" 85 - ] 86 91 } 87 92 } 88 93 }
+1 -1
crates/jacquard-api/lexicons/sh_weaver_edit_cursor.json
··· 57 57 "type": "object", 58 58 "required": [ 59 59 "container", 60 - "die" 60 + "id" 61 61 ], 62 62 "properties": { 63 63 "container": {
+56
crates/jacquard-api/lexicons/sh_weaver_embed_images.json
··· 33 33 "image/*" 34 34 ], 35 35 "maxSize": 3000000 36 + }, 37 + "name": { 38 + "type": "string", 39 + "maxLength": 128 36 40 } 37 41 } 38 42 }, ··· 49 53 "ref": "#image" 50 54 }, 51 55 "maxLength": 48 56 + } 57 + } 58 + }, 59 + "view": { 60 + "type": "object", 61 + "required": [ 62 + "images" 63 + ], 64 + "properties": { 65 + "images": { 66 + "type": "array", 67 + "items": { 68 + "type": "ref", 69 + "ref": "#viewImage" 70 + }, 71 + "maxLength": 48 72 + } 73 + } 74 + }, 75 + "viewImage": { 76 + "type": "object", 77 + "required": [ 78 + "thumb", 79 + "fullsize", 80 + "alt" 81 + ], 82 + "properties": { 83 + "alt": { 84 + "type": "string", 85 + "description": "Alt text description of the image, for accessibility." 86 + }, 87 + "dimensions": { 88 + "type": "union", 89 + "refs": [ 90 + "app.bsky.embed.defs#aspectRatio", 91 + "sh.weaver.embed.defs#percentSize", 92 + "sh.weaver.embed.defs#pixelSize" 93 + ] 94 + }, 95 + "fullsize": { 96 + "type": "string", 97 + "description": "Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.", 98 + "format": "uri" 99 + }, 100 + "name": { 101 + "type": "string", 102 + "maxLength": 128 103 + }, 104 + "thumb": { 105 + "type": "string", 106 + "description": "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.", 107 + "format": "uri" 52 108 } 53 109 } 54 110 }
+45 -14
crates/jacquard-api/lexicons/sh_weaver_embed_records.json
··· 13 13 "type": "array", 14 14 "items": { 15 15 "type": "ref", 16 - "ref": "com.atproto.repo.strongRef" 16 + "ref": "#recordEmbed" 17 17 }, 18 18 "maxLength": 48 19 + } 20 + } 21 + }, 22 + "recordEmbed": { 23 + "type": "object", 24 + "required": [ 25 + "record" 26 + ], 27 + "properties": { 28 + "name": { 29 + "type": "string", 30 + "maxLength": 128 31 + }, 32 + "record": { 33 + "type": "ref", 34 + "ref": "com.atproto.repo.strongRef" 35 + } 36 + } 37 + }, 38 + "recordEmbedView": { 39 + "type": "object", 40 + "required": [ 41 + "recordView" 42 + ], 43 + "properties": { 44 + "name": { 45 + "type": "string", 46 + "maxLength": 128 47 + }, 48 + "recordView": { 49 + "type": "union", 50 + "refs": [ 51 + "app.bsky.embed.images#view", 52 + "app.bsky.embed.video#view", 53 + "app.bsky.embed.external#view", 54 + "app.bsky.embed.record#view", 55 + "app.bsky.embed.recordWithMedia#view", 56 + "sh.weaver.embed.records#view", 57 + "sh.weaver.embed.images#view" 58 + ] 19 59 } 20 60 } 21 61 }, ··· 107 147 ], 108 148 "properties": { 109 149 "author": { 110 - "type": "union", 111 - "refs": [ 112 - "app.bsky.actor.defs#profileViewBasic" 113 - ] 150 + "type": "ref", 151 + "ref": "sh.weaver.actor.defs#profileDataViewBasic" 114 152 }, 115 153 "cid": { 116 154 "type": "string", ··· 119 157 "embeds": { 120 158 "type": "array", 121 159 "items": { 122 - "type": "union", 123 - "refs": [ 124 - "app.bsky.embed.images#view", 125 - "app.bsky.embed.video#view", 126 - "app.bsky.embed.external#view", 127 - "app.bsky.embed.record#view", 128 - "app.bsky.embed.recordWithMedia#view", 129 - "sh.weaver.embed.records#view" 130 - ] 160 + "type": "ref", 161 + "ref": "#recordEmbedView" 131 162 } 132 163 }, 133 164 "indexedAt": {
+1 -1
crates/jacquard-api/lexicons/sh_weaver_notebook_defs.json
··· 196 196 "title": { 197 197 "type": "string", 198 198 "description": "The title of the notebook entry.", 199 - "maxLength": 420 199 + "maxLength": 300 200 200 } 201 201 } 202 202 }
+43
crates/jacquard-api/lexicons/social_flockfeeds_lexical_vocab.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "social.flockfeeds.lexical.vocab", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Canonical schema for vocabulary entries.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "id", 13 + "label", 14 + "createdAt" 15 + ], 16 + "properties": { 17 + "alternateType": { 18 + "type": "string", 19 + "description": "Specifies the kind of this record, expected to be a URI (recommended) or plain string." 20 + }, 21 + "createdAt": { 22 + "type": "string", 23 + "description": "Timestamp when this vocab entry was created (ISO 8601).", 24 + "format": "datetime" 25 + }, 26 + "description": { 27 + "type": "string", 28 + "description": "Optional longer description." 29 + }, 30 + "id": { 31 + "type": "string", 32 + "description": "Canonical URI/IRI for this vocab term.", 33 + "format": "uri" 34 + }, 35 + "label": { 36 + "type": "string", 37 + "description": "Human-readable label." 38 + } 39 + } 40 + } 41 + } 42 + } 43 + }
+79
crates/jacquard-api/lexicons/tools_ozone_moderation_defs.json
··· 98 98 } 99 99 } 100 100 }, 101 + "accountStrike": { 102 + "type": "object", 103 + "description": "Strike information for an account", 104 + "properties": { 105 + "activeStrikeCount": { 106 + "type": "integer", 107 + "description": "Current number of active strikes (excluding expired strikes)" 108 + }, 109 + "firstStrikeAt": { 110 + "type": "string", 111 + "description": "Timestamp of the first strike received", 112 + "format": "datetime" 113 + }, 114 + "lastStrikeAt": { 115 + "type": "string", 116 + "description": "Timestamp of the most recent strike received", 117 + "format": "datetime" 118 + }, 119 + "totalStrikeCount": { 120 + "type": "integer", 121 + "description": "Total number of strikes ever received (including expired strikes)" 122 + } 123 + } 124 + }, 101 125 "ageAssuranceEvent": { 102 126 "type": "object", 103 127 "description": "Age assurance info coming directly from users. Only works on DID subjects.", ··· 302 326 "type": "string", 303 327 "description": "The content of the email sent to the user." 304 328 }, 329 + "policies": { 330 + "type": "array", 331 + "description": "Names/Keywords of the policies that necessitated the email.", 332 + "items": { 333 + "type": "string" 334 + }, 335 + "maxLength": 5 336 + }, 337 + "severityLevel": { 338 + "type": "string", 339 + "description": "Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense" 340 + }, 341 + "strikeCount": { 342 + "type": "integer", 343 + "description": "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." 344 + }, 345 + "strikeExpiresAt": { 346 + "type": "string", 347 + "description": "When the strike should expire. If not provided, the strike never expires.", 348 + "format": "datetime" 349 + }, 305 350 "subjectLine": { 306 351 "type": "string", 307 352 "description": "The subject line of the email sent to the user." ··· 428 473 "comment": { 429 474 "type": "string", 430 475 "description": "Describe reasoning behind the reversal." 476 + }, 477 + "policies": { 478 + "type": "array", 479 + "description": "Names/Keywords of the policy infraction for which takedown is being reversed.", 480 + "items": { 481 + "type": "string" 482 + }, 483 + "maxLength": 5 484 + }, 485 + "severityLevel": { 486 + "type": "string", 487 + "description": "Severity level of the violation. Usually set from the last policy infraction's severity." 488 + }, 489 + "strikeCount": { 490 + "type": "integer", 491 + "description": "Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity." 431 492 } 432 493 } 433 494 }, ··· 481 542 "type": "string" 482 543 }, 483 544 "maxLength": 5 545 + }, 546 + "severityLevel": { 547 + "type": "string", 548 + "description": "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.)." 549 + }, 550 + "strikeCount": { 551 + "type": "integer", 552 + "description": "Number of strikes to assign to the user for this violation." 553 + }, 554 + "strikeExpiresAt": { 555 + "type": "string", 556 + "description": "When the strike should expire. If not provided, the strike never expires.", 557 + "format": "datetime" 484 558 } 485 559 } 486 560 }, ··· 1252 1326 "type": "ref", 1253 1327 "description": "Statistics related to the account subject", 1254 1328 "ref": "#accountStats" 1329 + }, 1330 + "accountStrike": { 1331 + "type": "ref", 1332 + "description": "Strike information for the account (account-level only)", 1333 + "ref": "#accountStrike" 1255 1334 }, 1256 1335 "ageAssuranceState": { 1257 1336 "type": "string",
+4
crates/jacquard-api/lexicons/tools_ozone_moderation_queryEvents.json
··· 143 143 "items": { 144 144 "type": "string" 145 145 } 146 + }, 147 + "withStrike": { 148 + "type": "boolean", 149 + "description": "If specified, only events where strikeCount value is set are returned." 146 150 } 147 151 } 148 152 },
+5
crates/jacquard-api/lexicons/tools_ozone_moderation_queryStatuses.json
··· 112 112 "type": "integer", 113 113 "description": "If specified, only subjects that belong to an account that has at least this many reported records will be returned." 114 114 }, 115 + "minStrikeCount": { 116 + "type": "integer", 117 + "description": "If specified, only subjects that belong to an account that has at least this many active strikes will be returned.", 118 + "minimum": 1 119 + }, 115 120 "minTakendownRecordsCount": { 116 121 "type": "integer", 117 122 "description": "If specified, only subjects that belong to an account that has at least this many taken down records will be returned."
+229 -130
crates/jacquard-api/src/app_bsky/actor.rs
··· 1217 1217 }), 1218 1218 ); 1219 1219 map.insert( 1220 + ::jacquard_common::smol_str::SmolStr::new_static("debug"), 1221 + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 1222 + description: None, 1223 + }), 1224 + ); 1225 + map.insert( 1220 1226 ::jacquard_common::smol_str::SmolStr::new_static( 1221 1227 "description", 1222 1228 ), ··· 1423 1429 }), 1424 1430 ); 1425 1431 map.insert( 1432 + ::jacquard_common::smol_str::SmolStr::new_static("debug"), 1433 + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 1434 + description: None, 1435 + }), 1436 + ); 1437 + map.insert( 1426 1438 ::jacquard_common::smol_str::SmolStr::new_static("did"), 1427 1439 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1428 1440 description: None, ··· 1607 1619 r#enum: None, 1608 1620 r#const: None, 1609 1621 known_values: None, 1622 + }), 1623 + ); 1624 + map.insert( 1625 + ::jacquard_common::smol_str::SmolStr::new_static("debug"), 1626 + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 1627 + description: None, 1610 1628 }), 1611 1629 ); 1612 1630 map.insert( ··· 4549 4567 pub avatar: Option<jacquard_common::types::string::Uri<'a>>, 4550 4568 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4551 4569 pub created_at: Option<jacquard_common::types::string::Datetime>, 4570 + /// Debug information for internal development 4571 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 4572 + #[serde(borrow)] 4573 + pub debug: Option<jacquard_common::types::value::Data<'a>>, 4552 4574 #[serde(skip_serializing_if = "std::option::Option::is_none")] 4553 4575 #[serde(borrow)] 4554 4576 pub description: Option<jacquard_common::CowStr<'a>>, ··· 4629 4651 ::core::option::Option<crate::app_bsky::actor::ProfileAssociated<'a>>, 4630 4652 ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 4631 4653 ::core::option::Option<jacquard_common::types::string::Datetime>, 4654 + ::core::option::Option<jacquard_common::types::value::Data<'a>>, 4632 4655 ::core::option::Option<jacquard_common::CowStr<'a>>, 4633 4656 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 4634 4657 ::core::option::Option<jacquard_common::CowStr<'a>>, ··· 4656 4679 ProfileViewBuilder { 4657 4680 _phantom_state: ::core::marker::PhantomData, 4658 4681 __unsafe_private_named: ( 4682 + None, 4659 4683 None, 4660 4684 None, 4661 4685 None, ··· 4733 4757 } 4734 4758 4735 4759 impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 4760 + /// Set the `debug` field (optional) 4761 + pub fn debug( 4762 + mut self, 4763 + value: impl Into<Option<jacquard_common::types::value::Data<'a>>>, 4764 + ) -> Self { 4765 + self.__unsafe_private_named.3 = value.into(); 4766 + self 4767 + } 4768 + /// Set the `debug` field to an Option value (optional) 4769 + pub fn maybe_debug( 4770 + mut self, 4771 + value: Option<jacquard_common::types::value::Data<'a>>, 4772 + ) -> Self { 4773 + self.__unsafe_private_named.3 = value; 4774 + self 4775 + } 4776 + } 4777 + 4778 + impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 4736 4779 /// Set the `description` field (optional) 4737 4780 pub fn description( 4738 4781 mut self, 4739 4782 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 4740 4783 ) -> Self { 4741 - self.__unsafe_private_named.3 = value.into(); 4784 + self.__unsafe_private_named.4 = value.into(); 4742 4785 self 4743 4786 } 4744 4787 /// Set the `description` field to an Option value (optional) ··· 4746 4789 mut self, 4747 4790 value: Option<jacquard_common::CowStr<'a>>, 4748 4791 ) -> Self { 4749 - self.__unsafe_private_named.3 = value; 4792 + self.__unsafe_private_named.4 = value; 4750 4793 self 4751 4794 } 4752 4795 } ··· 4761 4804 mut self, 4762 4805 value: impl Into<jacquard_common::types::string::Did<'a>>, 4763 4806 ) -> ProfileViewBuilder<'a, profile_view_state::SetDid<S>> { 4764 - self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 4807 + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 4765 4808 ProfileViewBuilder { 4766 4809 _phantom_state: ::core::marker::PhantomData, 4767 4810 __unsafe_private_named: self.__unsafe_private_named, ··· 4776 4819 mut self, 4777 4820 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 4778 4821 ) -> Self { 4779 - self.__unsafe_private_named.5 = value.into(); 4822 + self.__unsafe_private_named.6 = value.into(); 4780 4823 self 4781 4824 } 4782 4825 /// Set the `displayName` field to an Option value (optional) ··· 4784 4827 mut self, 4785 4828 value: Option<jacquard_common::CowStr<'a>>, 4786 4829 ) -> Self { 4787 - self.__unsafe_private_named.5 = value; 4830 + self.__unsafe_private_named.6 = value; 4788 4831 self 4789 4832 } 4790 4833 } ··· 4799 4842 mut self, 4800 4843 value: impl Into<jacquard_common::types::string::Handle<'a>>, 4801 4844 ) -> ProfileViewBuilder<'a, profile_view_state::SetHandle<S>> { 4802 - self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 4845 + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); 4803 4846 ProfileViewBuilder { 4804 4847 _phantom_state: ::core::marker::PhantomData, 4805 4848 __unsafe_private_named: self.__unsafe_private_named, ··· 4814 4857 mut self, 4815 4858 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 4816 4859 ) -> Self { 4817 - self.__unsafe_private_named.7 = value.into(); 4860 + self.__unsafe_private_named.8 = value.into(); 4818 4861 self 4819 4862 } 4820 4863 /// Set the `indexedAt` field to an Option value (optional) ··· 4822 4865 mut self, 4823 4866 value: Option<jacquard_common::types::string::Datetime>, 4824 4867 ) -> Self { 4825 - self.__unsafe_private_named.7 = value; 4868 + self.__unsafe_private_named.8 = value; 4826 4869 self 4827 4870 } 4828 4871 } ··· 4833 4876 mut self, 4834 4877 value: impl Into<Option<Vec<crate::com_atproto::label::Label<'a>>>>, 4835 4878 ) -> Self { 4836 - self.__unsafe_private_named.8 = value.into(); 4879 + self.__unsafe_private_named.9 = value.into(); 4837 4880 self 4838 4881 } 4839 4882 /// Set the `labels` field to an Option value (optional) ··· 4841 4884 mut self, 4842 4885 value: Option<Vec<crate::com_atproto::label::Label<'a>>>, 4843 4886 ) -> Self { 4844 - self.__unsafe_private_named.8 = value; 4887 + self.__unsafe_private_named.9 = value; 4845 4888 self 4846 4889 } 4847 4890 } ··· 4852 4895 mut self, 4853 4896 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 4854 4897 ) -> Self { 4855 - self.__unsafe_private_named.9 = value.into(); 4898 + self.__unsafe_private_named.10 = value.into(); 4856 4899 self 4857 4900 } 4858 4901 /// Set the `pronouns` field to an Option value (optional) 4859 4902 pub fn maybe_pronouns(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 4860 - self.__unsafe_private_named.9 = value; 4903 + self.__unsafe_private_named.10 = value; 4861 4904 self 4862 4905 } 4863 4906 } ··· 4868 4911 mut self, 4869 4912 value: impl Into<Option<crate::app_bsky::actor::StatusView<'a>>>, 4870 4913 ) -> Self { 4871 - self.__unsafe_private_named.10 = value.into(); 4914 + self.__unsafe_private_named.11 = value.into(); 4872 4915 self 4873 4916 } 4874 4917 /// Set the `status` field to an Option value (optional) ··· 4876 4919 mut self, 4877 4920 value: Option<crate::app_bsky::actor::StatusView<'a>>, 4878 4921 ) -> Self { 4879 - self.__unsafe_private_named.10 = value; 4922 + self.__unsafe_private_named.11 = value; 4880 4923 self 4881 4924 } 4882 4925 } ··· 4887 4930 mut self, 4888 4931 value: impl Into<Option<crate::app_bsky::actor::VerificationState<'a>>>, 4889 4932 ) -> Self { 4890 - self.__unsafe_private_named.11 = value.into(); 4933 + self.__unsafe_private_named.12 = value.into(); 4891 4934 self 4892 4935 } 4893 4936 /// Set the `verification` field to an Option value (optional) ··· 4895 4938 mut self, 4896 4939 value: Option<crate::app_bsky::actor::VerificationState<'a>>, 4897 4940 ) -> Self { 4898 - self.__unsafe_private_named.11 = value; 4941 + self.__unsafe_private_named.12 = value; 4899 4942 self 4900 4943 } 4901 4944 } ··· 4906 4949 mut self, 4907 4950 value: impl Into<Option<crate::app_bsky::actor::ViewerState<'a>>>, 4908 4951 ) -> Self { 4909 - self.__unsafe_private_named.12 = value.into(); 4952 + self.__unsafe_private_named.13 = value.into(); 4910 4953 self 4911 4954 } 4912 4955 /// Set the `viewer` field to an Option value (optional) ··· 4914 4957 mut self, 4915 4958 value: Option<crate::app_bsky::actor::ViewerState<'a>>, 4916 4959 ) -> Self { 4917 - self.__unsafe_private_named.12 = value; 4960 + self.__unsafe_private_named.13 = value; 4918 4961 self 4919 4962 } 4920 4963 } ··· 4931 4974 associated: self.__unsafe_private_named.0, 4932 4975 avatar: self.__unsafe_private_named.1, 4933 4976 created_at: self.__unsafe_private_named.2, 4934 - description: self.__unsafe_private_named.3, 4935 - did: self.__unsafe_private_named.4.unwrap(), 4936 - display_name: self.__unsafe_private_named.5, 4937 - handle: self.__unsafe_private_named.6.unwrap(), 4938 - indexed_at: self.__unsafe_private_named.7, 4939 - labels: self.__unsafe_private_named.8, 4940 - pronouns: self.__unsafe_private_named.9, 4941 - status: self.__unsafe_private_named.10, 4942 - verification: self.__unsafe_private_named.11, 4943 - viewer: self.__unsafe_private_named.12, 4977 + debug: self.__unsafe_private_named.3, 4978 + description: self.__unsafe_private_named.4, 4979 + did: self.__unsafe_private_named.5.unwrap(), 4980 + display_name: self.__unsafe_private_named.6, 4981 + handle: self.__unsafe_private_named.7.unwrap(), 4982 + indexed_at: self.__unsafe_private_named.8, 4983 + labels: self.__unsafe_private_named.9, 4984 + pronouns: self.__unsafe_private_named.10, 4985 + status: self.__unsafe_private_named.11, 4986 + verification: self.__unsafe_private_named.12, 4987 + viewer: self.__unsafe_private_named.13, 4944 4988 extra_data: Default::default(), 4945 4989 } 4946 4990 } ··· 4956 5000 associated: self.__unsafe_private_named.0, 4957 5001 avatar: self.__unsafe_private_named.1, 4958 5002 created_at: self.__unsafe_private_named.2, 4959 - description: self.__unsafe_private_named.3, 4960 - did: self.__unsafe_private_named.4.unwrap(), 4961 - display_name: self.__unsafe_private_named.5, 4962 - handle: self.__unsafe_private_named.6.unwrap(), 4963 - indexed_at: self.__unsafe_private_named.7, 4964 - labels: self.__unsafe_private_named.8, 4965 - pronouns: self.__unsafe_private_named.9, 4966 - status: self.__unsafe_private_named.10, 4967 - verification: self.__unsafe_private_named.11, 4968 - viewer: self.__unsafe_private_named.12, 5003 + debug: self.__unsafe_private_named.3, 5004 + description: self.__unsafe_private_named.4, 5005 + did: self.__unsafe_private_named.5.unwrap(), 5006 + display_name: self.__unsafe_private_named.6, 5007 + handle: self.__unsafe_private_named.7.unwrap(), 5008 + indexed_at: self.__unsafe_private_named.8, 5009 + labels: self.__unsafe_private_named.9, 5010 + pronouns: self.__unsafe_private_named.10, 5011 + status: self.__unsafe_private_named.11, 5012 + verification: self.__unsafe_private_named.12, 5013 + viewer: self.__unsafe_private_named.13, 4969 5014 extra_data: Some(extra_data), 4970 5015 } 4971 5016 } ··· 5068 5113 pub avatar: Option<jacquard_common::types::string::Uri<'a>>, 5069 5114 #[serde(skip_serializing_if = "std::option::Option::is_none")] 5070 5115 pub created_at: Option<jacquard_common::types::string::Datetime>, 5116 + /// Debug information for internal development 5117 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 5118 + #[serde(borrow)] 5119 + pub debug: Option<jacquard_common::types::value::Data<'a>>, 5071 5120 #[serde(borrow)] 5072 5121 pub did: jacquard_common::types::string::Did<'a>, 5073 5122 #[serde(skip_serializing_if = "std::option::Option::is_none")] ··· 5143 5192 ::core::option::Option<crate::app_bsky::actor::ProfileAssociated<'a>>, 5144 5193 ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 5145 5194 ::core::option::Option<jacquard_common::types::string::Datetime>, 5195 + ::core::option::Option<jacquard_common::types::value::Data<'a>>, 5146 5196 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 5147 5197 ::core::option::Option<jacquard_common::CowStr<'a>>, 5148 5198 ::core::option::Option<jacquard_common::types::string::Handle<'a>>, ··· 5179 5229 None, 5180 5230 None, 5181 5231 None, 5232 + None, 5182 5233 ), 5183 5234 _phantom: ::core::marker::PhantomData, 5184 5235 } ··· 5242 5293 } 5243 5294 } 5244 5295 5296 + impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 5297 + /// Set the `debug` field (optional) 5298 + pub fn debug( 5299 + mut self, 5300 + value: impl Into<Option<jacquard_common::types::value::Data<'a>>>, 5301 + ) -> Self { 5302 + self.__unsafe_private_named.3 = value.into(); 5303 + self 5304 + } 5305 + /// Set the `debug` field to an Option value (optional) 5306 + pub fn maybe_debug( 5307 + mut self, 5308 + value: Option<jacquard_common::types::value::Data<'a>>, 5309 + ) -> Self { 5310 + self.__unsafe_private_named.3 = value; 5311 + self 5312 + } 5313 + } 5314 + 5245 5315 impl<'a, S> ProfileViewBasicBuilder<'a, S> 5246 5316 where 5247 5317 S: profile_view_basic_state::State, ··· 5252 5322 mut self, 5253 5323 value: impl Into<jacquard_common::types::string::Did<'a>>, 5254 5324 ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetDid<S>> { 5255 - self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 5325 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 5256 5326 ProfileViewBasicBuilder { 5257 5327 _phantom_state: ::core::marker::PhantomData, 5258 5328 __unsafe_private_named: self.__unsafe_private_named, ··· 5267 5337 mut self, 5268 5338 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 5269 5339 ) -> Self { 5270 - self.__unsafe_private_named.4 = value.into(); 5340 + self.__unsafe_private_named.5 = value.into(); 5271 5341 self 5272 5342 } 5273 5343 /// Set the `displayName` field to an Option value (optional) ··· 5275 5345 mut self, 5276 5346 value: Option<jacquard_common::CowStr<'a>>, 5277 5347 ) -> Self { 5278 - self.__unsafe_private_named.4 = value; 5348 + self.__unsafe_private_named.5 = value; 5279 5349 self 5280 5350 } 5281 5351 } ··· 5290 5360 mut self, 5291 5361 value: impl Into<jacquard_common::types::string::Handle<'a>>, 5292 5362 ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetHandle<S>> { 5293 - self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 5363 + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 5294 5364 ProfileViewBasicBuilder { 5295 5365 _phantom_state: ::core::marker::PhantomData, 5296 5366 __unsafe_private_named: self.__unsafe_private_named, ··· 5305 5375 mut self, 5306 5376 value: impl Into<Option<Vec<crate::com_atproto::label::Label<'a>>>>, 5307 5377 ) -> Self { 5308 - self.__unsafe_private_named.6 = value.into(); 5378 + self.__unsafe_private_named.7 = value.into(); 5309 5379 self 5310 5380 } 5311 5381 /// Set the `labels` field to an Option value (optional) ··· 5313 5383 mut self, 5314 5384 value: Option<Vec<crate::com_atproto::label::Label<'a>>>, 5315 5385 ) -> Self { 5316 - self.__unsafe_private_named.6 = value; 5386 + self.__unsafe_private_named.7 = value; 5317 5387 self 5318 5388 } 5319 5389 } ··· 5324 5394 mut self, 5325 5395 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 5326 5396 ) -> Self { 5327 - self.__unsafe_private_named.7 = value.into(); 5397 + self.__unsafe_private_named.8 = value.into(); 5328 5398 self 5329 5399 } 5330 5400 /// Set the `pronouns` field to an Option value (optional) 5331 5401 pub fn maybe_pronouns(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 5332 - self.__unsafe_private_named.7 = value; 5402 + self.__unsafe_private_named.8 = value; 5333 5403 self 5334 5404 } 5335 5405 } ··· 5340 5410 mut self, 5341 5411 value: impl Into<Option<crate::app_bsky::actor::StatusView<'a>>>, 5342 5412 ) -> Self { 5343 - self.__unsafe_private_named.8 = value.into(); 5413 + self.__unsafe_private_named.9 = value.into(); 5344 5414 self 5345 5415 } 5346 5416 /// Set the `status` field to an Option value (optional) ··· 5348 5418 mut self, 5349 5419 value: Option<crate::app_bsky::actor::StatusView<'a>>, 5350 5420 ) -> Self { 5351 - self.__unsafe_private_named.8 = value; 5421 + self.__unsafe_private_named.9 = value; 5352 5422 self 5353 5423 } 5354 5424 } ··· 5359 5429 mut self, 5360 5430 value: impl Into<Option<crate::app_bsky::actor::VerificationState<'a>>>, 5361 5431 ) -> Self { 5362 - self.__unsafe_private_named.9 = value.into(); 5432 + self.__unsafe_private_named.10 = value.into(); 5363 5433 self 5364 5434 } 5365 5435 /// Set the `verification` field to an Option value (optional) ··· 5367 5437 mut self, 5368 5438 value: Option<crate::app_bsky::actor::VerificationState<'a>>, 5369 5439 ) -> Self { 5370 - self.__unsafe_private_named.9 = value; 5440 + self.__unsafe_private_named.10 = value; 5371 5441 self 5372 5442 } 5373 5443 } ··· 5378 5448 mut self, 5379 5449 value: impl Into<Option<crate::app_bsky::actor::ViewerState<'a>>>, 5380 5450 ) -> Self { 5381 - self.__unsafe_private_named.10 = value.into(); 5451 + self.__unsafe_private_named.11 = value.into(); 5382 5452 self 5383 5453 } 5384 5454 /// Set the `viewer` field to an Option value (optional) ··· 5386 5456 mut self, 5387 5457 value: Option<crate::app_bsky::actor::ViewerState<'a>>, 5388 5458 ) -> Self { 5389 - self.__unsafe_private_named.10 = value; 5459 + self.__unsafe_private_named.11 = value; 5390 5460 self 5391 5461 } 5392 5462 } ··· 5403 5473 associated: self.__unsafe_private_named.0, 5404 5474 avatar: self.__unsafe_private_named.1, 5405 5475 created_at: self.__unsafe_private_named.2, 5406 - did: self.__unsafe_private_named.3.unwrap(), 5407 - display_name: self.__unsafe_private_named.4, 5408 - handle: self.__unsafe_private_named.5.unwrap(), 5409 - labels: self.__unsafe_private_named.6, 5410 - pronouns: self.__unsafe_private_named.7, 5411 - status: self.__unsafe_private_named.8, 5412 - verification: self.__unsafe_private_named.9, 5413 - viewer: self.__unsafe_private_named.10, 5476 + debug: self.__unsafe_private_named.3, 5477 + did: self.__unsafe_private_named.4.unwrap(), 5478 + display_name: self.__unsafe_private_named.5, 5479 + handle: self.__unsafe_private_named.6.unwrap(), 5480 + labels: self.__unsafe_private_named.7, 5481 + pronouns: self.__unsafe_private_named.8, 5482 + status: self.__unsafe_private_named.9, 5483 + verification: self.__unsafe_private_named.10, 5484 + viewer: self.__unsafe_private_named.11, 5414 5485 extra_data: Default::default(), 5415 5486 } 5416 5487 } ··· 5426 5497 associated: self.__unsafe_private_named.0, 5427 5498 avatar: self.__unsafe_private_named.1, 5428 5499 created_at: self.__unsafe_private_named.2, 5429 - did: self.__unsafe_private_named.3.unwrap(), 5430 - display_name: self.__unsafe_private_named.4, 5431 - handle: self.__unsafe_private_named.5.unwrap(), 5432 - labels: self.__unsafe_private_named.6, 5433 - pronouns: self.__unsafe_private_named.7, 5434 - status: self.__unsafe_private_named.8, 5435 - verification: self.__unsafe_private_named.9, 5436 - viewer: self.__unsafe_private_named.10, 5500 + debug: self.__unsafe_private_named.3, 5501 + did: self.__unsafe_private_named.4.unwrap(), 5502 + display_name: self.__unsafe_private_named.5, 5503 + handle: self.__unsafe_private_named.6.unwrap(), 5504 + labels: self.__unsafe_private_named.7, 5505 + pronouns: self.__unsafe_private_named.8, 5506 + status: self.__unsafe_private_named.9, 5507 + verification: self.__unsafe_private_named.10, 5508 + viewer: self.__unsafe_private_named.11, 5437 5509 extra_data: Some(extra_data), 5438 5510 } 5439 5511 } ··· 5509 5581 pub banner: Option<jacquard_common::types::string::Uri<'a>>, 5510 5582 #[serde(skip_serializing_if = "std::option::Option::is_none")] 5511 5583 pub created_at: Option<jacquard_common::types::string::Datetime>, 5584 + /// Debug information for internal development 5585 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 5586 + #[serde(borrow)] 5587 + pub debug: Option<jacquard_common::types::value::Data<'a>>, 5512 5588 #[serde(skip_serializing_if = "std::option::Option::is_none")] 5513 5589 #[serde(borrow)] 5514 5590 pub description: Option<jacquard_common::CowStr<'a>>, ··· 5607 5683 ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 5608 5684 ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 5609 5685 ::core::option::Option<jacquard_common::types::string::Datetime>, 5686 + ::core::option::Option<jacquard_common::types::value::Data<'a>>, 5610 5687 ::core::option::Option<jacquard_common::CowStr<'a>>, 5611 5688 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 5612 5689 ::core::option::Option<jacquard_common::CowStr<'a>>, ··· 5640 5717 ProfileViewDetailedBuilder { 5641 5718 _phantom_state: ::core::marker::PhantomData, 5642 5719 __unsafe_private_named: ( 5720 + None, 5643 5721 None, 5644 5722 None, 5645 5723 None, ··· 5743 5821 } 5744 5822 5745 5823 impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { 5824 + /// Set the `debug` field (optional) 5825 + pub fn debug( 5826 + mut self, 5827 + value: impl Into<Option<jacquard_common::types::value::Data<'a>>>, 5828 + ) -> Self { 5829 + self.__unsafe_private_named.4 = value.into(); 5830 + self 5831 + } 5832 + /// Set the `debug` field to an Option value (optional) 5833 + pub fn maybe_debug( 5834 + mut self, 5835 + value: Option<jacquard_common::types::value::Data<'a>>, 5836 + ) -> Self { 5837 + self.__unsafe_private_named.4 = value; 5838 + self 5839 + } 5840 + } 5841 + 5842 + impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { 5746 5843 /// Set the `description` field (optional) 5747 5844 pub fn description( 5748 5845 mut self, 5749 5846 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 5750 5847 ) -> Self { 5751 - self.__unsafe_private_named.4 = value.into(); 5848 + self.__unsafe_private_named.5 = value.into(); 5752 5849 self 5753 5850 } 5754 5851 /// Set the `description` field to an Option value (optional) ··· 5756 5853 mut self, 5757 5854 value: Option<jacquard_common::CowStr<'a>>, 5758 5855 ) -> Self { 5759 - self.__unsafe_private_named.4 = value; 5856 + self.__unsafe_private_named.5 = value; 5760 5857 self 5761 5858 } 5762 5859 } ··· 5771 5868 mut self, 5772 5869 value: impl Into<jacquard_common::types::string::Did<'a>>, 5773 5870 ) -> ProfileViewDetailedBuilder<'a, profile_view_detailed_state::SetDid<S>> { 5774 - self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 5871 + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 5775 5872 ProfileViewDetailedBuilder { 5776 5873 _phantom_state: ::core::marker::PhantomData, 5777 5874 __unsafe_private_named: self.__unsafe_private_named, ··· 5786 5883 mut self, 5787 5884 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 5788 5885 ) -> Self { 5789 - self.__unsafe_private_named.6 = value.into(); 5886 + self.__unsafe_private_named.7 = value.into(); 5790 5887 self 5791 5888 } 5792 5889 /// Set the `displayName` field to an Option value (optional) ··· 5794 5891 mut self, 5795 5892 value: Option<jacquard_common::CowStr<'a>>, 5796 5893 ) -> Self { 5797 - self.__unsafe_private_named.6 = value; 5894 + self.__unsafe_private_named.7 = value; 5798 5895 self 5799 5896 } 5800 5897 } ··· 5802 5899 impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { 5803 5900 /// Set the `followersCount` field (optional) 5804 5901 pub fn followers_count(mut self, value: impl Into<Option<i64>>) -> Self { 5805 - self.__unsafe_private_named.7 = value.into(); 5902 + self.__unsafe_private_named.8 = value.into(); 5806 5903 self 5807 5904 } 5808 5905 /// Set the `followersCount` field to an Option value (optional) 5809 5906 pub fn maybe_followers_count(mut self, value: Option<i64>) -> Self { 5810 - self.__unsafe_private_named.7 = value; 5907 + self.__unsafe_private_named.8 = value; 5811 5908 self 5812 5909 } 5813 5910 } ··· 5815 5912 impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { 5816 5913 /// Set the `followsCount` field (optional) 5817 5914 pub fn follows_count(mut self, value: impl Into<Option<i64>>) -> Self { 5818 - self.__unsafe_private_named.8 = value.into(); 5915 + self.__unsafe_private_named.9 = value.into(); 5819 5916 self 5820 5917 } 5821 5918 /// Set the `followsCount` field to an Option value (optional) 5822 5919 pub fn maybe_follows_count(mut self, value: Option<i64>) -> Self { 5823 - self.__unsafe_private_named.8 = value; 5920 + self.__unsafe_private_named.9 = value; 5824 5921 self 5825 5922 } 5826 5923 } ··· 5835 5932 mut self, 5836 5933 value: impl Into<jacquard_common::types::string::Handle<'a>>, 5837 5934 ) -> ProfileViewDetailedBuilder<'a, profile_view_detailed_state::SetHandle<S>> { 5838 - self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); 5935 + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); 5839 5936 ProfileViewDetailedBuilder { 5840 5937 _phantom_state: ::core::marker::PhantomData, 5841 5938 __unsafe_private_named: self.__unsafe_private_named, ··· 5850 5947 mut self, 5851 5948 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 5852 5949 ) -> Self { 5853 - self.__unsafe_private_named.10 = value.into(); 5950 + self.__unsafe_private_named.11 = value.into(); 5854 5951 self 5855 5952 } 5856 5953 /// Set the `indexedAt` field to an Option value (optional) ··· 5858 5955 mut self, 5859 5956 value: Option<jacquard_common::types::string::Datetime>, 5860 5957 ) -> Self { 5861 - self.__unsafe_private_named.10 = value; 5958 + self.__unsafe_private_named.11 = value; 5862 5959 self 5863 5960 } 5864 5961 } ··· 5869 5966 mut self, 5870 5967 value: impl Into<Option<crate::app_bsky::graph::StarterPackViewBasic<'a>>>, 5871 5968 ) -> Self { 5872 - self.__unsafe_private_named.11 = value.into(); 5969 + self.__unsafe_private_named.12 = value.into(); 5873 5970 self 5874 5971 } 5875 5972 /// Set the `joinedViaStarterPack` field to an Option value (optional) ··· 5877 5974 mut self, 5878 5975 value: Option<crate::app_bsky::graph::StarterPackViewBasic<'a>>, 5879 5976 ) -> Self { 5880 - self.__unsafe_private_named.11 = value; 5977 + self.__unsafe_private_named.12 = value; 5881 5978 self 5882 5979 } 5883 5980 } ··· 5888 5985 mut self, 5889 5986 value: impl Into<Option<Vec<crate::com_atproto::label::Label<'a>>>>, 5890 5987 ) -> Self { 5891 - self.__unsafe_private_named.12 = value.into(); 5988 + self.__unsafe_private_named.13 = value.into(); 5892 5989 self 5893 5990 } 5894 5991 /// Set the `labels` field to an Option value (optional) ··· 5896 5993 mut self, 5897 5994 value: Option<Vec<crate::com_atproto::label::Label<'a>>>, 5898 5995 ) -> Self { 5899 - self.__unsafe_private_named.12 = value; 5996 + self.__unsafe_private_named.13 = value; 5900 5997 self 5901 5998 } 5902 5999 } ··· 5907 6004 mut self, 5908 6005 value: impl Into<Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>, 5909 6006 ) -> Self { 5910 - self.__unsafe_private_named.13 = value.into(); 6007 + self.__unsafe_private_named.14 = value.into(); 5911 6008 self 5912 6009 } 5913 6010 /// Set the `pinnedPost` field to an Option value (optional) ··· 5915 6012 mut self, 5916 6013 value: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 5917 6014 ) -> Self { 5918 - self.__unsafe_private_named.13 = value; 6015 + self.__unsafe_private_named.14 = value; 5919 6016 self 5920 6017 } 5921 6018 } ··· 5923 6020 impl<'a, S: profile_view_detailed_state::State> ProfileViewDetailedBuilder<'a, S> { 5924 6021 /// Set the `postsCount` field (optional) 5925 6022 pub fn posts_count(mut self, value: impl Into<Option<i64>>) -> Self { 5926 - self.__unsafe_private_named.14 = value.into(); 6023 + self.__unsafe_private_named.15 = value.into(); 5927 6024 self 5928 6025 } 5929 6026 /// Set the `postsCount` field to an Option value (optional) 5930 6027 pub fn maybe_posts_count(mut self, value: Option<i64>) -> Self { 5931 - self.__unsafe_private_named.14 = value; 6028 + self.__unsafe_private_named.15 = value; 5932 6029 self 5933 6030 } 5934 6031 } ··· 5939 6036 mut self, 5940 6037 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 5941 6038 ) -> Self { 5942 - self.__unsafe_private_named.15 = value.into(); 6039 + self.__unsafe_private_named.16 = value.into(); 5943 6040 self 5944 6041 } 5945 6042 /// Set the `pronouns` field to an Option value (optional) 5946 6043 pub fn maybe_pronouns(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 5947 - self.__unsafe_private_named.15 = value; 6044 + self.__unsafe_private_named.16 = value; 5948 6045 self 5949 6046 } 5950 6047 } ··· 5955 6052 mut self, 5956 6053 value: impl Into<Option<crate::app_bsky::actor::StatusView<'a>>>, 5957 6054 ) -> Self { 5958 - self.__unsafe_private_named.16 = value.into(); 6055 + self.__unsafe_private_named.17 = value.into(); 5959 6056 self 5960 6057 } 5961 6058 /// Set the `status` field to an Option value (optional) ··· 5963 6060 mut self, 5964 6061 value: Option<crate::app_bsky::actor::StatusView<'a>>, 5965 6062 ) -> Self { 5966 - self.__unsafe_private_named.16 = value; 6063 + self.__unsafe_private_named.17 = value; 5967 6064 self 5968 6065 } 5969 6066 } ··· 5974 6071 mut self, 5975 6072 value: impl Into<Option<crate::app_bsky::actor::VerificationState<'a>>>, 5976 6073 ) -> Self { 5977 - self.__unsafe_private_named.17 = value.into(); 6074 + self.__unsafe_private_named.18 = value.into(); 5978 6075 self 5979 6076 } 5980 6077 /// Set the `verification` field to an Option value (optional) ··· 5982 6079 mut self, 5983 6080 value: Option<crate::app_bsky::actor::VerificationState<'a>>, 5984 6081 ) -> Self { 5985 - self.__unsafe_private_named.17 = value; 6082 + self.__unsafe_private_named.18 = value; 5986 6083 self 5987 6084 } 5988 6085 } ··· 5993 6090 mut self, 5994 6091 value: impl Into<Option<crate::app_bsky::actor::ViewerState<'a>>>, 5995 6092 ) -> Self { 5996 - self.__unsafe_private_named.18 = value.into(); 6093 + self.__unsafe_private_named.19 = value.into(); 5997 6094 self 5998 6095 } 5999 6096 /// Set the `viewer` field to an Option value (optional) ··· 6001 6098 mut self, 6002 6099 value: Option<crate::app_bsky::actor::ViewerState<'a>>, 6003 6100 ) -> Self { 6004 - self.__unsafe_private_named.18 = value; 6101 + self.__unsafe_private_named.19 = value; 6005 6102 self 6006 6103 } 6007 6104 } ··· 6012 6109 mut self, 6013 6110 value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 6014 6111 ) -> Self { 6015 - self.__unsafe_private_named.19 = value.into(); 6112 + self.__unsafe_private_named.20 = value.into(); 6016 6113 self 6017 6114 } 6018 6115 /// Set the `website` field to an Option value (optional) ··· 6020 6117 mut self, 6021 6118 value: Option<jacquard_common::types::string::Uri<'a>>, 6022 6119 ) -> Self { 6023 - self.__unsafe_private_named.19 = value; 6120 + self.__unsafe_private_named.20 = value; 6024 6121 self 6025 6122 } 6026 6123 } ··· 6038 6135 avatar: self.__unsafe_private_named.1, 6039 6136 banner: self.__unsafe_private_named.2, 6040 6137 created_at: self.__unsafe_private_named.3, 6041 - description: self.__unsafe_private_named.4, 6042 - did: self.__unsafe_private_named.5.unwrap(), 6043 - display_name: self.__unsafe_private_named.6, 6044 - followers_count: self.__unsafe_private_named.7, 6045 - follows_count: self.__unsafe_private_named.8, 6046 - handle: self.__unsafe_private_named.9.unwrap(), 6047 - indexed_at: self.__unsafe_private_named.10, 6048 - joined_via_starter_pack: self.__unsafe_private_named.11, 6049 - labels: self.__unsafe_private_named.12, 6050 - pinned_post: self.__unsafe_private_named.13, 6051 - posts_count: self.__unsafe_private_named.14, 6052 - pronouns: self.__unsafe_private_named.15, 6053 - status: self.__unsafe_private_named.16, 6054 - verification: self.__unsafe_private_named.17, 6055 - viewer: self.__unsafe_private_named.18, 6056 - website: self.__unsafe_private_named.19, 6138 + debug: self.__unsafe_private_named.4, 6139 + description: self.__unsafe_private_named.5, 6140 + did: self.__unsafe_private_named.6.unwrap(), 6141 + display_name: self.__unsafe_private_named.7, 6142 + followers_count: self.__unsafe_private_named.8, 6143 + follows_count: self.__unsafe_private_named.9, 6144 + handle: self.__unsafe_private_named.10.unwrap(), 6145 + indexed_at: self.__unsafe_private_named.11, 6146 + joined_via_starter_pack: self.__unsafe_private_named.12, 6147 + labels: self.__unsafe_private_named.13, 6148 + pinned_post: self.__unsafe_private_named.14, 6149 + posts_count: self.__unsafe_private_named.15, 6150 + pronouns: self.__unsafe_private_named.16, 6151 + status: self.__unsafe_private_named.17, 6152 + verification: self.__unsafe_private_named.18, 6153 + viewer: self.__unsafe_private_named.19, 6154 + website: self.__unsafe_private_named.20, 6057 6155 extra_data: Default::default(), 6058 6156 } 6059 6157 } ··· 6070 6168 avatar: self.__unsafe_private_named.1, 6071 6169 banner: self.__unsafe_private_named.2, 6072 6170 created_at: self.__unsafe_private_named.3, 6073 - description: self.__unsafe_private_named.4, 6074 - did: self.__unsafe_private_named.5.unwrap(), 6075 - display_name: self.__unsafe_private_named.6, 6076 - followers_count: self.__unsafe_private_named.7, 6077 - follows_count: self.__unsafe_private_named.8, 6078 - handle: self.__unsafe_private_named.9.unwrap(), 6079 - indexed_at: self.__unsafe_private_named.10, 6080 - joined_via_starter_pack: self.__unsafe_private_named.11, 6081 - labels: self.__unsafe_private_named.12, 6082 - pinned_post: self.__unsafe_private_named.13, 6083 - posts_count: self.__unsafe_private_named.14, 6084 - pronouns: self.__unsafe_private_named.15, 6085 - status: self.__unsafe_private_named.16, 6086 - verification: self.__unsafe_private_named.17, 6087 - viewer: self.__unsafe_private_named.18, 6088 - website: self.__unsafe_private_named.19, 6171 + debug: self.__unsafe_private_named.4, 6172 + description: self.__unsafe_private_named.5, 6173 + did: self.__unsafe_private_named.6.unwrap(), 6174 + display_name: self.__unsafe_private_named.7, 6175 + followers_count: self.__unsafe_private_named.8, 6176 + follows_count: self.__unsafe_private_named.9, 6177 + handle: self.__unsafe_private_named.10.unwrap(), 6178 + indexed_at: self.__unsafe_private_named.11, 6179 + joined_via_starter_pack: self.__unsafe_private_named.12, 6180 + labels: self.__unsafe_private_named.13, 6181 + pinned_post: self.__unsafe_private_named.14, 6182 + posts_count: self.__unsafe_private_named.15, 6183 + pronouns: self.__unsafe_private_named.16, 6184 + status: self.__unsafe_private_named.17, 6185 + verification: self.__unsafe_private_named.18, 6186 + viewer: self.__unsafe_private_named.19, 6187 + website: self.__unsafe_private_named.20, 6089 6188 extra_data: Some(extra_data), 6090 6189 } 6091 6190 }
+74 -41
crates/jacquard-api/src/app_bsky/feed.rs
··· 878 878 }), 879 879 ); 880 880 map.insert( 881 + ::jacquard_common::smol_str::SmolStr::new_static("debug"), 882 + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 883 + description: None, 884 + }), 885 + ); 886 + map.insert( 881 887 ::jacquard_common::smol_str::SmolStr::new_static("embed"), 882 888 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 883 889 description: None, ··· 3158 3164 pub bookmark_count: Option<i64>, 3159 3165 #[serde(borrow)] 3160 3166 pub cid: jacquard_common::types::string::Cid<'a>, 3167 + /// Debug information for internal development 3168 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 3169 + #[serde(borrow)] 3170 + pub debug: Option<jacquard_common::types::value::Data<'a>>, 3161 3171 #[serde(skip_serializing_if = "std::option::Option::is_none")] 3162 3172 #[serde(borrow)] 3163 3173 pub embed: Option<PostViewEmbed<'a>>, ··· 3284 3294 ::core::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>, 3285 3295 ::core::option::Option<i64>, 3286 3296 ::core::option::Option<jacquard_common::types::string::Cid<'a>>, 3297 + ::core::option::Option<jacquard_common::types::value::Data<'a>>, 3287 3298 ::core::option::Option<PostViewEmbed<'a>>, 3288 3299 ::core::option::Option<jacquard_common::types::string::Datetime>, 3289 3300 ::core::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, ··· 3312 3323 PostViewBuilder { 3313 3324 _phantom_state: ::core::marker::PhantomData, 3314 3325 __unsafe_private_named: ( 3326 + None, 3315 3327 None, 3316 3328 None, 3317 3329 None, ··· 3384 3396 } 3385 3397 3386 3398 impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { 3399 + /// Set the `debug` field (optional) 3400 + pub fn debug( 3401 + mut self, 3402 + value: impl Into<Option<jacquard_common::types::value::Data<'a>>>, 3403 + ) -> Self { 3404 + self.__unsafe_private_named.3 = value.into(); 3405 + self 3406 + } 3407 + /// Set the `debug` field to an Option value (optional) 3408 + pub fn maybe_debug( 3409 + mut self, 3410 + value: Option<jacquard_common::types::value::Data<'a>>, 3411 + ) -> Self { 3412 + self.__unsafe_private_named.3 = value; 3413 + self 3414 + } 3415 + } 3416 + 3417 + impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { 3387 3418 /// Set the `embed` field (optional) 3388 3419 pub fn embed(mut self, value: impl Into<Option<PostViewEmbed<'a>>>) -> Self { 3389 - self.__unsafe_private_named.3 = value.into(); 3420 + self.__unsafe_private_named.4 = value.into(); 3390 3421 self 3391 3422 } 3392 3423 /// Set the `embed` field to an Option value (optional) 3393 3424 pub fn maybe_embed(mut self, value: Option<PostViewEmbed<'a>>) -> Self { 3394 - self.__unsafe_private_named.3 = value; 3425 + self.__unsafe_private_named.4 = value; 3395 3426 self 3396 3427 } 3397 3428 } ··· 3406 3437 mut self, 3407 3438 value: impl Into<jacquard_common::types::string::Datetime>, 3408 3439 ) -> PostViewBuilder<'a, post_view_state::SetIndexedAt<S>> { 3409 - self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 3440 + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 3410 3441 PostViewBuilder { 3411 3442 _phantom_state: ::core::marker::PhantomData, 3412 3443 __unsafe_private_named: self.__unsafe_private_named, ··· 3421 3452 mut self, 3422 3453 value: impl Into<Option<Vec<crate::com_atproto::label::Label<'a>>>>, 3423 3454 ) -> Self { 3424 - self.__unsafe_private_named.5 = value.into(); 3455 + self.__unsafe_private_named.6 = value.into(); 3425 3456 self 3426 3457 } 3427 3458 /// Set the `labels` field to an Option value (optional) ··· 3429 3460 mut self, 3430 3461 value: Option<Vec<crate::com_atproto::label::Label<'a>>>, 3431 3462 ) -> Self { 3432 - self.__unsafe_private_named.5 = value; 3463 + self.__unsafe_private_named.6 = value; 3433 3464 self 3434 3465 } 3435 3466 } ··· 3437 3468 impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { 3438 3469 /// Set the `likeCount` field (optional) 3439 3470 pub fn like_count(mut self, value: impl Into<Option<i64>>) -> Self { 3440 - self.__unsafe_private_named.6 = value.into(); 3471 + self.__unsafe_private_named.7 = value.into(); 3441 3472 self 3442 3473 } 3443 3474 /// Set the `likeCount` field to an Option value (optional) 3444 3475 pub fn maybe_like_count(mut self, value: Option<i64>) -> Self { 3445 - self.__unsafe_private_named.6 = value; 3476 + self.__unsafe_private_named.7 = value; 3446 3477 self 3447 3478 } 3448 3479 } ··· 3450 3481 impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { 3451 3482 /// Set the `quoteCount` field (optional) 3452 3483 pub fn quote_count(mut self, value: impl Into<Option<i64>>) -> Self { 3453 - self.__unsafe_private_named.7 = value.into(); 3484 + self.__unsafe_private_named.8 = value.into(); 3454 3485 self 3455 3486 } 3456 3487 /// Set the `quoteCount` field to an Option value (optional) 3457 3488 pub fn maybe_quote_count(mut self, value: Option<i64>) -> Self { 3458 - self.__unsafe_private_named.7 = value; 3489 + self.__unsafe_private_named.8 = value; 3459 3490 self 3460 3491 } 3461 3492 } ··· 3470 3501 mut self, 3471 3502 value: impl Into<jacquard_common::types::value::Data<'a>>, 3472 3503 ) -> PostViewBuilder<'a, post_view_state::SetRecord<S>> { 3473 - self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); 3504 + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); 3474 3505 PostViewBuilder { 3475 3506 _phantom_state: ::core::marker::PhantomData, 3476 3507 __unsafe_private_named: self.__unsafe_private_named, ··· 3482 3513 impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { 3483 3514 /// Set the `replyCount` field (optional) 3484 3515 pub fn reply_count(mut self, value: impl Into<Option<i64>>) -> Self { 3485 - self.__unsafe_private_named.9 = value.into(); 3516 + self.__unsafe_private_named.10 = value.into(); 3486 3517 self 3487 3518 } 3488 3519 /// Set the `replyCount` field to an Option value (optional) 3489 3520 pub fn maybe_reply_count(mut self, value: Option<i64>) -> Self { 3490 - self.__unsafe_private_named.9 = value; 3521 + self.__unsafe_private_named.10 = value; 3491 3522 self 3492 3523 } 3493 3524 } ··· 3495 3526 impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { 3496 3527 /// Set the `repostCount` field (optional) 3497 3528 pub fn repost_count(mut self, value: impl Into<Option<i64>>) -> Self { 3498 - self.__unsafe_private_named.10 = value.into(); 3529 + self.__unsafe_private_named.11 = value.into(); 3499 3530 self 3500 3531 } 3501 3532 /// Set the `repostCount` field to an Option value (optional) 3502 3533 pub fn maybe_repost_count(mut self, value: Option<i64>) -> Self { 3503 - self.__unsafe_private_named.10 = value; 3534 + self.__unsafe_private_named.11 = value; 3504 3535 self 3505 3536 } 3506 3537 } ··· 3511 3542 mut self, 3512 3543 value: impl Into<Option<crate::app_bsky::feed::ThreadgateView<'a>>>, 3513 3544 ) -> Self { 3514 - self.__unsafe_private_named.11 = value.into(); 3545 + self.__unsafe_private_named.12 = value.into(); 3515 3546 self 3516 3547 } 3517 3548 /// Set the `threadgate` field to an Option value (optional) ··· 3519 3550 mut self, 3520 3551 value: Option<crate::app_bsky::feed::ThreadgateView<'a>>, 3521 3552 ) -> Self { 3522 - self.__unsafe_private_named.11 = value; 3553 + self.__unsafe_private_named.12 = value; 3523 3554 self 3524 3555 } 3525 3556 } ··· 3534 3565 mut self, 3535 3566 value: impl Into<jacquard_common::types::string::AtUri<'a>>, 3536 3567 ) -> PostViewBuilder<'a, post_view_state::SetUri<S>> { 3537 - self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into()); 3568 + self.__unsafe_private_named.13 = ::core::option::Option::Some(value.into()); 3538 3569 PostViewBuilder { 3539 3570 _phantom_state: ::core::marker::PhantomData, 3540 3571 __unsafe_private_named: self.__unsafe_private_named, ··· 3549 3580 mut self, 3550 3581 value: impl Into<Option<crate::app_bsky::feed::ViewerState<'a>>>, 3551 3582 ) -> Self { 3552 - self.__unsafe_private_named.13 = value.into(); 3583 + self.__unsafe_private_named.14 = value.into(); 3553 3584 self 3554 3585 } 3555 3586 /// Set the `viewer` field to an Option value (optional) ··· 3557 3588 mut self, 3558 3589 value: Option<crate::app_bsky::feed::ViewerState<'a>>, 3559 3590 ) -> Self { 3560 - self.__unsafe_private_named.13 = value; 3591 + self.__unsafe_private_named.14 = value; 3561 3592 self 3562 3593 } 3563 3594 } ··· 3577 3608 author: self.__unsafe_private_named.0.unwrap(), 3578 3609 bookmark_count: self.__unsafe_private_named.1, 3579 3610 cid: self.__unsafe_private_named.2.unwrap(), 3580 - embed: self.__unsafe_private_named.3, 3581 - indexed_at: self.__unsafe_private_named.4.unwrap(), 3582 - labels: self.__unsafe_private_named.5, 3583 - like_count: self.__unsafe_private_named.6, 3584 - quote_count: self.__unsafe_private_named.7, 3585 - record: self.__unsafe_private_named.8.unwrap(), 3586 - reply_count: self.__unsafe_private_named.9, 3587 - repost_count: self.__unsafe_private_named.10, 3588 - threadgate: self.__unsafe_private_named.11, 3589 - uri: self.__unsafe_private_named.12.unwrap(), 3590 - viewer: self.__unsafe_private_named.13, 3611 + debug: self.__unsafe_private_named.3, 3612 + embed: self.__unsafe_private_named.4, 3613 + indexed_at: self.__unsafe_private_named.5.unwrap(), 3614 + labels: self.__unsafe_private_named.6, 3615 + like_count: self.__unsafe_private_named.7, 3616 + quote_count: self.__unsafe_private_named.8, 3617 + record: self.__unsafe_private_named.9.unwrap(), 3618 + reply_count: self.__unsafe_private_named.10, 3619 + repost_count: self.__unsafe_private_named.11, 3620 + threadgate: self.__unsafe_private_named.12, 3621 + uri: self.__unsafe_private_named.13.unwrap(), 3622 + viewer: self.__unsafe_private_named.14, 3591 3623 extra_data: Default::default(), 3592 3624 } 3593 3625 } ··· 3603 3635 author: self.__unsafe_private_named.0.unwrap(), 3604 3636 bookmark_count: self.__unsafe_private_named.1, 3605 3637 cid: self.__unsafe_private_named.2.unwrap(), 3606 - embed: self.__unsafe_private_named.3, 3607 - indexed_at: self.__unsafe_private_named.4.unwrap(), 3608 - labels: self.__unsafe_private_named.5, 3609 - like_count: self.__unsafe_private_named.6, 3610 - quote_count: self.__unsafe_private_named.7, 3611 - record: self.__unsafe_private_named.8.unwrap(), 3612 - reply_count: self.__unsafe_private_named.9, 3613 - repost_count: self.__unsafe_private_named.10, 3614 - threadgate: self.__unsafe_private_named.11, 3615 - uri: self.__unsafe_private_named.12.unwrap(), 3616 - viewer: self.__unsafe_private_named.13, 3638 + debug: self.__unsafe_private_named.3, 3639 + embed: self.__unsafe_private_named.4, 3640 + indexed_at: self.__unsafe_private_named.5.unwrap(), 3641 + labels: self.__unsafe_private_named.6, 3642 + like_count: self.__unsafe_private_named.7, 3643 + quote_count: self.__unsafe_private_named.8, 3644 + record: self.__unsafe_private_named.9.unwrap(), 3645 + reply_count: self.__unsafe_private_named.10, 3646 + repost_count: self.__unsafe_private_named.11, 3647 + threadgate: self.__unsafe_private_named.12, 3648 + uri: self.__unsafe_private_named.13.unwrap(), 3649 + viewer: self.__unsafe_private_named.14, 3617 3650 extra_data: Some(extra_data), 3618 3651 } 3619 3652 }
+35 -1
crates/jacquard-api/src/app_bsky/graph/follow.rs
··· 21 21 pub created_at: jacquard_common::types::string::Datetime, 22 22 #[serde(borrow)] 23 23 pub subject: jacquard_common::types::string::Did<'a>, 24 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 25 + #[serde(borrow)] 26 + pub via: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 24 27 } 25 28 26 29 pub mod follow_state { ··· 73 76 __unsafe_private_named: ( 74 77 ::core::option::Option<jacquard_common::types::string::Datetime>, 75 78 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 79 + ::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 76 80 ), 77 81 _phantom: ::core::marker::PhantomData<&'a ()>, 78 82 } ··· 89 93 pub fn new() -> Self { 90 94 FollowBuilder { 91 95 _phantom_state: ::core::marker::PhantomData, 92 - __unsafe_private_named: (None, None), 96 + __unsafe_private_named: (None, None, None), 93 97 _phantom: ::core::marker::PhantomData, 94 98 } 95 99 } ··· 133 137 } 134 138 } 135 139 140 + impl<'a, S: follow_state::State> FollowBuilder<'a, S> { 141 + /// Set the `via` field (optional) 142 + pub fn via( 143 + mut self, 144 + value: impl Into<Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>, 145 + ) -> Self { 146 + self.__unsafe_private_named.2 = value.into(); 147 + self 148 + } 149 + /// Set the `via` field to an Option value (optional) 150 + pub fn maybe_via( 151 + mut self, 152 + value: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 153 + ) -> Self { 154 + self.__unsafe_private_named.2 = value; 155 + self 156 + } 157 + } 158 + 136 159 impl<'a, S> FollowBuilder<'a, S> 137 160 where 138 161 S: follow_state::State, ··· 144 167 Follow { 145 168 created_at: self.__unsafe_private_named.0.unwrap(), 146 169 subject: self.__unsafe_private_named.1.unwrap(), 170 + via: self.__unsafe_private_named.2, 147 171 extra_data: Default::default(), 148 172 } 149 173 } ··· 158 182 Follow { 159 183 created_at: self.__unsafe_private_named.0.unwrap(), 160 184 subject: self.__unsafe_private_named.1.unwrap(), 185 + via: self.__unsafe_private_named.2, 161 186 extra_data: Some(extra_data), 162 187 } 163 188 } ··· 306 331 r#enum: None, 307 332 r#const: None, 308 333 known_values: None, 334 + }), 335 + ); 336 + map.insert( 337 + ::jacquard_common::smol_str::SmolStr::new_static("via"), 338 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 339 + description: None, 340 + r#ref: ::jacquard_common::CowStr::new_static( 341 + "com.atproto.repo.strongRef", 342 + ), 309 343 }), 310 344 ); 311 345 map
+10
crates/jacquard-api/src/computer_aesthetic.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // This file was automatically generated from Lexicon schemas. 4 + // Any manual changes will be overwritten on the next regeneration. 5 + 6 + pub mod kidlisp; 7 + pub mod mood; 8 + pub mod painting; 9 + pub mod piece; 10 + pub mod tape;
+486
crates/jacquard-api/src/computer_aesthetic/kidlisp.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: computer.aesthetic.kidlisp 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// A KidLisp code snippet from Aesthetic Computer 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, 12 + serde::Deserialize, 13 + Debug, 14 + Clone, 15 + PartialEq, 16 + Eq, 17 + jacquard_derive::IntoStatic 18 + )] 19 + #[serde(rename_all = "camelCase")] 20 + pub struct Kidlisp<'a> { 21 + /// Short alphanumeric code for easy lookup 22 + #[serde(borrow)] 23 + pub code: jacquard_common::CowStr<'a>, 24 + /// MongoDB ObjectId reference for bidirectional sync 25 + #[serde(borrow)] 26 + pub r#ref: jacquard_common::CowStr<'a>, 27 + /// The KidLisp source code 28 + #[serde(borrow)] 29 + pub source: jacquard_common::CowStr<'a>, 30 + /// Creation timestamp (ISO 8601) 31 + pub when: jacquard_common::types::string::Datetime, 32 + } 33 + 34 + pub mod kidlisp_state { 35 + 36 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 37 + #[allow(unused)] 38 + use ::core::marker::PhantomData; 39 + mod sealed { 40 + pub trait Sealed {} 41 + } 42 + /// State trait tracking which required fields have been set 43 + pub trait State: sealed::Sealed { 44 + type Source; 45 + type Code; 46 + type When; 47 + type Ref; 48 + } 49 + /// Empty state - all required fields are unset 50 + pub struct Empty(()); 51 + impl sealed::Sealed for Empty {} 52 + impl State for Empty { 53 + type Source = Unset; 54 + type Code = Unset; 55 + type When = Unset; 56 + type Ref = Unset; 57 + } 58 + ///State transition - sets the `source` field to Set 59 + pub struct SetSource<S: State = Empty>(PhantomData<fn() -> S>); 60 + impl<S: State> sealed::Sealed for SetSource<S> {} 61 + impl<S: State> State for SetSource<S> { 62 + type Source = Set<members::source>; 63 + type Code = S::Code; 64 + type When = S::When; 65 + type Ref = S::Ref; 66 + } 67 + ///State transition - sets the `code` field to Set 68 + pub struct SetCode<S: State = Empty>(PhantomData<fn() -> S>); 69 + impl<S: State> sealed::Sealed for SetCode<S> {} 70 + impl<S: State> State for SetCode<S> { 71 + type Source = S::Source; 72 + type Code = Set<members::code>; 73 + type When = S::When; 74 + type Ref = S::Ref; 75 + } 76 + ///State transition - sets the `when` field to Set 77 + pub struct SetWhen<S: State = Empty>(PhantomData<fn() -> S>); 78 + impl<S: State> sealed::Sealed for SetWhen<S> {} 79 + impl<S: State> State for SetWhen<S> { 80 + type Source = S::Source; 81 + type Code = S::Code; 82 + type When = Set<members::when>; 83 + type Ref = S::Ref; 84 + } 85 + ///State transition - sets the `ref` field to Set 86 + pub struct SetRef<S: State = Empty>(PhantomData<fn() -> S>); 87 + impl<S: State> sealed::Sealed for SetRef<S> {} 88 + impl<S: State> State for SetRef<S> { 89 + type Source = S::Source; 90 + type Code = S::Code; 91 + type When = S::When; 92 + type Ref = Set<members::r#ref>; 93 + } 94 + /// Marker types for field names 95 + #[allow(non_camel_case_types)] 96 + pub mod members { 97 + ///Marker type for the `source` field 98 + pub struct source(()); 99 + ///Marker type for the `code` field 100 + pub struct code(()); 101 + ///Marker type for the `when` field 102 + pub struct when(()); 103 + ///Marker type for the `ref` field 104 + pub struct r#ref(()); 105 + } 106 + } 107 + 108 + /// Builder for constructing an instance of this type 109 + pub struct KidlispBuilder<'a, S: kidlisp_state::State> { 110 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 111 + __unsafe_private_named: ( 112 + ::core::option::Option<jacquard_common::CowStr<'a>>, 113 + ::core::option::Option<jacquard_common::CowStr<'a>>, 114 + ::core::option::Option<jacquard_common::CowStr<'a>>, 115 + ::core::option::Option<jacquard_common::types::string::Datetime>, 116 + ), 117 + _phantom: ::core::marker::PhantomData<&'a ()>, 118 + } 119 + 120 + impl<'a> Kidlisp<'a> { 121 + /// Create a new builder for this type 122 + pub fn new() -> KidlispBuilder<'a, kidlisp_state::Empty> { 123 + KidlispBuilder::new() 124 + } 125 + } 126 + 127 + impl<'a> KidlispBuilder<'a, kidlisp_state::Empty> { 128 + /// Create a new builder with all fields unset 129 + pub fn new() -> Self { 130 + KidlispBuilder { 131 + _phantom_state: ::core::marker::PhantomData, 132 + __unsafe_private_named: (None, None, None, None), 133 + _phantom: ::core::marker::PhantomData, 134 + } 135 + } 136 + } 137 + 138 + impl<'a, S> KidlispBuilder<'a, S> 139 + where 140 + S: kidlisp_state::State, 141 + S::Code: kidlisp_state::IsUnset, 142 + { 143 + /// Set the `code` field (required) 144 + pub fn code( 145 + mut self, 146 + value: impl Into<jacquard_common::CowStr<'a>>, 147 + ) -> KidlispBuilder<'a, kidlisp_state::SetCode<S>> { 148 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 149 + KidlispBuilder { 150 + _phantom_state: ::core::marker::PhantomData, 151 + __unsafe_private_named: self.__unsafe_private_named, 152 + _phantom: ::core::marker::PhantomData, 153 + } 154 + } 155 + } 156 + 157 + impl<'a, S> KidlispBuilder<'a, S> 158 + where 159 + S: kidlisp_state::State, 160 + S::Ref: kidlisp_state::IsUnset, 161 + { 162 + /// Set the `ref` field (required) 163 + pub fn r#ref( 164 + mut self, 165 + value: impl Into<jacquard_common::CowStr<'a>>, 166 + ) -> KidlispBuilder<'a, kidlisp_state::SetRef<S>> { 167 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 168 + KidlispBuilder { 169 + _phantom_state: ::core::marker::PhantomData, 170 + __unsafe_private_named: self.__unsafe_private_named, 171 + _phantom: ::core::marker::PhantomData, 172 + } 173 + } 174 + } 175 + 176 + impl<'a, S> KidlispBuilder<'a, S> 177 + where 178 + S: kidlisp_state::State, 179 + S::Source: kidlisp_state::IsUnset, 180 + { 181 + /// Set the `source` field (required) 182 + pub fn source( 183 + mut self, 184 + value: impl Into<jacquard_common::CowStr<'a>>, 185 + ) -> KidlispBuilder<'a, kidlisp_state::SetSource<S>> { 186 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 187 + KidlispBuilder { 188 + _phantom_state: ::core::marker::PhantomData, 189 + __unsafe_private_named: self.__unsafe_private_named, 190 + _phantom: ::core::marker::PhantomData, 191 + } 192 + } 193 + } 194 + 195 + impl<'a, S> KidlispBuilder<'a, S> 196 + where 197 + S: kidlisp_state::State, 198 + S::When: kidlisp_state::IsUnset, 199 + { 200 + /// Set the `when` field (required) 201 + pub fn when( 202 + mut self, 203 + value: impl Into<jacquard_common::types::string::Datetime>, 204 + ) -> KidlispBuilder<'a, kidlisp_state::SetWhen<S>> { 205 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 206 + KidlispBuilder { 207 + _phantom_state: ::core::marker::PhantomData, 208 + __unsafe_private_named: self.__unsafe_private_named, 209 + _phantom: ::core::marker::PhantomData, 210 + } 211 + } 212 + } 213 + 214 + impl<'a, S> KidlispBuilder<'a, S> 215 + where 216 + S: kidlisp_state::State, 217 + S::Source: kidlisp_state::IsSet, 218 + S::Code: kidlisp_state::IsSet, 219 + S::When: kidlisp_state::IsSet, 220 + S::Ref: kidlisp_state::IsSet, 221 + { 222 + /// Build the final struct 223 + pub fn build(self) -> Kidlisp<'a> { 224 + Kidlisp { 225 + code: self.__unsafe_private_named.0.unwrap(), 226 + r#ref: self.__unsafe_private_named.1.unwrap(), 227 + source: self.__unsafe_private_named.2.unwrap(), 228 + when: self.__unsafe_private_named.3.unwrap(), 229 + extra_data: Default::default(), 230 + } 231 + } 232 + /// Build the final struct with custom extra_data 233 + pub fn build_with_data( 234 + self, 235 + extra_data: std::collections::BTreeMap< 236 + jacquard_common::smol_str::SmolStr, 237 + jacquard_common::types::value::Data<'a>, 238 + >, 239 + ) -> Kidlisp<'a> { 240 + Kidlisp { 241 + code: self.__unsafe_private_named.0.unwrap(), 242 + r#ref: self.__unsafe_private_named.1.unwrap(), 243 + source: self.__unsafe_private_named.2.unwrap(), 244 + when: self.__unsafe_private_named.3.unwrap(), 245 + extra_data: Some(extra_data), 246 + } 247 + } 248 + } 249 + 250 + impl<'a> Kidlisp<'a> { 251 + pub fn uri( 252 + uri: impl Into<jacquard_common::CowStr<'a>>, 253 + ) -> Result< 254 + jacquard_common::types::uri::RecordUri<'a, KidlispRecord>, 255 + jacquard_common::types::uri::UriError, 256 + > { 257 + jacquard_common::types::uri::RecordUri::try_from_uri( 258 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 259 + ) 260 + } 261 + } 262 + 263 + /// Typed wrapper for GetRecord response with this collection's record type. 264 + #[derive( 265 + serde::Serialize, 266 + serde::Deserialize, 267 + Debug, 268 + Clone, 269 + PartialEq, 270 + Eq, 271 + jacquard_derive::IntoStatic 272 + )] 273 + #[serde(rename_all = "camelCase")] 274 + pub struct KidlispGetRecordOutput<'a> { 275 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 276 + #[serde(borrow)] 277 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 278 + #[serde(borrow)] 279 + pub uri: jacquard_common::types::string::AtUri<'a>, 280 + #[serde(borrow)] 281 + pub value: Kidlisp<'a>, 282 + } 283 + 284 + impl From<KidlispGetRecordOutput<'_>> for Kidlisp<'_> { 285 + fn from(output: KidlispGetRecordOutput<'_>) -> Self { 286 + use jacquard_common::IntoStatic; 287 + output.value.into_static() 288 + } 289 + } 290 + 291 + impl jacquard_common::types::collection::Collection for Kidlisp<'_> { 292 + const NSID: &'static str = "computer.aesthetic.kidlisp"; 293 + type Record = KidlispRecord; 294 + } 295 + 296 + /// Marker type for deserializing records from this collection. 297 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 298 + pub struct KidlispRecord; 299 + impl jacquard_common::xrpc::XrpcResp for KidlispRecord { 300 + const NSID: &'static str = "computer.aesthetic.kidlisp"; 301 + const ENCODING: &'static str = "application/json"; 302 + type Output<'de> = KidlispGetRecordOutput<'de>; 303 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 304 + } 305 + 306 + impl jacquard_common::types::collection::Collection for KidlispRecord { 307 + const NSID: &'static str = "computer.aesthetic.kidlisp"; 308 + type Record = KidlispRecord; 309 + } 310 + 311 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Kidlisp<'a> { 312 + fn nsid() -> &'static str { 313 + "computer.aesthetic.kidlisp" 314 + } 315 + fn def_name() -> &'static str { 316 + "main" 317 + } 318 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 319 + lexicon_doc_computer_aesthetic_kidlisp() 320 + } 321 + fn validate( 322 + &self, 323 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 324 + { 325 + let value = &self.code; 326 + #[allow(unused_comparisons)] 327 + if <str>::len(value.as_ref()) > 10usize { 328 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 329 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 330 + "code", 331 + ), 332 + max: 10usize, 333 + actual: <str>::len(value.as_ref()), 334 + }); 335 + } 336 + } 337 + { 338 + let value = &self.r#ref; 339 + #[allow(unused_comparisons)] 340 + if <str>::len(value.as_ref()) > 24usize { 341 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 342 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 343 + "ref", 344 + ), 345 + max: 24usize, 346 + actual: <str>::len(value.as_ref()), 347 + }); 348 + } 349 + } 350 + { 351 + let value = &self.source; 352 + #[allow(unused_comparisons)] 353 + if <str>::len(value.as_ref()) > 50000usize { 354 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 355 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 356 + "source", 357 + ), 358 + max: 50000usize, 359 + actual: <str>::len(value.as_ref()), 360 + }); 361 + } 362 + } 363 + Ok(()) 364 + } 365 + } 366 + 367 + fn lexicon_doc_computer_aesthetic_kidlisp() -> ::jacquard_lexicon::lexicon::LexiconDoc< 368 + 'static, 369 + > { 370 + ::jacquard_lexicon::lexicon::LexiconDoc { 371 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 372 + id: ::jacquard_common::CowStr::new_static("computer.aesthetic.kidlisp"), 373 + revision: None, 374 + description: None, 375 + defs: { 376 + let mut map = ::std::collections::BTreeMap::new(); 377 + map.insert( 378 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 379 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 380 + description: Some( 381 + ::jacquard_common::CowStr::new_static( 382 + "A KidLisp code snippet from Aesthetic Computer", 383 + ), 384 + ), 385 + key: Some(::jacquard_common::CowStr::new_static("tid")), 386 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 387 + description: None, 388 + required: Some( 389 + vec![ 390 + ::jacquard_common::smol_str::SmolStr::new_static("source"), 391 + ::jacquard_common::smol_str::SmolStr::new_static("code"), 392 + ::jacquard_common::smol_str::SmolStr::new_static("when"), 393 + ::jacquard_common::smol_str::SmolStr::new_static("ref") 394 + ], 395 + ), 396 + nullable: None, 397 + properties: { 398 + #[allow(unused_mut)] 399 + let mut map = ::std::collections::BTreeMap::new(); 400 + map.insert( 401 + ::jacquard_common::smol_str::SmolStr::new_static("code"), 402 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 403 + description: Some( 404 + ::jacquard_common::CowStr::new_static( 405 + "Short alphanumeric code for easy lookup", 406 + ), 407 + ), 408 + format: None, 409 + default: None, 410 + min_length: None, 411 + max_length: Some(10usize), 412 + min_graphemes: None, 413 + max_graphemes: None, 414 + r#enum: None, 415 + r#const: None, 416 + known_values: None, 417 + }), 418 + ); 419 + map.insert( 420 + ::jacquard_common::smol_str::SmolStr::new_static("ref"), 421 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 422 + description: Some( 423 + ::jacquard_common::CowStr::new_static( 424 + "MongoDB ObjectId reference for bidirectional sync", 425 + ), 426 + ), 427 + format: None, 428 + default: None, 429 + min_length: None, 430 + max_length: Some(24usize), 431 + min_graphemes: None, 432 + max_graphemes: None, 433 + r#enum: None, 434 + r#const: None, 435 + known_values: None, 436 + }), 437 + ); 438 + map.insert( 439 + ::jacquard_common::smol_str::SmolStr::new_static("source"), 440 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 441 + description: Some( 442 + ::jacquard_common::CowStr::new_static( 443 + "The KidLisp source code", 444 + ), 445 + ), 446 + format: None, 447 + default: None, 448 + min_length: None, 449 + max_length: Some(50000usize), 450 + min_graphemes: None, 451 + max_graphemes: None, 452 + r#enum: None, 453 + r#const: None, 454 + known_values: None, 455 + }), 456 + ); 457 + map.insert( 458 + ::jacquard_common::smol_str::SmolStr::new_static("when"), 459 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 460 + description: Some( 461 + ::jacquard_common::CowStr::new_static( 462 + "Creation timestamp (ISO 8601)", 463 + ), 464 + ), 465 + format: Some( 466 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 467 + ), 468 + default: None, 469 + min_length: None, 470 + max_length: None, 471 + min_graphemes: None, 472 + max_graphemes: None, 473 + r#enum: None, 474 + r#const: None, 475 + known_values: None, 476 + }), 477 + ); 478 + map 479 + }, 480 + }), 481 + }), 482 + ); 483 + map 484 + }, 485 + } 486 + }
+398
crates/jacquard-api/src/computer_aesthetic/mood.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: computer.aesthetic.mood 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// A mood entry from Aesthetic Computer 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, 12 + serde::Deserialize, 13 + Debug, 14 + Clone, 15 + PartialEq, 16 + Eq, 17 + jacquard_derive::IntoStatic 18 + )] 19 + #[serde(rename_all = "camelCase")] 20 + pub struct Mood<'a> { 21 + /// The mood text content 22 + #[serde(borrow)] 23 + pub mood: jacquard_common::CowStr<'a>, 24 + /// Reference to source database record for bidirectional sync 25 + #[serde(borrow)] 26 + pub r#ref: jacquard_common::CowStr<'a>, 27 + /// When the mood was created (ISO 8601) 28 + pub when: jacquard_common::types::string::Datetime, 29 + } 30 + 31 + pub mod mood_state { 32 + 33 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 34 + #[allow(unused)] 35 + use ::core::marker::PhantomData; 36 + mod sealed { 37 + pub trait Sealed {} 38 + } 39 + /// State trait tracking which required fields have been set 40 + pub trait State: sealed::Sealed { 41 + type Mood; 42 + type When; 43 + type Ref; 44 + } 45 + /// Empty state - all required fields are unset 46 + pub struct Empty(()); 47 + impl sealed::Sealed for Empty {} 48 + impl State for Empty { 49 + type Mood = Unset; 50 + type When = Unset; 51 + type Ref = Unset; 52 + } 53 + ///State transition - sets the `mood` field to Set 54 + pub struct SetMood<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetMood<S> {} 56 + impl<S: State> State for SetMood<S> { 57 + type Mood = Set<members::mood>; 58 + type When = S::When; 59 + type Ref = S::Ref; 60 + } 61 + ///State transition - sets the `when` field to Set 62 + pub struct SetWhen<S: State = Empty>(PhantomData<fn() -> S>); 63 + impl<S: State> sealed::Sealed for SetWhen<S> {} 64 + impl<S: State> State for SetWhen<S> { 65 + type Mood = S::Mood; 66 + type When = Set<members::when>; 67 + type Ref = S::Ref; 68 + } 69 + ///State transition - sets the `ref` field to Set 70 + pub struct SetRef<S: State = Empty>(PhantomData<fn() -> S>); 71 + impl<S: State> sealed::Sealed for SetRef<S> {} 72 + impl<S: State> State for SetRef<S> { 73 + type Mood = S::Mood; 74 + type When = S::When; 75 + type Ref = Set<members::r#ref>; 76 + } 77 + /// Marker types for field names 78 + #[allow(non_camel_case_types)] 79 + pub mod members { 80 + ///Marker type for the `mood` field 81 + pub struct mood(()); 82 + ///Marker type for the `when` field 83 + pub struct when(()); 84 + ///Marker type for the `ref` field 85 + pub struct r#ref(()); 86 + } 87 + } 88 + 89 + /// Builder for constructing an instance of this type 90 + pub struct MoodBuilder<'a, S: mood_state::State> { 91 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 92 + __unsafe_private_named: ( 93 + ::core::option::Option<jacquard_common::CowStr<'a>>, 94 + ::core::option::Option<jacquard_common::CowStr<'a>>, 95 + ::core::option::Option<jacquard_common::types::string::Datetime>, 96 + ), 97 + _phantom: ::core::marker::PhantomData<&'a ()>, 98 + } 99 + 100 + impl<'a> Mood<'a> { 101 + /// Create a new builder for this type 102 + pub fn new() -> MoodBuilder<'a, mood_state::Empty> { 103 + MoodBuilder::new() 104 + } 105 + } 106 + 107 + impl<'a> MoodBuilder<'a, mood_state::Empty> { 108 + /// Create a new builder with all fields unset 109 + pub fn new() -> Self { 110 + MoodBuilder { 111 + _phantom_state: ::core::marker::PhantomData, 112 + __unsafe_private_named: (None, None, None), 113 + _phantom: ::core::marker::PhantomData, 114 + } 115 + } 116 + } 117 + 118 + impl<'a, S> MoodBuilder<'a, S> 119 + where 120 + S: mood_state::State, 121 + S::Mood: mood_state::IsUnset, 122 + { 123 + /// Set the `mood` field (required) 124 + pub fn mood( 125 + mut self, 126 + value: impl Into<jacquard_common::CowStr<'a>>, 127 + ) -> MoodBuilder<'a, mood_state::SetMood<S>> { 128 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 129 + MoodBuilder { 130 + _phantom_state: ::core::marker::PhantomData, 131 + __unsafe_private_named: self.__unsafe_private_named, 132 + _phantom: ::core::marker::PhantomData, 133 + } 134 + } 135 + } 136 + 137 + impl<'a, S> MoodBuilder<'a, S> 138 + where 139 + S: mood_state::State, 140 + S::Ref: mood_state::IsUnset, 141 + { 142 + /// Set the `ref` field (required) 143 + pub fn r#ref( 144 + mut self, 145 + value: impl Into<jacquard_common::CowStr<'a>>, 146 + ) -> MoodBuilder<'a, mood_state::SetRef<S>> { 147 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 148 + MoodBuilder { 149 + _phantom_state: ::core::marker::PhantomData, 150 + __unsafe_private_named: self.__unsafe_private_named, 151 + _phantom: ::core::marker::PhantomData, 152 + } 153 + } 154 + } 155 + 156 + impl<'a, S> MoodBuilder<'a, S> 157 + where 158 + S: mood_state::State, 159 + S::When: mood_state::IsUnset, 160 + { 161 + /// Set the `when` field (required) 162 + pub fn when( 163 + mut self, 164 + value: impl Into<jacquard_common::types::string::Datetime>, 165 + ) -> MoodBuilder<'a, mood_state::SetWhen<S>> { 166 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 167 + MoodBuilder { 168 + _phantom_state: ::core::marker::PhantomData, 169 + __unsafe_private_named: self.__unsafe_private_named, 170 + _phantom: ::core::marker::PhantomData, 171 + } 172 + } 173 + } 174 + 175 + impl<'a, S> MoodBuilder<'a, S> 176 + where 177 + S: mood_state::State, 178 + S::Mood: mood_state::IsSet, 179 + S::When: mood_state::IsSet, 180 + S::Ref: mood_state::IsSet, 181 + { 182 + /// Build the final struct 183 + pub fn build(self) -> Mood<'a> { 184 + Mood { 185 + mood: self.__unsafe_private_named.0.unwrap(), 186 + r#ref: self.__unsafe_private_named.1.unwrap(), 187 + when: self.__unsafe_private_named.2.unwrap(), 188 + extra_data: Default::default(), 189 + } 190 + } 191 + /// Build the final struct with custom extra_data 192 + pub fn build_with_data( 193 + self, 194 + extra_data: std::collections::BTreeMap< 195 + jacquard_common::smol_str::SmolStr, 196 + jacquard_common::types::value::Data<'a>, 197 + >, 198 + ) -> Mood<'a> { 199 + Mood { 200 + mood: self.__unsafe_private_named.0.unwrap(), 201 + r#ref: self.__unsafe_private_named.1.unwrap(), 202 + when: self.__unsafe_private_named.2.unwrap(), 203 + extra_data: Some(extra_data), 204 + } 205 + } 206 + } 207 + 208 + impl<'a> Mood<'a> { 209 + pub fn uri( 210 + uri: impl Into<jacquard_common::CowStr<'a>>, 211 + ) -> Result< 212 + jacquard_common::types::uri::RecordUri<'a, MoodRecord>, 213 + jacquard_common::types::uri::UriError, 214 + > { 215 + jacquard_common::types::uri::RecordUri::try_from_uri( 216 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 217 + ) 218 + } 219 + } 220 + 221 + /// Typed wrapper for GetRecord response with this collection's record type. 222 + #[derive( 223 + serde::Serialize, 224 + serde::Deserialize, 225 + Debug, 226 + Clone, 227 + PartialEq, 228 + Eq, 229 + jacquard_derive::IntoStatic 230 + )] 231 + #[serde(rename_all = "camelCase")] 232 + pub struct MoodGetRecordOutput<'a> { 233 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 234 + #[serde(borrow)] 235 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 236 + #[serde(borrow)] 237 + pub uri: jacquard_common::types::string::AtUri<'a>, 238 + #[serde(borrow)] 239 + pub value: Mood<'a>, 240 + } 241 + 242 + impl From<MoodGetRecordOutput<'_>> for Mood<'_> { 243 + fn from(output: MoodGetRecordOutput<'_>) -> Self { 244 + use jacquard_common::IntoStatic; 245 + output.value.into_static() 246 + } 247 + } 248 + 249 + impl jacquard_common::types::collection::Collection for Mood<'_> { 250 + const NSID: &'static str = "computer.aesthetic.mood"; 251 + type Record = MoodRecord; 252 + } 253 + 254 + /// Marker type for deserializing records from this collection. 255 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 256 + pub struct MoodRecord; 257 + impl jacquard_common::xrpc::XrpcResp for MoodRecord { 258 + const NSID: &'static str = "computer.aesthetic.mood"; 259 + const ENCODING: &'static str = "application/json"; 260 + type Output<'de> = MoodGetRecordOutput<'de>; 261 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 262 + } 263 + 264 + impl jacquard_common::types::collection::Collection for MoodRecord { 265 + const NSID: &'static str = "computer.aesthetic.mood"; 266 + type Record = MoodRecord; 267 + } 268 + 269 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Mood<'a> { 270 + fn nsid() -> &'static str { 271 + "computer.aesthetic.mood" 272 + } 273 + fn def_name() -> &'static str { 274 + "main" 275 + } 276 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 277 + lexicon_doc_computer_aesthetic_mood() 278 + } 279 + fn validate( 280 + &self, 281 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 282 + { 283 + let value = &self.mood; 284 + #[allow(unused_comparisons)] 285 + if <str>::len(value.as_ref()) > 5000usize { 286 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 287 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 288 + "mood", 289 + ), 290 + max: 5000usize, 291 + actual: <str>::len(value.as_ref()), 292 + }); 293 + } 294 + } 295 + Ok(()) 296 + } 297 + } 298 + 299 + fn lexicon_doc_computer_aesthetic_mood() -> ::jacquard_lexicon::lexicon::LexiconDoc< 300 + 'static, 301 + > { 302 + ::jacquard_lexicon::lexicon::LexiconDoc { 303 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 304 + id: ::jacquard_common::CowStr::new_static("computer.aesthetic.mood"), 305 + revision: None, 306 + description: None, 307 + defs: { 308 + let mut map = ::std::collections::BTreeMap::new(); 309 + map.insert( 310 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 311 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 312 + description: Some( 313 + ::jacquard_common::CowStr::new_static( 314 + "A mood entry from Aesthetic Computer", 315 + ), 316 + ), 317 + key: Some(::jacquard_common::CowStr::new_static("tid")), 318 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 319 + description: None, 320 + required: Some( 321 + vec![ 322 + ::jacquard_common::smol_str::SmolStr::new_static("mood"), 323 + ::jacquard_common::smol_str::SmolStr::new_static("when"), 324 + ::jacquard_common::smol_str::SmolStr::new_static("ref") 325 + ], 326 + ), 327 + nullable: None, 328 + properties: { 329 + #[allow(unused_mut)] 330 + let mut map = ::std::collections::BTreeMap::new(); 331 + map.insert( 332 + ::jacquard_common::smol_str::SmolStr::new_static("mood"), 333 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 334 + description: Some( 335 + ::jacquard_common::CowStr::new_static( 336 + "The mood text content", 337 + ), 338 + ), 339 + format: None, 340 + default: None, 341 + min_length: None, 342 + max_length: Some(5000usize), 343 + min_graphemes: None, 344 + max_graphemes: None, 345 + r#enum: None, 346 + r#const: None, 347 + known_values: None, 348 + }), 349 + ); 350 + map.insert( 351 + ::jacquard_common::smol_str::SmolStr::new_static("ref"), 352 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 353 + description: Some( 354 + ::jacquard_common::CowStr::new_static( 355 + "Reference to source database record for bidirectional sync", 356 + ), 357 + ), 358 + format: None, 359 + default: None, 360 + min_length: None, 361 + max_length: None, 362 + min_graphemes: None, 363 + max_graphemes: None, 364 + r#enum: None, 365 + r#const: None, 366 + known_values: None, 367 + }), 368 + ); 369 + map.insert( 370 + ::jacquard_common::smol_str::SmolStr::new_static("when"), 371 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 372 + description: Some( 373 + ::jacquard_common::CowStr::new_static( 374 + "When the mood was created (ISO 8601)", 375 + ), 376 + ), 377 + format: Some( 378 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 379 + ), 380 + default: None, 381 + min_length: None, 382 + max_length: None, 383 + min_graphemes: None, 384 + max_graphemes: None, 385 + r#enum: None, 386 + r#const: None, 387 + known_values: None, 388 + }), 389 + ); 390 + map 391 + }, 392 + }), 393 + }), 394 + ); 395 + map 396 + }, 397 + } 398 + }
+664
crates/jacquard-api/src/computer_aesthetic/painting.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: computer.aesthetic.painting 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// A digital painting created on aesthetic.computer 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, 12 + serde::Deserialize, 13 + Debug, 14 + Clone, 15 + PartialEq, 16 + Eq, 17 + jacquard_derive::IntoStatic 18 + )] 19 + #[serde(rename_all = "camelCase")] 20 + pub struct Painting<'a> { 21 + /// Short alphanumeric code for easy lookup (e.g., 'a3b') 22 + #[serde(borrow)] 23 + pub code: jacquard_common::CowStr<'a>, 24 + /// URL to full resolution PNG 25 + #[serde(borrow)] 26 + pub image_url: jacquard_common::types::string::Uri<'a>, 27 + /// URL to .zip recording file (if available) 28 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 29 + #[serde(borrow)] 30 + pub recording_url: Option<jacquard_common::types::string::Uri<'a>>, 31 + /// MongoDB ObjectId reference for bidirectional sync 32 + #[serde(borrow)] 33 + pub r#ref: jacquard_common::CowStr<'a>, 34 + /// Timestamp slug (may include recording: imageSlug:recordingSlug) 35 + #[serde(borrow)] 36 + pub slug: jacquard_common::CowStr<'a>, 37 + /// Thumbnail preview (max 1MB) 38 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 39 + #[serde(borrow)] 40 + pub thumbnail: Option<jacquard_common::types::blob::BlobRef<'a>>, 41 + /// Creation timestamp (ISO 8601) 42 + pub when: jacquard_common::types::string::Datetime, 43 + } 44 + 45 + pub mod painting_state { 46 + 47 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 48 + #[allow(unused)] 49 + use ::core::marker::PhantomData; 50 + mod sealed { 51 + pub trait Sealed {} 52 + } 53 + /// State trait tracking which required fields have been set 54 + pub trait State: sealed::Sealed { 55 + type Slug; 56 + type Code; 57 + type ImageUrl; 58 + type When; 59 + type Ref; 60 + } 61 + /// Empty state - all required fields are unset 62 + pub struct Empty(()); 63 + impl sealed::Sealed for Empty {} 64 + impl State for Empty { 65 + type Slug = Unset; 66 + type Code = Unset; 67 + type ImageUrl = Unset; 68 + type When = Unset; 69 + type Ref = Unset; 70 + } 71 + ///State transition - sets the `slug` field to Set 72 + pub struct SetSlug<S: State = Empty>(PhantomData<fn() -> S>); 73 + impl<S: State> sealed::Sealed for SetSlug<S> {} 74 + impl<S: State> State for SetSlug<S> { 75 + type Slug = Set<members::slug>; 76 + type Code = S::Code; 77 + type ImageUrl = S::ImageUrl; 78 + type When = S::When; 79 + type Ref = S::Ref; 80 + } 81 + ///State transition - sets the `code` field to Set 82 + pub struct SetCode<S: State = Empty>(PhantomData<fn() -> S>); 83 + impl<S: State> sealed::Sealed for SetCode<S> {} 84 + impl<S: State> State for SetCode<S> { 85 + type Slug = S::Slug; 86 + type Code = Set<members::code>; 87 + type ImageUrl = S::ImageUrl; 88 + type When = S::When; 89 + type Ref = S::Ref; 90 + } 91 + ///State transition - sets the `image_url` field to Set 92 + pub struct SetImageUrl<S: State = Empty>(PhantomData<fn() -> S>); 93 + impl<S: State> sealed::Sealed for SetImageUrl<S> {} 94 + impl<S: State> State for SetImageUrl<S> { 95 + type Slug = S::Slug; 96 + type Code = S::Code; 97 + type ImageUrl = Set<members::image_url>; 98 + type When = S::When; 99 + type Ref = S::Ref; 100 + } 101 + ///State transition - sets the `when` field to Set 102 + pub struct SetWhen<S: State = Empty>(PhantomData<fn() -> S>); 103 + impl<S: State> sealed::Sealed for SetWhen<S> {} 104 + impl<S: State> State for SetWhen<S> { 105 + type Slug = S::Slug; 106 + type Code = S::Code; 107 + type ImageUrl = S::ImageUrl; 108 + type When = Set<members::when>; 109 + type Ref = S::Ref; 110 + } 111 + ///State transition - sets the `ref` field to Set 112 + pub struct SetRef<S: State = Empty>(PhantomData<fn() -> S>); 113 + impl<S: State> sealed::Sealed for SetRef<S> {} 114 + impl<S: State> State for SetRef<S> { 115 + type Slug = S::Slug; 116 + type Code = S::Code; 117 + type ImageUrl = S::ImageUrl; 118 + type When = S::When; 119 + type Ref = Set<members::r#ref>; 120 + } 121 + /// Marker types for field names 122 + #[allow(non_camel_case_types)] 123 + pub mod members { 124 + ///Marker type for the `slug` field 125 + pub struct slug(()); 126 + ///Marker type for the `code` field 127 + pub struct code(()); 128 + ///Marker type for the `image_url` field 129 + pub struct image_url(()); 130 + ///Marker type for the `when` field 131 + pub struct when(()); 132 + ///Marker type for the `ref` field 133 + pub struct r#ref(()); 134 + } 135 + } 136 + 137 + /// Builder for constructing an instance of this type 138 + pub struct PaintingBuilder<'a, S: painting_state::State> { 139 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 140 + __unsafe_private_named: ( 141 + ::core::option::Option<jacquard_common::CowStr<'a>>, 142 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 143 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 144 + ::core::option::Option<jacquard_common::CowStr<'a>>, 145 + ::core::option::Option<jacquard_common::CowStr<'a>>, 146 + ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 147 + ::core::option::Option<jacquard_common::types::string::Datetime>, 148 + ), 149 + _phantom: ::core::marker::PhantomData<&'a ()>, 150 + } 151 + 152 + impl<'a> Painting<'a> { 153 + /// Create a new builder for this type 154 + pub fn new() -> PaintingBuilder<'a, painting_state::Empty> { 155 + PaintingBuilder::new() 156 + } 157 + } 158 + 159 + impl<'a> PaintingBuilder<'a, painting_state::Empty> { 160 + /// Create a new builder with all fields unset 161 + pub fn new() -> Self { 162 + PaintingBuilder { 163 + _phantom_state: ::core::marker::PhantomData, 164 + __unsafe_private_named: (None, None, None, None, None, None, None), 165 + _phantom: ::core::marker::PhantomData, 166 + } 167 + } 168 + } 169 + 170 + impl<'a, S> PaintingBuilder<'a, S> 171 + where 172 + S: painting_state::State, 173 + S::Code: painting_state::IsUnset, 174 + { 175 + /// Set the `code` field (required) 176 + pub fn code( 177 + mut self, 178 + value: impl Into<jacquard_common::CowStr<'a>>, 179 + ) -> PaintingBuilder<'a, painting_state::SetCode<S>> { 180 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 181 + PaintingBuilder { 182 + _phantom_state: ::core::marker::PhantomData, 183 + __unsafe_private_named: self.__unsafe_private_named, 184 + _phantom: ::core::marker::PhantomData, 185 + } 186 + } 187 + } 188 + 189 + impl<'a, S> PaintingBuilder<'a, S> 190 + where 191 + S: painting_state::State, 192 + S::ImageUrl: painting_state::IsUnset, 193 + { 194 + /// Set the `imageUrl` field (required) 195 + pub fn image_url( 196 + mut self, 197 + value: impl Into<jacquard_common::types::string::Uri<'a>>, 198 + ) -> PaintingBuilder<'a, painting_state::SetImageUrl<S>> { 199 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 200 + PaintingBuilder { 201 + _phantom_state: ::core::marker::PhantomData, 202 + __unsafe_private_named: self.__unsafe_private_named, 203 + _phantom: ::core::marker::PhantomData, 204 + } 205 + } 206 + } 207 + 208 + impl<'a, S: painting_state::State> PaintingBuilder<'a, S> { 209 + /// Set the `recordingUrl` field (optional) 210 + pub fn recording_url( 211 + mut self, 212 + value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 213 + ) -> Self { 214 + self.__unsafe_private_named.2 = value.into(); 215 + self 216 + } 217 + /// Set the `recordingUrl` field to an Option value (optional) 218 + pub fn maybe_recording_url( 219 + mut self, 220 + value: Option<jacquard_common::types::string::Uri<'a>>, 221 + ) -> Self { 222 + self.__unsafe_private_named.2 = value; 223 + self 224 + } 225 + } 226 + 227 + impl<'a, S> PaintingBuilder<'a, S> 228 + where 229 + S: painting_state::State, 230 + S::Ref: painting_state::IsUnset, 231 + { 232 + /// Set the `ref` field (required) 233 + pub fn r#ref( 234 + mut self, 235 + value: impl Into<jacquard_common::CowStr<'a>>, 236 + ) -> PaintingBuilder<'a, painting_state::SetRef<S>> { 237 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 238 + PaintingBuilder { 239 + _phantom_state: ::core::marker::PhantomData, 240 + __unsafe_private_named: self.__unsafe_private_named, 241 + _phantom: ::core::marker::PhantomData, 242 + } 243 + } 244 + } 245 + 246 + impl<'a, S> PaintingBuilder<'a, S> 247 + where 248 + S: painting_state::State, 249 + S::Slug: painting_state::IsUnset, 250 + { 251 + /// Set the `slug` field (required) 252 + pub fn slug( 253 + mut self, 254 + value: impl Into<jacquard_common::CowStr<'a>>, 255 + ) -> PaintingBuilder<'a, painting_state::SetSlug<S>> { 256 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 257 + PaintingBuilder { 258 + _phantom_state: ::core::marker::PhantomData, 259 + __unsafe_private_named: self.__unsafe_private_named, 260 + _phantom: ::core::marker::PhantomData, 261 + } 262 + } 263 + } 264 + 265 + impl<'a, S: painting_state::State> PaintingBuilder<'a, S> { 266 + /// Set the `thumbnail` field (optional) 267 + pub fn thumbnail( 268 + mut self, 269 + value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>, 270 + ) -> Self { 271 + self.__unsafe_private_named.5 = value.into(); 272 + self 273 + } 274 + /// Set the `thumbnail` field to an Option value (optional) 275 + pub fn maybe_thumbnail( 276 + mut self, 277 + value: Option<jacquard_common::types::blob::BlobRef<'a>>, 278 + ) -> Self { 279 + self.__unsafe_private_named.5 = value; 280 + self 281 + } 282 + } 283 + 284 + impl<'a, S> PaintingBuilder<'a, S> 285 + where 286 + S: painting_state::State, 287 + S::When: painting_state::IsUnset, 288 + { 289 + /// Set the `when` field (required) 290 + pub fn when( 291 + mut self, 292 + value: impl Into<jacquard_common::types::string::Datetime>, 293 + ) -> PaintingBuilder<'a, painting_state::SetWhen<S>> { 294 + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 295 + PaintingBuilder { 296 + _phantom_state: ::core::marker::PhantomData, 297 + __unsafe_private_named: self.__unsafe_private_named, 298 + _phantom: ::core::marker::PhantomData, 299 + } 300 + } 301 + } 302 + 303 + impl<'a, S> PaintingBuilder<'a, S> 304 + where 305 + S: painting_state::State, 306 + S::Slug: painting_state::IsSet, 307 + S::Code: painting_state::IsSet, 308 + S::ImageUrl: painting_state::IsSet, 309 + S::When: painting_state::IsSet, 310 + S::Ref: painting_state::IsSet, 311 + { 312 + /// Build the final struct 313 + pub fn build(self) -> Painting<'a> { 314 + Painting { 315 + code: self.__unsafe_private_named.0.unwrap(), 316 + image_url: self.__unsafe_private_named.1.unwrap(), 317 + recording_url: self.__unsafe_private_named.2, 318 + r#ref: self.__unsafe_private_named.3.unwrap(), 319 + slug: self.__unsafe_private_named.4.unwrap(), 320 + thumbnail: self.__unsafe_private_named.5, 321 + when: self.__unsafe_private_named.6.unwrap(), 322 + extra_data: Default::default(), 323 + } 324 + } 325 + /// Build the final struct with custom extra_data 326 + pub fn build_with_data( 327 + self, 328 + extra_data: std::collections::BTreeMap< 329 + jacquard_common::smol_str::SmolStr, 330 + jacquard_common::types::value::Data<'a>, 331 + >, 332 + ) -> Painting<'a> { 333 + Painting { 334 + code: self.__unsafe_private_named.0.unwrap(), 335 + image_url: self.__unsafe_private_named.1.unwrap(), 336 + recording_url: self.__unsafe_private_named.2, 337 + r#ref: self.__unsafe_private_named.3.unwrap(), 338 + slug: self.__unsafe_private_named.4.unwrap(), 339 + thumbnail: self.__unsafe_private_named.5, 340 + when: self.__unsafe_private_named.6.unwrap(), 341 + extra_data: Some(extra_data), 342 + } 343 + } 344 + } 345 + 346 + impl<'a> Painting<'a> { 347 + pub fn uri( 348 + uri: impl Into<jacquard_common::CowStr<'a>>, 349 + ) -> Result< 350 + jacquard_common::types::uri::RecordUri<'a, PaintingRecord>, 351 + jacquard_common::types::uri::UriError, 352 + > { 353 + jacquard_common::types::uri::RecordUri::try_from_uri( 354 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 355 + ) 356 + } 357 + } 358 + 359 + /// Typed wrapper for GetRecord response with this collection's record type. 360 + #[derive( 361 + serde::Serialize, 362 + serde::Deserialize, 363 + Debug, 364 + Clone, 365 + PartialEq, 366 + Eq, 367 + jacquard_derive::IntoStatic 368 + )] 369 + #[serde(rename_all = "camelCase")] 370 + pub struct PaintingGetRecordOutput<'a> { 371 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 372 + #[serde(borrow)] 373 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 374 + #[serde(borrow)] 375 + pub uri: jacquard_common::types::string::AtUri<'a>, 376 + #[serde(borrow)] 377 + pub value: Painting<'a>, 378 + } 379 + 380 + impl From<PaintingGetRecordOutput<'_>> for Painting<'_> { 381 + fn from(output: PaintingGetRecordOutput<'_>) -> Self { 382 + use jacquard_common::IntoStatic; 383 + output.value.into_static() 384 + } 385 + } 386 + 387 + impl jacquard_common::types::collection::Collection for Painting<'_> { 388 + const NSID: &'static str = "computer.aesthetic.painting"; 389 + type Record = PaintingRecord; 390 + } 391 + 392 + /// Marker type for deserializing records from this collection. 393 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 394 + pub struct PaintingRecord; 395 + impl jacquard_common::xrpc::XrpcResp for PaintingRecord { 396 + const NSID: &'static str = "computer.aesthetic.painting"; 397 + const ENCODING: &'static str = "application/json"; 398 + type Output<'de> = PaintingGetRecordOutput<'de>; 399 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 400 + } 401 + 402 + impl jacquard_common::types::collection::Collection for PaintingRecord { 403 + const NSID: &'static str = "computer.aesthetic.painting"; 404 + type Record = PaintingRecord; 405 + } 406 + 407 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Painting<'a> { 408 + fn nsid() -> &'static str { 409 + "computer.aesthetic.painting" 410 + } 411 + fn def_name() -> &'static str { 412 + "main" 413 + } 414 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 415 + lexicon_doc_computer_aesthetic_painting() 416 + } 417 + fn validate( 418 + &self, 419 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 420 + { 421 + let value = &self.code; 422 + #[allow(unused_comparisons)] 423 + if <str>::len(value.as_ref()) > 10usize { 424 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 425 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 426 + "code", 427 + ), 428 + max: 10usize, 429 + actual: <str>::len(value.as_ref()), 430 + }); 431 + } 432 + } 433 + { 434 + let value = &self.image_url; 435 + #[allow(unused_comparisons)] 436 + if <str>::len(value.as_ref()) > 512usize { 437 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 438 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 439 + "image_url", 440 + ), 441 + max: 512usize, 442 + actual: <str>::len(value.as_ref()), 443 + }); 444 + } 445 + } 446 + if let Some(ref value) = self.recording_url { 447 + #[allow(unused_comparisons)] 448 + if <str>::len(value.as_ref()) > 512usize { 449 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 450 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 451 + "recording_url", 452 + ), 453 + max: 512usize, 454 + actual: <str>::len(value.as_ref()), 455 + }); 456 + } 457 + } 458 + { 459 + let value = &self.r#ref; 460 + #[allow(unused_comparisons)] 461 + if <str>::len(value.as_ref()) > 24usize { 462 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 463 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 464 + "ref", 465 + ), 466 + max: 24usize, 467 + actual: <str>::len(value.as_ref()), 468 + }); 469 + } 470 + } 471 + { 472 + let value = &self.slug; 473 + #[allow(unused_comparisons)] 474 + if <str>::len(value.as_ref()) > 128usize { 475 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 476 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 477 + "slug", 478 + ), 479 + max: 128usize, 480 + actual: <str>::len(value.as_ref()), 481 + }); 482 + } 483 + } 484 + Ok(()) 485 + } 486 + } 487 + 488 + fn lexicon_doc_computer_aesthetic_painting() -> ::jacquard_lexicon::lexicon::LexiconDoc< 489 + 'static, 490 + > { 491 + ::jacquard_lexicon::lexicon::LexiconDoc { 492 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 493 + id: ::jacquard_common::CowStr::new_static("computer.aesthetic.painting"), 494 + revision: None, 495 + description: None, 496 + defs: { 497 + let mut map = ::std::collections::BTreeMap::new(); 498 + map.insert( 499 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 500 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 501 + description: Some( 502 + ::jacquard_common::CowStr::new_static( 503 + "A digital painting created on aesthetic.computer", 504 + ), 505 + ), 506 + key: Some(::jacquard_common::CowStr::new_static("tid")), 507 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 508 + description: None, 509 + required: Some( 510 + vec![ 511 + ::jacquard_common::smol_str::SmolStr::new_static("slug"), 512 + ::jacquard_common::smol_str::SmolStr::new_static("code"), 513 + ::jacquard_common::smol_str::SmolStr::new_static("imageUrl"), 514 + ::jacquard_common::smol_str::SmolStr::new_static("when"), 515 + ::jacquard_common::smol_str::SmolStr::new_static("ref") 516 + ], 517 + ), 518 + nullable: None, 519 + properties: { 520 + #[allow(unused_mut)] 521 + let mut map = ::std::collections::BTreeMap::new(); 522 + map.insert( 523 + ::jacquard_common::smol_str::SmolStr::new_static("code"), 524 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 525 + description: Some( 526 + ::jacquard_common::CowStr::new_static( 527 + "Short alphanumeric code for easy lookup (e.g., 'a3b')", 528 + ), 529 + ), 530 + format: None, 531 + default: None, 532 + min_length: None, 533 + max_length: Some(10usize), 534 + min_graphemes: None, 535 + max_graphemes: None, 536 + r#enum: None, 537 + r#const: None, 538 + known_values: None, 539 + }), 540 + ); 541 + map.insert( 542 + ::jacquard_common::smol_str::SmolStr::new_static( 543 + "imageUrl", 544 + ), 545 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 546 + description: Some( 547 + ::jacquard_common::CowStr::new_static( 548 + "URL to full resolution PNG", 549 + ), 550 + ), 551 + format: Some( 552 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 553 + ), 554 + default: None, 555 + min_length: None, 556 + max_length: Some(512usize), 557 + min_graphemes: None, 558 + max_graphemes: None, 559 + r#enum: None, 560 + r#const: None, 561 + known_values: None, 562 + }), 563 + ); 564 + map.insert( 565 + ::jacquard_common::smol_str::SmolStr::new_static( 566 + "recordingUrl", 567 + ), 568 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 569 + description: Some( 570 + ::jacquard_common::CowStr::new_static( 571 + "URL to .zip recording file (if available)", 572 + ), 573 + ), 574 + format: Some( 575 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 576 + ), 577 + default: None, 578 + min_length: None, 579 + max_length: Some(512usize), 580 + min_graphemes: None, 581 + max_graphemes: None, 582 + r#enum: None, 583 + r#const: None, 584 + known_values: None, 585 + }), 586 + ); 587 + map.insert( 588 + ::jacquard_common::smol_str::SmolStr::new_static("ref"), 589 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 590 + description: Some( 591 + ::jacquard_common::CowStr::new_static( 592 + "MongoDB ObjectId reference for bidirectional sync", 593 + ), 594 + ), 595 + format: None, 596 + default: None, 597 + min_length: None, 598 + max_length: Some(24usize), 599 + min_graphemes: None, 600 + max_graphemes: None, 601 + r#enum: None, 602 + r#const: None, 603 + known_values: None, 604 + }), 605 + ); 606 + map.insert( 607 + ::jacquard_common::smol_str::SmolStr::new_static("slug"), 608 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 609 + description: Some( 610 + ::jacquard_common::CowStr::new_static( 611 + "Timestamp slug (may include recording: imageSlug:recordingSlug)", 612 + ), 613 + ), 614 + format: None, 615 + default: None, 616 + min_length: None, 617 + max_length: Some(128usize), 618 + min_graphemes: None, 619 + max_graphemes: None, 620 + r#enum: None, 621 + r#const: None, 622 + known_values: None, 623 + }), 624 + ); 625 + map.insert( 626 + ::jacquard_common::smol_str::SmolStr::new_static( 627 + "thumbnail", 628 + ), 629 + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 630 + description: None, 631 + accept: None, 632 + max_size: None, 633 + }), 634 + ); 635 + map.insert( 636 + ::jacquard_common::smol_str::SmolStr::new_static("when"), 637 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 638 + description: Some( 639 + ::jacquard_common::CowStr::new_static( 640 + "Creation timestamp (ISO 8601)", 641 + ), 642 + ), 643 + format: Some( 644 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 645 + ), 646 + default: None, 647 + min_length: None, 648 + max_length: None, 649 + min_graphemes: None, 650 + max_graphemes: None, 651 + r#enum: None, 652 + r#const: None, 653 + known_values: None, 654 + }), 655 + ); 656 + map 657 + }, 658 + }), 659 + }), 660 + ); 661 + map 662 + }, 663 + } 664 + }
+411
crates/jacquard-api/src/computer_aesthetic/piece.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: computer.aesthetic.piece 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// A piece (interactive program) from Aesthetic Computer 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, 12 + serde::Deserialize, 13 + Debug, 14 + Clone, 15 + PartialEq, 16 + Eq, 17 + jacquard_derive::IntoStatic 18 + )] 19 + #[serde(rename_all = "camelCase")] 20 + pub struct Piece<'a> { 21 + /// MongoDB ObjectId reference for bidirectional sync 22 + #[serde(borrow)] 23 + pub r#ref: jacquard_common::CowStr<'a>, 24 + /// The piece identifier (e.g., 'wand') 25 + #[serde(borrow)] 26 + pub slug: jacquard_common::CowStr<'a>, 27 + /// Creation timestamp (ISO 8601) 28 + pub when: jacquard_common::types::string::Datetime, 29 + } 30 + 31 + pub mod piece_state { 32 + 33 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 34 + #[allow(unused)] 35 + use ::core::marker::PhantomData; 36 + mod sealed { 37 + pub trait Sealed {} 38 + } 39 + /// State trait tracking which required fields have been set 40 + pub trait State: sealed::Sealed { 41 + type Slug; 42 + type When; 43 + type Ref; 44 + } 45 + /// Empty state - all required fields are unset 46 + pub struct Empty(()); 47 + impl sealed::Sealed for Empty {} 48 + impl State for Empty { 49 + type Slug = Unset; 50 + type When = Unset; 51 + type Ref = Unset; 52 + } 53 + ///State transition - sets the `slug` field to Set 54 + pub struct SetSlug<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetSlug<S> {} 56 + impl<S: State> State for SetSlug<S> { 57 + type Slug = Set<members::slug>; 58 + type When = S::When; 59 + type Ref = S::Ref; 60 + } 61 + ///State transition - sets the `when` field to Set 62 + pub struct SetWhen<S: State = Empty>(PhantomData<fn() -> S>); 63 + impl<S: State> sealed::Sealed for SetWhen<S> {} 64 + impl<S: State> State for SetWhen<S> { 65 + type Slug = S::Slug; 66 + type When = Set<members::when>; 67 + type Ref = S::Ref; 68 + } 69 + ///State transition - sets the `ref` field to Set 70 + pub struct SetRef<S: State = Empty>(PhantomData<fn() -> S>); 71 + impl<S: State> sealed::Sealed for SetRef<S> {} 72 + impl<S: State> State for SetRef<S> { 73 + type Slug = S::Slug; 74 + type When = S::When; 75 + type Ref = Set<members::r#ref>; 76 + } 77 + /// Marker types for field names 78 + #[allow(non_camel_case_types)] 79 + pub mod members { 80 + ///Marker type for the `slug` field 81 + pub struct slug(()); 82 + ///Marker type for the `when` field 83 + pub struct when(()); 84 + ///Marker type for the `ref` field 85 + pub struct r#ref(()); 86 + } 87 + } 88 + 89 + /// Builder for constructing an instance of this type 90 + pub struct PieceBuilder<'a, S: piece_state::State> { 91 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 92 + __unsafe_private_named: ( 93 + ::core::option::Option<jacquard_common::CowStr<'a>>, 94 + ::core::option::Option<jacquard_common::CowStr<'a>>, 95 + ::core::option::Option<jacquard_common::types::string::Datetime>, 96 + ), 97 + _phantom: ::core::marker::PhantomData<&'a ()>, 98 + } 99 + 100 + impl<'a> Piece<'a> { 101 + /// Create a new builder for this type 102 + pub fn new() -> PieceBuilder<'a, piece_state::Empty> { 103 + PieceBuilder::new() 104 + } 105 + } 106 + 107 + impl<'a> PieceBuilder<'a, piece_state::Empty> { 108 + /// Create a new builder with all fields unset 109 + pub fn new() -> Self { 110 + PieceBuilder { 111 + _phantom_state: ::core::marker::PhantomData, 112 + __unsafe_private_named: (None, None, None), 113 + _phantom: ::core::marker::PhantomData, 114 + } 115 + } 116 + } 117 + 118 + impl<'a, S> PieceBuilder<'a, S> 119 + where 120 + S: piece_state::State, 121 + S::Ref: piece_state::IsUnset, 122 + { 123 + /// Set the `ref` field (required) 124 + pub fn r#ref( 125 + mut self, 126 + value: impl Into<jacquard_common::CowStr<'a>>, 127 + ) -> PieceBuilder<'a, piece_state::SetRef<S>> { 128 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 129 + PieceBuilder { 130 + _phantom_state: ::core::marker::PhantomData, 131 + __unsafe_private_named: self.__unsafe_private_named, 132 + _phantom: ::core::marker::PhantomData, 133 + } 134 + } 135 + } 136 + 137 + impl<'a, S> PieceBuilder<'a, S> 138 + where 139 + S: piece_state::State, 140 + S::Slug: piece_state::IsUnset, 141 + { 142 + /// Set the `slug` field (required) 143 + pub fn slug( 144 + mut self, 145 + value: impl Into<jacquard_common::CowStr<'a>>, 146 + ) -> PieceBuilder<'a, piece_state::SetSlug<S>> { 147 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 148 + PieceBuilder { 149 + _phantom_state: ::core::marker::PhantomData, 150 + __unsafe_private_named: self.__unsafe_private_named, 151 + _phantom: ::core::marker::PhantomData, 152 + } 153 + } 154 + } 155 + 156 + impl<'a, S> PieceBuilder<'a, S> 157 + where 158 + S: piece_state::State, 159 + S::When: piece_state::IsUnset, 160 + { 161 + /// Set the `when` field (required) 162 + pub fn when( 163 + mut self, 164 + value: impl Into<jacquard_common::types::string::Datetime>, 165 + ) -> PieceBuilder<'a, piece_state::SetWhen<S>> { 166 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 167 + PieceBuilder { 168 + _phantom_state: ::core::marker::PhantomData, 169 + __unsafe_private_named: self.__unsafe_private_named, 170 + _phantom: ::core::marker::PhantomData, 171 + } 172 + } 173 + } 174 + 175 + impl<'a, S> PieceBuilder<'a, S> 176 + where 177 + S: piece_state::State, 178 + S::Slug: piece_state::IsSet, 179 + S::When: piece_state::IsSet, 180 + S::Ref: piece_state::IsSet, 181 + { 182 + /// Build the final struct 183 + pub fn build(self) -> Piece<'a> { 184 + Piece { 185 + r#ref: self.__unsafe_private_named.0.unwrap(), 186 + slug: self.__unsafe_private_named.1.unwrap(), 187 + when: self.__unsafe_private_named.2.unwrap(), 188 + extra_data: Default::default(), 189 + } 190 + } 191 + /// Build the final struct with custom extra_data 192 + pub fn build_with_data( 193 + self, 194 + extra_data: std::collections::BTreeMap< 195 + jacquard_common::smol_str::SmolStr, 196 + jacquard_common::types::value::Data<'a>, 197 + >, 198 + ) -> Piece<'a> { 199 + Piece { 200 + r#ref: self.__unsafe_private_named.0.unwrap(), 201 + slug: self.__unsafe_private_named.1.unwrap(), 202 + when: self.__unsafe_private_named.2.unwrap(), 203 + extra_data: Some(extra_data), 204 + } 205 + } 206 + } 207 + 208 + impl<'a> Piece<'a> { 209 + pub fn uri( 210 + uri: impl Into<jacquard_common::CowStr<'a>>, 211 + ) -> Result< 212 + jacquard_common::types::uri::RecordUri<'a, PieceRecord>, 213 + jacquard_common::types::uri::UriError, 214 + > { 215 + jacquard_common::types::uri::RecordUri::try_from_uri( 216 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 217 + ) 218 + } 219 + } 220 + 221 + /// Typed wrapper for GetRecord response with this collection's record type. 222 + #[derive( 223 + serde::Serialize, 224 + serde::Deserialize, 225 + Debug, 226 + Clone, 227 + PartialEq, 228 + Eq, 229 + jacquard_derive::IntoStatic 230 + )] 231 + #[serde(rename_all = "camelCase")] 232 + pub struct PieceGetRecordOutput<'a> { 233 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 234 + #[serde(borrow)] 235 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 236 + #[serde(borrow)] 237 + pub uri: jacquard_common::types::string::AtUri<'a>, 238 + #[serde(borrow)] 239 + pub value: Piece<'a>, 240 + } 241 + 242 + impl From<PieceGetRecordOutput<'_>> for Piece<'_> { 243 + fn from(output: PieceGetRecordOutput<'_>) -> Self { 244 + use jacquard_common::IntoStatic; 245 + output.value.into_static() 246 + } 247 + } 248 + 249 + impl jacquard_common::types::collection::Collection for Piece<'_> { 250 + const NSID: &'static str = "computer.aesthetic.piece"; 251 + type Record = PieceRecord; 252 + } 253 + 254 + /// Marker type for deserializing records from this collection. 255 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 256 + pub struct PieceRecord; 257 + impl jacquard_common::xrpc::XrpcResp for PieceRecord { 258 + const NSID: &'static str = "computer.aesthetic.piece"; 259 + const ENCODING: &'static str = "application/json"; 260 + type Output<'de> = PieceGetRecordOutput<'de>; 261 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 262 + } 263 + 264 + impl jacquard_common::types::collection::Collection for PieceRecord { 265 + const NSID: &'static str = "computer.aesthetic.piece"; 266 + type Record = PieceRecord; 267 + } 268 + 269 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Piece<'a> { 270 + fn nsid() -> &'static str { 271 + "computer.aesthetic.piece" 272 + } 273 + fn def_name() -> &'static str { 274 + "main" 275 + } 276 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 277 + lexicon_doc_computer_aesthetic_piece() 278 + } 279 + fn validate( 280 + &self, 281 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 282 + { 283 + let value = &self.r#ref; 284 + #[allow(unused_comparisons)] 285 + if <str>::len(value.as_ref()) > 24usize { 286 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 287 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 288 + "ref", 289 + ), 290 + max: 24usize, 291 + actual: <str>::len(value.as_ref()), 292 + }); 293 + } 294 + } 295 + { 296 + let value = &self.slug; 297 + #[allow(unused_comparisons)] 298 + if <str>::len(value.as_ref()) > 100usize { 299 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 300 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 301 + "slug", 302 + ), 303 + max: 100usize, 304 + actual: <str>::len(value.as_ref()), 305 + }); 306 + } 307 + } 308 + Ok(()) 309 + } 310 + } 311 + 312 + fn lexicon_doc_computer_aesthetic_piece() -> ::jacquard_lexicon::lexicon::LexiconDoc< 313 + 'static, 314 + > { 315 + ::jacquard_lexicon::lexicon::LexiconDoc { 316 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 317 + id: ::jacquard_common::CowStr::new_static("computer.aesthetic.piece"), 318 + revision: None, 319 + description: None, 320 + defs: { 321 + let mut map = ::std::collections::BTreeMap::new(); 322 + map.insert( 323 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 324 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 325 + description: Some( 326 + ::jacquard_common::CowStr::new_static( 327 + "A piece (interactive program) from Aesthetic Computer", 328 + ), 329 + ), 330 + key: Some(::jacquard_common::CowStr::new_static("tid")), 331 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 332 + description: None, 333 + required: Some( 334 + vec![ 335 + ::jacquard_common::smol_str::SmolStr::new_static("slug"), 336 + ::jacquard_common::smol_str::SmolStr::new_static("when"), 337 + ::jacquard_common::smol_str::SmolStr::new_static("ref") 338 + ], 339 + ), 340 + nullable: None, 341 + properties: { 342 + #[allow(unused_mut)] 343 + let mut map = ::std::collections::BTreeMap::new(); 344 + map.insert( 345 + ::jacquard_common::smol_str::SmolStr::new_static("ref"), 346 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 347 + description: Some( 348 + ::jacquard_common::CowStr::new_static( 349 + "MongoDB ObjectId reference for bidirectional sync", 350 + ), 351 + ), 352 + format: None, 353 + default: None, 354 + min_length: None, 355 + max_length: Some(24usize), 356 + min_graphemes: None, 357 + max_graphemes: None, 358 + r#enum: None, 359 + r#const: None, 360 + known_values: None, 361 + }), 362 + ); 363 + map.insert( 364 + ::jacquard_common::smol_str::SmolStr::new_static("slug"), 365 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 366 + description: Some( 367 + ::jacquard_common::CowStr::new_static( 368 + "The piece identifier (e.g., 'wand')", 369 + ), 370 + ), 371 + format: None, 372 + default: None, 373 + min_length: None, 374 + max_length: Some(100usize), 375 + min_graphemes: None, 376 + max_graphemes: None, 377 + r#enum: None, 378 + r#const: None, 379 + known_values: None, 380 + }), 381 + ); 382 + map.insert( 383 + ::jacquard_common::smol_str::SmolStr::new_static("when"), 384 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 385 + description: Some( 386 + ::jacquard_common::CowStr::new_static( 387 + "Creation timestamp (ISO 8601)", 388 + ), 389 + ), 390 + format: Some( 391 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 392 + ), 393 + default: None, 394 + min_length: None, 395 + max_length: None, 396 + min_graphemes: None, 397 + max_graphemes: None, 398 + r#enum: None, 399 + r#const: None, 400 + known_values: None, 401 + }), 402 + ); 403 + map 404 + }, 405 + }), 406 + }), 407 + ); 408 + map 409 + }, 410 + } 411 + }
+576
crates/jacquard-api/src/computer_aesthetic/tape.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: computer.aesthetic.tape 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + #[jacquard_derive::lexicon] 9 + #[derive( 10 + serde::Serialize, 11 + serde::Deserialize, 12 + Debug, 13 + Clone, 14 + PartialEq, 15 + Eq, 16 + jacquard_derive::IntoStatic 17 + )] 18 + #[serde(rename_all = "camelCase")] 19 + pub struct Tape<'a> { 20 + /// Permanent link to view on aesthetic.computer (e.g., https://aesthetic.computer/!a3x) 21 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 22 + #[serde(borrow)] 23 + pub ac_url: Option<jacquard_common::CowStr<'a>>, 24 + /// Short alphanumeric code for easy lookup (e.g., 'a3x') 25 + #[serde(borrow)] 26 + pub code: jacquard_common::CowStr<'a>, 27 + /// MongoDB ObjectId reference for bi-directional sync 28 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 29 + #[serde(borrow)] 30 + pub r#ref: Option<jacquard_common::CowStr<'a>>, 31 + /// The unique slug identifier for this tape (e.g., wand-1729177200000) 32 + #[serde(borrow)] 33 + pub slug: jacquard_common::CowStr<'a>, 34 + /// Thumbnail image from midpoint frame, 3x scaled with nearest neighbor (max 1MB) 35 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 36 + #[serde(borrow)] 37 + pub thumbnail: Option<jacquard_common::types::blob::BlobRef<'a>>, 38 + /// MP4 video with 3x pixel scaling and audio soundtrack (max 50MB) 39 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 40 + #[serde(borrow)] 41 + pub video: Option<jacquard_common::types::blob::BlobRef<'a>>, 42 + /// ISO 8601 timestamp when the tape was created 43 + pub when: jacquard_common::types::string::Datetime, 44 + /// Direct URL to download the original ZIP file with frames and audio 45 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 46 + #[serde(borrow)] 47 + pub zip_url: Option<jacquard_common::CowStr<'a>>, 48 + } 49 + 50 + pub mod tape_state { 51 + 52 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 53 + #[allow(unused)] 54 + use ::core::marker::PhantomData; 55 + mod sealed { 56 + pub trait Sealed {} 57 + } 58 + /// State trait tracking which required fields have been set 59 + pub trait State: sealed::Sealed { 60 + type Slug; 61 + type Code; 62 + type When; 63 + } 64 + /// Empty state - all required fields are unset 65 + pub struct Empty(()); 66 + impl sealed::Sealed for Empty {} 67 + impl State for Empty { 68 + type Slug = Unset; 69 + type Code = Unset; 70 + type When = Unset; 71 + } 72 + ///State transition - sets the `slug` field to Set 73 + pub struct SetSlug<S: State = Empty>(PhantomData<fn() -> S>); 74 + impl<S: State> sealed::Sealed for SetSlug<S> {} 75 + impl<S: State> State for SetSlug<S> { 76 + type Slug = Set<members::slug>; 77 + type Code = S::Code; 78 + type When = S::When; 79 + } 80 + ///State transition - sets the `code` field to Set 81 + pub struct SetCode<S: State = Empty>(PhantomData<fn() -> S>); 82 + impl<S: State> sealed::Sealed for SetCode<S> {} 83 + impl<S: State> State for SetCode<S> { 84 + type Slug = S::Slug; 85 + type Code = Set<members::code>; 86 + type When = S::When; 87 + } 88 + ///State transition - sets the `when` field to Set 89 + pub struct SetWhen<S: State = Empty>(PhantomData<fn() -> S>); 90 + impl<S: State> sealed::Sealed for SetWhen<S> {} 91 + impl<S: State> State for SetWhen<S> { 92 + type Slug = S::Slug; 93 + type Code = S::Code; 94 + type When = Set<members::when>; 95 + } 96 + /// Marker types for field names 97 + #[allow(non_camel_case_types)] 98 + pub mod members { 99 + ///Marker type for the `slug` field 100 + pub struct slug(()); 101 + ///Marker type for the `code` field 102 + pub struct code(()); 103 + ///Marker type for the `when` field 104 + pub struct when(()); 105 + } 106 + } 107 + 108 + /// Builder for constructing an instance of this type 109 + pub struct TapeBuilder<'a, S: tape_state::State> { 110 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 111 + __unsafe_private_named: ( 112 + ::core::option::Option<jacquard_common::CowStr<'a>>, 113 + ::core::option::Option<jacquard_common::CowStr<'a>>, 114 + ::core::option::Option<jacquard_common::CowStr<'a>>, 115 + ::core::option::Option<jacquard_common::CowStr<'a>>, 116 + ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 117 + ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 118 + ::core::option::Option<jacquard_common::types::string::Datetime>, 119 + ::core::option::Option<jacquard_common::CowStr<'a>>, 120 + ), 121 + _phantom: ::core::marker::PhantomData<&'a ()>, 122 + } 123 + 124 + impl<'a> Tape<'a> { 125 + /// Create a new builder for this type 126 + pub fn new() -> TapeBuilder<'a, tape_state::Empty> { 127 + TapeBuilder::new() 128 + } 129 + } 130 + 131 + impl<'a> TapeBuilder<'a, tape_state::Empty> { 132 + /// Create a new builder with all fields unset 133 + pub fn new() -> Self { 134 + TapeBuilder { 135 + _phantom_state: ::core::marker::PhantomData, 136 + __unsafe_private_named: (None, None, None, None, None, None, None, None), 137 + _phantom: ::core::marker::PhantomData, 138 + } 139 + } 140 + } 141 + 142 + impl<'a, S: tape_state::State> TapeBuilder<'a, S> { 143 + /// Set the `acUrl` field (optional) 144 + pub fn ac_url( 145 + mut self, 146 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 147 + ) -> Self { 148 + self.__unsafe_private_named.0 = value.into(); 149 + self 150 + } 151 + /// Set the `acUrl` field to an Option value (optional) 152 + pub fn maybe_ac_url(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 153 + self.__unsafe_private_named.0 = value; 154 + self 155 + } 156 + } 157 + 158 + impl<'a, S> TapeBuilder<'a, S> 159 + where 160 + S: tape_state::State, 161 + S::Code: tape_state::IsUnset, 162 + { 163 + /// Set the `code` field (required) 164 + pub fn code( 165 + mut self, 166 + value: impl Into<jacquard_common::CowStr<'a>>, 167 + ) -> TapeBuilder<'a, tape_state::SetCode<S>> { 168 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 169 + TapeBuilder { 170 + _phantom_state: ::core::marker::PhantomData, 171 + __unsafe_private_named: self.__unsafe_private_named, 172 + _phantom: ::core::marker::PhantomData, 173 + } 174 + } 175 + } 176 + 177 + impl<'a, S: tape_state::State> TapeBuilder<'a, S> { 178 + /// Set the `ref` field (optional) 179 + pub fn r#ref( 180 + mut self, 181 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 182 + ) -> Self { 183 + self.__unsafe_private_named.2 = value.into(); 184 + self 185 + } 186 + /// Set the `ref` field to an Option value (optional) 187 + pub fn maybe_ref(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 188 + self.__unsafe_private_named.2 = value; 189 + self 190 + } 191 + } 192 + 193 + impl<'a, S> TapeBuilder<'a, S> 194 + where 195 + S: tape_state::State, 196 + S::Slug: tape_state::IsUnset, 197 + { 198 + /// Set the `slug` field (required) 199 + pub fn slug( 200 + mut self, 201 + value: impl Into<jacquard_common::CowStr<'a>>, 202 + ) -> TapeBuilder<'a, tape_state::SetSlug<S>> { 203 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 204 + TapeBuilder { 205 + _phantom_state: ::core::marker::PhantomData, 206 + __unsafe_private_named: self.__unsafe_private_named, 207 + _phantom: ::core::marker::PhantomData, 208 + } 209 + } 210 + } 211 + 212 + impl<'a, S: tape_state::State> TapeBuilder<'a, S> { 213 + /// Set the `thumbnail` field (optional) 214 + pub fn thumbnail( 215 + mut self, 216 + value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>, 217 + ) -> Self { 218 + self.__unsafe_private_named.4 = value.into(); 219 + self 220 + } 221 + /// Set the `thumbnail` field to an Option value (optional) 222 + pub fn maybe_thumbnail( 223 + mut self, 224 + value: Option<jacquard_common::types::blob::BlobRef<'a>>, 225 + ) -> Self { 226 + self.__unsafe_private_named.4 = value; 227 + self 228 + } 229 + } 230 + 231 + impl<'a, S: tape_state::State> TapeBuilder<'a, S> { 232 + /// Set the `video` field (optional) 233 + pub fn video( 234 + mut self, 235 + value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>, 236 + ) -> Self { 237 + self.__unsafe_private_named.5 = value.into(); 238 + self 239 + } 240 + /// Set the `video` field to an Option value (optional) 241 + pub fn maybe_video( 242 + mut self, 243 + value: Option<jacquard_common::types::blob::BlobRef<'a>>, 244 + ) -> Self { 245 + self.__unsafe_private_named.5 = value; 246 + self 247 + } 248 + } 249 + 250 + impl<'a, S> TapeBuilder<'a, S> 251 + where 252 + S: tape_state::State, 253 + S::When: tape_state::IsUnset, 254 + { 255 + /// Set the `when` field (required) 256 + pub fn when( 257 + mut self, 258 + value: impl Into<jacquard_common::types::string::Datetime>, 259 + ) -> TapeBuilder<'a, tape_state::SetWhen<S>> { 260 + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 261 + TapeBuilder { 262 + _phantom_state: ::core::marker::PhantomData, 263 + __unsafe_private_named: self.__unsafe_private_named, 264 + _phantom: ::core::marker::PhantomData, 265 + } 266 + } 267 + } 268 + 269 + impl<'a, S: tape_state::State> TapeBuilder<'a, S> { 270 + /// Set the `zipUrl` field (optional) 271 + pub fn zip_url( 272 + mut self, 273 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 274 + ) -> Self { 275 + self.__unsafe_private_named.7 = value.into(); 276 + self 277 + } 278 + /// Set the `zipUrl` field to an Option value (optional) 279 + pub fn maybe_zip_url(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 280 + self.__unsafe_private_named.7 = value; 281 + self 282 + } 283 + } 284 + 285 + impl<'a, S> TapeBuilder<'a, S> 286 + where 287 + S: tape_state::State, 288 + S::Slug: tape_state::IsSet, 289 + S::Code: tape_state::IsSet, 290 + S::When: tape_state::IsSet, 291 + { 292 + /// Build the final struct 293 + pub fn build(self) -> Tape<'a> { 294 + Tape { 295 + ac_url: self.__unsafe_private_named.0, 296 + code: self.__unsafe_private_named.1.unwrap(), 297 + r#ref: self.__unsafe_private_named.2, 298 + slug: self.__unsafe_private_named.3.unwrap(), 299 + thumbnail: self.__unsafe_private_named.4, 300 + video: self.__unsafe_private_named.5, 301 + when: self.__unsafe_private_named.6.unwrap(), 302 + zip_url: self.__unsafe_private_named.7, 303 + extra_data: Default::default(), 304 + } 305 + } 306 + /// Build the final struct with custom extra_data 307 + pub fn build_with_data( 308 + self, 309 + extra_data: std::collections::BTreeMap< 310 + jacquard_common::smol_str::SmolStr, 311 + jacquard_common::types::value::Data<'a>, 312 + >, 313 + ) -> Tape<'a> { 314 + Tape { 315 + ac_url: self.__unsafe_private_named.0, 316 + code: self.__unsafe_private_named.1.unwrap(), 317 + r#ref: self.__unsafe_private_named.2, 318 + slug: self.__unsafe_private_named.3.unwrap(), 319 + thumbnail: self.__unsafe_private_named.4, 320 + video: self.__unsafe_private_named.5, 321 + when: self.__unsafe_private_named.6.unwrap(), 322 + zip_url: self.__unsafe_private_named.7, 323 + extra_data: Some(extra_data), 324 + } 325 + } 326 + } 327 + 328 + impl<'a> Tape<'a> { 329 + pub fn uri( 330 + uri: impl Into<jacquard_common::CowStr<'a>>, 331 + ) -> Result< 332 + jacquard_common::types::uri::RecordUri<'a, TapeRecord>, 333 + jacquard_common::types::uri::UriError, 334 + > { 335 + jacquard_common::types::uri::RecordUri::try_from_uri( 336 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 337 + ) 338 + } 339 + } 340 + 341 + /// Typed wrapper for GetRecord response with this collection's record type. 342 + #[derive( 343 + serde::Serialize, 344 + serde::Deserialize, 345 + Debug, 346 + Clone, 347 + PartialEq, 348 + Eq, 349 + jacquard_derive::IntoStatic 350 + )] 351 + #[serde(rename_all = "camelCase")] 352 + pub struct TapeGetRecordOutput<'a> { 353 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 354 + #[serde(borrow)] 355 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 356 + #[serde(borrow)] 357 + pub uri: jacquard_common::types::string::AtUri<'a>, 358 + #[serde(borrow)] 359 + pub value: Tape<'a>, 360 + } 361 + 362 + impl From<TapeGetRecordOutput<'_>> for Tape<'_> { 363 + fn from(output: TapeGetRecordOutput<'_>) -> Self { 364 + use jacquard_common::IntoStatic; 365 + output.value.into_static() 366 + } 367 + } 368 + 369 + impl jacquard_common::types::collection::Collection for Tape<'_> { 370 + const NSID: &'static str = "computer.aesthetic.tape"; 371 + type Record = TapeRecord; 372 + } 373 + 374 + /// Marker type for deserializing records from this collection. 375 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 376 + pub struct TapeRecord; 377 + impl jacquard_common::xrpc::XrpcResp for TapeRecord { 378 + const NSID: &'static str = "computer.aesthetic.tape"; 379 + const ENCODING: &'static str = "application/json"; 380 + type Output<'de> = TapeGetRecordOutput<'de>; 381 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 382 + } 383 + 384 + impl jacquard_common::types::collection::Collection for TapeRecord { 385 + const NSID: &'static str = "computer.aesthetic.tape"; 386 + type Record = TapeRecord; 387 + } 388 + 389 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Tape<'a> { 390 + fn nsid() -> &'static str { 391 + "computer.aesthetic.tape" 392 + } 393 + fn def_name() -> &'static str { 394 + "main" 395 + } 396 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 397 + lexicon_doc_computer_aesthetic_tape() 398 + } 399 + fn validate( 400 + &self, 401 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 402 + Ok(()) 403 + } 404 + } 405 + 406 + fn lexicon_doc_computer_aesthetic_tape() -> ::jacquard_lexicon::lexicon::LexiconDoc< 407 + 'static, 408 + > { 409 + ::jacquard_lexicon::lexicon::LexiconDoc { 410 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 411 + id: ::jacquard_common::CowStr::new_static("computer.aesthetic.tape"), 412 + revision: None, 413 + description: None, 414 + defs: { 415 + let mut map = ::std::collections::BTreeMap::new(); 416 + map.insert( 417 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 418 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 419 + description: None, 420 + key: Some(::jacquard_common::CowStr::new_static("tid")), 421 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 422 + description: None, 423 + required: Some( 424 + vec![ 425 + ::jacquard_common::smol_str::SmolStr::new_static("slug"), 426 + ::jacquard_common::smol_str::SmolStr::new_static("code"), 427 + ::jacquard_common::smol_str::SmolStr::new_static("when") 428 + ], 429 + ), 430 + nullable: None, 431 + properties: { 432 + #[allow(unused_mut)] 433 + let mut map = ::std::collections::BTreeMap::new(); 434 + map.insert( 435 + ::jacquard_common::smol_str::SmolStr::new_static("acUrl"), 436 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 437 + description: Some( 438 + ::jacquard_common::CowStr::new_static( 439 + "Permanent link to view on aesthetic.computer (e.g., https://aesthetic.computer/!a3x)", 440 + ), 441 + ), 442 + format: None, 443 + default: None, 444 + min_length: None, 445 + max_length: None, 446 + min_graphemes: None, 447 + max_graphemes: None, 448 + r#enum: None, 449 + r#const: None, 450 + known_values: None, 451 + }), 452 + ); 453 + map.insert( 454 + ::jacquard_common::smol_str::SmolStr::new_static("code"), 455 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 456 + description: Some( 457 + ::jacquard_common::CowStr::new_static( 458 + "Short alphanumeric code for easy lookup (e.g., 'a3x')", 459 + ), 460 + ), 461 + format: None, 462 + default: None, 463 + min_length: None, 464 + max_length: None, 465 + min_graphemes: None, 466 + max_graphemes: None, 467 + r#enum: None, 468 + r#const: None, 469 + known_values: None, 470 + }), 471 + ); 472 + map.insert( 473 + ::jacquard_common::smol_str::SmolStr::new_static("ref"), 474 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 475 + description: Some( 476 + ::jacquard_common::CowStr::new_static( 477 + "MongoDB ObjectId reference for bi-directional sync", 478 + ), 479 + ), 480 + format: None, 481 + default: None, 482 + min_length: None, 483 + max_length: None, 484 + min_graphemes: None, 485 + max_graphemes: None, 486 + r#enum: None, 487 + r#const: None, 488 + known_values: None, 489 + }), 490 + ); 491 + map.insert( 492 + ::jacquard_common::smol_str::SmolStr::new_static("slug"), 493 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 494 + description: Some( 495 + ::jacquard_common::CowStr::new_static( 496 + "The unique slug identifier for this tape (e.g., wand-1729177200000)", 497 + ), 498 + ), 499 + format: None, 500 + default: None, 501 + min_length: None, 502 + max_length: None, 503 + min_graphemes: None, 504 + max_graphemes: None, 505 + r#enum: None, 506 + r#const: None, 507 + known_values: None, 508 + }), 509 + ); 510 + map.insert( 511 + ::jacquard_common::smol_str::SmolStr::new_static( 512 + "thumbnail", 513 + ), 514 + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 515 + description: None, 516 + accept: None, 517 + max_size: None, 518 + }), 519 + ); 520 + map.insert( 521 + ::jacquard_common::smol_str::SmolStr::new_static("video"), 522 + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 523 + description: None, 524 + accept: None, 525 + max_size: None, 526 + }), 527 + ); 528 + map.insert( 529 + ::jacquard_common::smol_str::SmolStr::new_static("when"), 530 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 531 + description: Some( 532 + ::jacquard_common::CowStr::new_static( 533 + "ISO 8601 timestamp when the tape was created", 534 + ), 535 + ), 536 + format: Some( 537 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 538 + ), 539 + default: None, 540 + min_length: None, 541 + max_length: None, 542 + min_graphemes: None, 543 + max_graphemes: None, 544 + r#enum: None, 545 + r#const: None, 546 + known_values: None, 547 + }), 548 + ); 549 + map.insert( 550 + ::jacquard_common::smol_str::SmolStr::new_static("zipUrl"), 551 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 552 + description: Some( 553 + ::jacquard_common::CowStr::new_static( 554 + "Direct URL to download the original ZIP file with frames and audio", 555 + ), 556 + ), 557 + format: None, 558 + default: None, 559 + min_length: None, 560 + max_length: None, 561 + min_graphemes: None, 562 + max_graphemes: None, 563 + r#enum: None, 564 + r#const: None, 565 + known_values: None, 566 + }), 567 + ); 568 + map 569 + }, 570 + }), 571 + }), 572 + ); 573 + map 574 + }, 575 + } 576 + }
+1
crates/jacquard-api/src/dev_fudgeu/experimental/atforumv1/feed.rs
··· 4 4 // Any manual changes will be overwritten on the next regeneration. 5 5 6 6 pub mod post; 7 + pub mod question; 7 8 pub mod reply;
+658
crates/jacquard-api/src/dev_fudgeu/experimental/atforumv1/feed/question.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: dev.fudgeu.experimental.atforumv1.feed.question 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// An initial question that starts a discussion 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, 12 + serde::Deserialize, 13 + Debug, 14 + Clone, 15 + PartialEq, 16 + Eq, 17 + jacquard_derive::IntoStatic 18 + )] 19 + #[serde(rename_all = "camelCase")] 20 + pub struct Question<'a> { 21 + #[serde(borrow)] 22 + pub content: jacquard_common::CowStr<'a>, 23 + pub created_at: jacquard_common::types::string::Datetime, 24 + #[serde(borrow)] 25 + pub forum: jacquard_common::types::ident::AtIdentifier<'a>, 26 + pub is_open: bool, 27 + #[serde(borrow)] 28 + pub tags: Vec<jacquard_common::CowStr<'a>>, 29 + #[serde(borrow)] 30 + pub title: jacquard_common::CowStr<'a>, 31 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 32 + pub updated_at: Option<jacquard_common::types::string::Datetime>, 33 + } 34 + 35 + pub mod question_state { 36 + 37 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 38 + #[allow(unused)] 39 + use ::core::marker::PhantomData; 40 + mod sealed { 41 + pub trait Sealed {} 42 + } 43 + /// State trait tracking which required fields have been set 44 + pub trait State: sealed::Sealed { 45 + type Title; 46 + type Content; 47 + type CreatedAt; 48 + type Forum; 49 + type Tags; 50 + type IsOpen; 51 + } 52 + /// Empty state - all required fields are unset 53 + pub struct Empty(()); 54 + impl sealed::Sealed for Empty {} 55 + impl State for Empty { 56 + type Title = Unset; 57 + type Content = Unset; 58 + type CreatedAt = Unset; 59 + type Forum = Unset; 60 + type Tags = Unset; 61 + type IsOpen = Unset; 62 + } 63 + ///State transition - sets the `title` field to Set 64 + pub struct SetTitle<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetTitle<S> {} 66 + impl<S: State> State for SetTitle<S> { 67 + type Title = Set<members::title>; 68 + type Content = S::Content; 69 + type CreatedAt = S::CreatedAt; 70 + type Forum = S::Forum; 71 + type Tags = S::Tags; 72 + type IsOpen = S::IsOpen; 73 + } 74 + ///State transition - sets the `content` field to Set 75 + pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 76 + impl<S: State> sealed::Sealed for SetContent<S> {} 77 + impl<S: State> State for SetContent<S> { 78 + type Title = S::Title; 79 + type Content = Set<members::content>; 80 + type CreatedAt = S::CreatedAt; 81 + type Forum = S::Forum; 82 + type Tags = S::Tags; 83 + type IsOpen = S::IsOpen; 84 + } 85 + ///State transition - sets the `created_at` field to Set 86 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 87 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 88 + impl<S: State> State for SetCreatedAt<S> { 89 + type Title = S::Title; 90 + type Content = S::Content; 91 + type CreatedAt = Set<members::created_at>; 92 + type Forum = S::Forum; 93 + type Tags = S::Tags; 94 + type IsOpen = S::IsOpen; 95 + } 96 + ///State transition - sets the `forum` field to Set 97 + pub struct SetForum<S: State = Empty>(PhantomData<fn() -> S>); 98 + impl<S: State> sealed::Sealed for SetForum<S> {} 99 + impl<S: State> State for SetForum<S> { 100 + type Title = S::Title; 101 + type Content = S::Content; 102 + type CreatedAt = S::CreatedAt; 103 + type Forum = Set<members::forum>; 104 + type Tags = S::Tags; 105 + type IsOpen = S::IsOpen; 106 + } 107 + ///State transition - sets the `tags` field to Set 108 + pub struct SetTags<S: State = Empty>(PhantomData<fn() -> S>); 109 + impl<S: State> sealed::Sealed for SetTags<S> {} 110 + impl<S: State> State for SetTags<S> { 111 + type Title = S::Title; 112 + type Content = S::Content; 113 + type CreatedAt = S::CreatedAt; 114 + type Forum = S::Forum; 115 + type Tags = Set<members::tags>; 116 + type IsOpen = S::IsOpen; 117 + } 118 + ///State transition - sets the `is_open` field to Set 119 + pub struct SetIsOpen<S: State = Empty>(PhantomData<fn() -> S>); 120 + impl<S: State> sealed::Sealed for SetIsOpen<S> {} 121 + impl<S: State> State for SetIsOpen<S> { 122 + type Title = S::Title; 123 + type Content = S::Content; 124 + type CreatedAt = S::CreatedAt; 125 + type Forum = S::Forum; 126 + type Tags = S::Tags; 127 + type IsOpen = Set<members::is_open>; 128 + } 129 + /// Marker types for field names 130 + #[allow(non_camel_case_types)] 131 + pub mod members { 132 + ///Marker type for the `title` field 133 + pub struct title(()); 134 + ///Marker type for the `content` field 135 + pub struct content(()); 136 + ///Marker type for the `created_at` field 137 + pub struct created_at(()); 138 + ///Marker type for the `forum` field 139 + pub struct forum(()); 140 + ///Marker type for the `tags` field 141 + pub struct tags(()); 142 + ///Marker type for the `is_open` field 143 + pub struct is_open(()); 144 + } 145 + } 146 + 147 + /// Builder for constructing an instance of this type 148 + pub struct QuestionBuilder<'a, S: question_state::State> { 149 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 150 + __unsafe_private_named: ( 151 + ::core::option::Option<jacquard_common::CowStr<'a>>, 152 + ::core::option::Option<jacquard_common::types::string::Datetime>, 153 + ::core::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>, 154 + ::core::option::Option<bool>, 155 + ::core::option::Option<Vec<jacquard_common::CowStr<'a>>>, 156 + ::core::option::Option<jacquard_common::CowStr<'a>>, 157 + ::core::option::Option<jacquard_common::types::string::Datetime>, 158 + ), 159 + _phantom: ::core::marker::PhantomData<&'a ()>, 160 + } 161 + 162 + impl<'a> Question<'a> { 163 + /// Create a new builder for this type 164 + pub fn new() -> QuestionBuilder<'a, question_state::Empty> { 165 + QuestionBuilder::new() 166 + } 167 + } 168 + 169 + impl<'a> QuestionBuilder<'a, question_state::Empty> { 170 + /// Create a new builder with all fields unset 171 + pub fn new() -> Self { 172 + QuestionBuilder { 173 + _phantom_state: ::core::marker::PhantomData, 174 + __unsafe_private_named: (None, None, None, None, None, None, None), 175 + _phantom: ::core::marker::PhantomData, 176 + } 177 + } 178 + } 179 + 180 + impl<'a, S> QuestionBuilder<'a, S> 181 + where 182 + S: question_state::State, 183 + S::Content: question_state::IsUnset, 184 + { 185 + /// Set the `content` field (required) 186 + pub fn content( 187 + mut self, 188 + value: impl Into<jacquard_common::CowStr<'a>>, 189 + ) -> QuestionBuilder<'a, question_state::SetContent<S>> { 190 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 191 + QuestionBuilder { 192 + _phantom_state: ::core::marker::PhantomData, 193 + __unsafe_private_named: self.__unsafe_private_named, 194 + _phantom: ::core::marker::PhantomData, 195 + } 196 + } 197 + } 198 + 199 + impl<'a, S> QuestionBuilder<'a, S> 200 + where 201 + S: question_state::State, 202 + S::CreatedAt: question_state::IsUnset, 203 + { 204 + /// Set the `createdAt` field (required) 205 + pub fn created_at( 206 + mut self, 207 + value: impl Into<jacquard_common::types::string::Datetime>, 208 + ) -> QuestionBuilder<'a, question_state::SetCreatedAt<S>> { 209 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 210 + QuestionBuilder { 211 + _phantom_state: ::core::marker::PhantomData, 212 + __unsafe_private_named: self.__unsafe_private_named, 213 + _phantom: ::core::marker::PhantomData, 214 + } 215 + } 216 + } 217 + 218 + impl<'a, S> QuestionBuilder<'a, S> 219 + where 220 + S: question_state::State, 221 + S::Forum: question_state::IsUnset, 222 + { 223 + /// Set the `forum` field (required) 224 + pub fn forum( 225 + mut self, 226 + value: impl Into<jacquard_common::types::ident::AtIdentifier<'a>>, 227 + ) -> QuestionBuilder<'a, question_state::SetForum<S>> { 228 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 229 + QuestionBuilder { 230 + _phantom_state: ::core::marker::PhantomData, 231 + __unsafe_private_named: self.__unsafe_private_named, 232 + _phantom: ::core::marker::PhantomData, 233 + } 234 + } 235 + } 236 + 237 + impl<'a, S> QuestionBuilder<'a, S> 238 + where 239 + S: question_state::State, 240 + S::IsOpen: question_state::IsUnset, 241 + { 242 + /// Set the `isOpen` field (required) 243 + pub fn is_open( 244 + mut self, 245 + value: impl Into<bool>, 246 + ) -> QuestionBuilder<'a, question_state::SetIsOpen<S>> { 247 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 248 + QuestionBuilder { 249 + _phantom_state: ::core::marker::PhantomData, 250 + __unsafe_private_named: self.__unsafe_private_named, 251 + _phantom: ::core::marker::PhantomData, 252 + } 253 + } 254 + } 255 + 256 + impl<'a, S> QuestionBuilder<'a, S> 257 + where 258 + S: question_state::State, 259 + S::Tags: question_state::IsUnset, 260 + { 261 + /// Set the `tags` field (required) 262 + pub fn tags( 263 + mut self, 264 + value: impl Into<Vec<jacquard_common::CowStr<'a>>>, 265 + ) -> QuestionBuilder<'a, question_state::SetTags<S>> { 266 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 267 + QuestionBuilder { 268 + _phantom_state: ::core::marker::PhantomData, 269 + __unsafe_private_named: self.__unsafe_private_named, 270 + _phantom: ::core::marker::PhantomData, 271 + } 272 + } 273 + } 274 + 275 + impl<'a, S> QuestionBuilder<'a, S> 276 + where 277 + S: question_state::State, 278 + S::Title: question_state::IsUnset, 279 + { 280 + /// Set the `title` field (required) 281 + pub fn title( 282 + mut self, 283 + value: impl Into<jacquard_common::CowStr<'a>>, 284 + ) -> QuestionBuilder<'a, question_state::SetTitle<S>> { 285 + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 286 + QuestionBuilder { 287 + _phantom_state: ::core::marker::PhantomData, 288 + __unsafe_private_named: self.__unsafe_private_named, 289 + _phantom: ::core::marker::PhantomData, 290 + } 291 + } 292 + } 293 + 294 + impl<'a, S: question_state::State> QuestionBuilder<'a, S> { 295 + /// Set the `updatedAt` field (optional) 296 + pub fn updated_at( 297 + mut self, 298 + value: impl Into<Option<jacquard_common::types::string::Datetime>>, 299 + ) -> Self { 300 + self.__unsafe_private_named.6 = value.into(); 301 + self 302 + } 303 + /// Set the `updatedAt` field to an Option value (optional) 304 + pub fn maybe_updated_at( 305 + mut self, 306 + value: Option<jacquard_common::types::string::Datetime>, 307 + ) -> Self { 308 + self.__unsafe_private_named.6 = value; 309 + self 310 + } 311 + } 312 + 313 + impl<'a, S> QuestionBuilder<'a, S> 314 + where 315 + S: question_state::State, 316 + S::Title: question_state::IsSet, 317 + S::Content: question_state::IsSet, 318 + S::CreatedAt: question_state::IsSet, 319 + S::Forum: question_state::IsSet, 320 + S::Tags: question_state::IsSet, 321 + S::IsOpen: question_state::IsSet, 322 + { 323 + /// Build the final struct 324 + pub fn build(self) -> Question<'a> { 325 + Question { 326 + content: self.__unsafe_private_named.0.unwrap(), 327 + created_at: self.__unsafe_private_named.1.unwrap(), 328 + forum: self.__unsafe_private_named.2.unwrap(), 329 + is_open: self.__unsafe_private_named.3.unwrap(), 330 + tags: self.__unsafe_private_named.4.unwrap(), 331 + title: self.__unsafe_private_named.5.unwrap(), 332 + updated_at: self.__unsafe_private_named.6, 333 + extra_data: Default::default(), 334 + } 335 + } 336 + /// Build the final struct with custom extra_data 337 + pub fn build_with_data( 338 + self, 339 + extra_data: std::collections::BTreeMap< 340 + jacquard_common::smol_str::SmolStr, 341 + jacquard_common::types::value::Data<'a>, 342 + >, 343 + ) -> Question<'a> { 344 + Question { 345 + content: self.__unsafe_private_named.0.unwrap(), 346 + created_at: self.__unsafe_private_named.1.unwrap(), 347 + forum: self.__unsafe_private_named.2.unwrap(), 348 + is_open: self.__unsafe_private_named.3.unwrap(), 349 + tags: self.__unsafe_private_named.4.unwrap(), 350 + title: self.__unsafe_private_named.5.unwrap(), 351 + updated_at: self.__unsafe_private_named.6, 352 + extra_data: Some(extra_data), 353 + } 354 + } 355 + } 356 + 357 + impl<'a> Question<'a> { 358 + pub fn uri( 359 + uri: impl Into<jacquard_common::CowStr<'a>>, 360 + ) -> Result< 361 + jacquard_common::types::uri::RecordUri<'a, QuestionRecord>, 362 + jacquard_common::types::uri::UriError, 363 + > { 364 + jacquard_common::types::uri::RecordUri::try_from_uri( 365 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 366 + ) 367 + } 368 + } 369 + 370 + /// Typed wrapper for GetRecord response with this collection's record type. 371 + #[derive( 372 + serde::Serialize, 373 + serde::Deserialize, 374 + Debug, 375 + Clone, 376 + PartialEq, 377 + Eq, 378 + jacquard_derive::IntoStatic 379 + )] 380 + #[serde(rename_all = "camelCase")] 381 + pub struct QuestionGetRecordOutput<'a> { 382 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 383 + #[serde(borrow)] 384 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 385 + #[serde(borrow)] 386 + pub uri: jacquard_common::types::string::AtUri<'a>, 387 + #[serde(borrow)] 388 + pub value: Question<'a>, 389 + } 390 + 391 + impl From<QuestionGetRecordOutput<'_>> for Question<'_> { 392 + fn from(output: QuestionGetRecordOutput<'_>) -> Self { 393 + use jacquard_common::IntoStatic; 394 + output.value.into_static() 395 + } 396 + } 397 + 398 + impl jacquard_common::types::collection::Collection for Question<'_> { 399 + const NSID: &'static str = "dev.fudgeu.experimental.atforumv1.feed.question"; 400 + type Record = QuestionRecord; 401 + } 402 + 403 + /// Marker type for deserializing records from this collection. 404 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 405 + pub struct QuestionRecord; 406 + impl jacquard_common::xrpc::XrpcResp for QuestionRecord { 407 + const NSID: &'static str = "dev.fudgeu.experimental.atforumv1.feed.question"; 408 + const ENCODING: &'static str = "application/json"; 409 + type Output<'de> = QuestionGetRecordOutput<'de>; 410 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 411 + } 412 + 413 + impl jacquard_common::types::collection::Collection for QuestionRecord { 414 + const NSID: &'static str = "dev.fudgeu.experimental.atforumv1.feed.question"; 415 + type Record = QuestionRecord; 416 + } 417 + 418 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Question<'a> { 419 + fn nsid() -> &'static str { 420 + "dev.fudgeu.experimental.atforumv1.feed.question" 421 + } 422 + fn def_name() -> &'static str { 423 + "main" 424 + } 425 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 426 + lexicon_doc_dev_fudgeu_experimental_atforumv1_feed_question() 427 + } 428 + fn validate( 429 + &self, 430 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 431 + { 432 + let value = &self.content; 433 + #[allow(unused_comparisons)] 434 + if <str>::len(value.as_ref()) > 10000usize { 435 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 436 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 437 + "content", 438 + ), 439 + max: 10000usize, 440 + actual: <str>::len(value.as_ref()), 441 + }); 442 + } 443 + } 444 + { 445 + let value = &self.content; 446 + #[allow(unused_comparisons)] 447 + if <str>::len(value.as_ref()) < 1usize { 448 + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { 449 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 450 + "content", 451 + ), 452 + min: 1usize, 453 + actual: <str>::len(value.as_ref()), 454 + }); 455 + } 456 + } 457 + { 458 + let value = &self.tags; 459 + #[allow(unused_comparisons)] 460 + if value.len() > 20usize { 461 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 462 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 463 + "tags", 464 + ), 465 + max: 20usize, 466 + actual: value.len(), 467 + }); 468 + } 469 + } 470 + { 471 + let value = &self.title; 472 + #[allow(unused_comparisons)] 473 + if <str>::len(value.as_ref()) > 100usize { 474 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 475 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 476 + "title", 477 + ), 478 + max: 100usize, 479 + actual: <str>::len(value.as_ref()), 480 + }); 481 + } 482 + } 483 + { 484 + let value = &self.title; 485 + #[allow(unused_comparisons)] 486 + if <str>::len(value.as_ref()) < 1usize { 487 + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { 488 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 489 + "title", 490 + ), 491 + min: 1usize, 492 + actual: <str>::len(value.as_ref()), 493 + }); 494 + } 495 + } 496 + Ok(()) 497 + } 498 + } 499 + 500 + fn lexicon_doc_dev_fudgeu_experimental_atforumv1_feed_question() -> ::jacquard_lexicon::lexicon::LexiconDoc< 501 + 'static, 502 + > { 503 + ::jacquard_lexicon::lexicon::LexiconDoc { 504 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 505 + id: ::jacquard_common::CowStr::new_static( 506 + "dev.fudgeu.experimental.atforumv1.feed.question", 507 + ), 508 + revision: None, 509 + description: None, 510 + defs: { 511 + let mut map = ::std::collections::BTreeMap::new(); 512 + map.insert( 513 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 514 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 515 + description: Some( 516 + ::jacquard_common::CowStr::new_static( 517 + "An initial question that starts a discussion", 518 + ), 519 + ), 520 + key: Some(::jacquard_common::CowStr::new_static("tid")), 521 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 522 + description: None, 523 + required: Some( 524 + vec![ 525 + ::jacquard_common::smol_str::SmolStr::new_static("title"), 526 + ::jacquard_common::smol_str::SmolStr::new_static("content"), 527 + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), 528 + ::jacquard_common::smol_str::SmolStr::new_static("forum"), 529 + ::jacquard_common::smol_str::SmolStr::new_static("tags"), 530 + ::jacquard_common::smol_str::SmolStr::new_static("isOpen") 531 + ], 532 + ), 533 + nullable: None, 534 + properties: { 535 + #[allow(unused_mut)] 536 + let mut map = ::std::collections::BTreeMap::new(); 537 + map.insert( 538 + ::jacquard_common::smol_str::SmolStr::new_static("content"), 539 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 540 + description: None, 541 + format: None, 542 + default: None, 543 + min_length: Some(1usize), 544 + max_length: Some(10000usize), 545 + min_graphemes: None, 546 + max_graphemes: None, 547 + r#enum: None, 548 + r#const: None, 549 + known_values: None, 550 + }), 551 + ); 552 + map.insert( 553 + ::jacquard_common::smol_str::SmolStr::new_static( 554 + "createdAt", 555 + ), 556 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 557 + description: None, 558 + format: Some( 559 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 560 + ), 561 + default: None, 562 + min_length: None, 563 + max_length: None, 564 + min_graphemes: None, 565 + max_graphemes: None, 566 + r#enum: None, 567 + r#const: None, 568 + known_values: None, 569 + }), 570 + ); 571 + map.insert( 572 + ::jacquard_common::smol_str::SmolStr::new_static("forum"), 573 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 574 + description: None, 575 + format: Some( 576 + ::jacquard_lexicon::lexicon::LexStringFormat::AtIdentifier, 577 + ), 578 + default: None, 579 + min_length: None, 580 + max_length: None, 581 + min_graphemes: None, 582 + max_graphemes: None, 583 + r#enum: None, 584 + r#const: None, 585 + known_values: None, 586 + }), 587 + ); 588 + map.insert( 589 + ::jacquard_common::smol_str::SmolStr::new_static("isOpen"), 590 + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 591 + description: None, 592 + default: None, 593 + r#const: None, 594 + }), 595 + ); 596 + map.insert( 597 + ::jacquard_common::smol_str::SmolStr::new_static("tags"), 598 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 599 + description: None, 600 + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 601 + description: None, 602 + format: None, 603 + default: None, 604 + min_length: Some(1usize), 605 + max_length: Some(25usize), 606 + min_graphemes: None, 607 + max_graphemes: None, 608 + r#enum: None, 609 + r#const: None, 610 + known_values: None, 611 + }), 612 + min_length: None, 613 + max_length: Some(20usize), 614 + }), 615 + ); 616 + map.insert( 617 + ::jacquard_common::smol_str::SmolStr::new_static("title"), 618 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 619 + description: None, 620 + format: None, 621 + default: None, 622 + min_length: Some(1usize), 623 + max_length: Some(100usize), 624 + min_graphemes: None, 625 + max_graphemes: None, 626 + r#enum: None, 627 + r#const: None, 628 + known_values: None, 629 + }), 630 + ); 631 + map.insert( 632 + ::jacquard_common::smol_str::SmolStr::new_static( 633 + "updatedAt", 634 + ), 635 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 636 + description: None, 637 + format: Some( 638 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 639 + ), 640 + default: None, 641 + min_length: None, 642 + max_length: None, 643 + min_graphemes: None, 644 + max_graphemes: None, 645 + r#enum: None, 646 + r#const: None, 647 + known_values: None, 648 + }), 649 + ); 650 + map 651 + }, 652 + }), 653 + }), 654 + ); 655 + map 656 + }, 657 + } 658 + }
+6 -6
crates/jacquard-api/src/lib.rs
··· 52 52 #[cfg(feature = "com_bad_example")] 53 53 pub mod com_bad_example; 54 54 55 - #[cfg(feature = "com_crabdance")] 56 - pub mod com_crabdance; 57 - 58 55 #[cfg(feature = "com_shinolabs")] 59 56 pub mod com_shinolabs; 60 57 ··· 64 61 #[cfg(feature = "community_lexicon")] 65 62 pub mod community_lexicon; 66 63 64 + #[cfg(feature = "computer_aesthetic")] 65 + pub mod computer_aesthetic; 66 + 67 67 #[cfg(feature = "dev_baileytownsend")] 68 68 pub mod dev_baileytownsend; 69 69 ··· 75 75 76 76 #[cfg(feature = "dev_regnault")] 77 77 pub mod dev_regnault; 78 - 79 - #[cfg(feature = "events_smokesignal")] 80 - pub mod events_smokesignal; 81 78 82 79 #[cfg(feature = "fm_teal")] 83 80 pub mod fm_teal; ··· 117 114 118 115 #[cfg(feature = "org_devcon")] 119 116 pub mod org_devcon; 117 + 118 + #[cfg(feature = "org_farmapps")] 119 + pub mod org_farmapps; 120 120 121 121 #[cfg(feature = "org_robocracy")] 122 122 pub mod org_robocracy;
+6
crates/jacquard-api/src/org_farmapps.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // This file was automatically generated from Lexicon schemas. 4 + // Any manual changes will be overwritten on the next regeneration. 5 + 6 + pub mod temp;
+7
crates/jacquard-api/src/org_farmapps/temp.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // This file was automatically generated from Lexicon schemas. 4 + // Any manual changes will be overwritten on the next regeneration. 5 + 6 + pub mod agroconnect; 7 + pub mod ecrop;
+6
crates/jacquard-api/src/org_farmapps/temp/agroconnect.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // This file was automatically generated from Lexicon schemas. 4 + // Any manual changes will be overwritten on the next regeneration. 5 + 6 + pub mod cl022;
+704
crates/jacquard-api/src/org_farmapps/temp/agroconnect/cl022.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: org.farmapps.temp.agroconnect.cl022 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// Fertilizer codelist 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, 12 + serde::Deserialize, 13 + Debug, 14 + Clone, 15 + PartialEq, 16 + Eq, 17 + jacquard_derive::IntoStatic 18 + )] 19 + #[serde(rename_all = "camelCase")] 20 + pub struct Cl022<'a> { 21 + /// Date when added to the list 22 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 + pub added: Option<jacquard_common::types::string::Datetime>, 24 + /// Comment 25 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 26 + #[serde(borrow)] 27 + pub comment: Option<jacquard_common::CowStr<'a>>, 28 + /// Denominator used for all fertilizer content properties 29 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 30 + pub denominator: Option<i64>, 31 + /// Description / name of the fertilizer 32 + #[serde(borrow)] 33 + pub description: jacquard_common::CowStr<'a>, 34 + /// Id off the fertilizer 35 + #[serde(borrow)] 36 + pub id: crate::org_farmapps::temp::ecrop::CodeType<'a>, 37 + /// <unit> Potassium oxide content of this fertilizer 38 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 39 + pub k2o: Option<i64>, 40 + /// <unit> Nitrogen content of this fertilizer 41 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 42 + pub n: Option<i64>, 43 + /// <unit> Phosphate content of this fertilizer 44 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 45 + pub p2o5: Option<i64>, 46 + /// Fertlizer type 47 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 48 + #[serde(borrow)] 49 + pub r#type: Option<jacquard_common::CowStr<'a>>, 50 + /// Unit 51 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 52 + #[serde(borrow)] 53 + pub unit: Option<jacquard_common::CowStr<'a>>, 54 + /// Date when updated 55 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 56 + pub updated: Option<jacquard_common::types::string::Datetime>, 57 + } 58 + 59 + pub mod cl022_state { 60 + 61 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 62 + #[allow(unused)] 63 + use ::core::marker::PhantomData; 64 + mod sealed { 65 + pub trait Sealed {} 66 + } 67 + /// State trait tracking which required fields have been set 68 + pub trait State: sealed::Sealed { 69 + type Id; 70 + type Description; 71 + } 72 + /// Empty state - all required fields are unset 73 + pub struct Empty(()); 74 + impl sealed::Sealed for Empty {} 75 + impl State for Empty { 76 + type Id = Unset; 77 + type Description = Unset; 78 + } 79 + ///State transition - sets the `id` field to Set 80 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 81 + impl<S: State> sealed::Sealed for SetId<S> {} 82 + impl<S: State> State for SetId<S> { 83 + type Id = Set<members::id>; 84 + type Description = S::Description; 85 + } 86 + ///State transition - sets the `description` field to Set 87 + pub struct SetDescription<S: State = Empty>(PhantomData<fn() -> S>); 88 + impl<S: State> sealed::Sealed for SetDescription<S> {} 89 + impl<S: State> State for SetDescription<S> { 90 + type Id = S::Id; 91 + type Description = Set<members::description>; 92 + } 93 + /// Marker types for field names 94 + #[allow(non_camel_case_types)] 95 + pub mod members { 96 + ///Marker type for the `id` field 97 + pub struct id(()); 98 + ///Marker type for the `description` field 99 + pub struct description(()); 100 + } 101 + } 102 + 103 + /// Builder for constructing an instance of this type 104 + pub struct Cl022Builder<'a, S: cl022_state::State> { 105 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 106 + __unsafe_private_named: ( 107 + ::core::option::Option<jacquard_common::types::string::Datetime>, 108 + ::core::option::Option<jacquard_common::CowStr<'a>>, 109 + ::core::option::Option<i64>, 110 + ::core::option::Option<jacquard_common::CowStr<'a>>, 111 + ::core::option::Option<crate::org_farmapps::temp::ecrop::CodeType<'a>>, 112 + ::core::option::Option<i64>, 113 + ::core::option::Option<i64>, 114 + ::core::option::Option<i64>, 115 + ::core::option::Option<jacquard_common::CowStr<'a>>, 116 + ::core::option::Option<jacquard_common::CowStr<'a>>, 117 + ::core::option::Option<jacquard_common::types::string::Datetime>, 118 + ), 119 + _phantom: ::core::marker::PhantomData<&'a ()>, 120 + } 121 + 122 + impl<'a> Cl022<'a> { 123 + /// Create a new builder for this type 124 + pub fn new() -> Cl022Builder<'a, cl022_state::Empty> { 125 + Cl022Builder::new() 126 + } 127 + } 128 + 129 + impl<'a> Cl022Builder<'a, cl022_state::Empty> { 130 + /// Create a new builder with all fields unset 131 + pub fn new() -> Self { 132 + Cl022Builder { 133 + _phantom_state: ::core::marker::PhantomData, 134 + __unsafe_private_named: ( 135 + None, 136 + None, 137 + None, 138 + None, 139 + None, 140 + None, 141 + None, 142 + None, 143 + None, 144 + None, 145 + None, 146 + ), 147 + _phantom: ::core::marker::PhantomData, 148 + } 149 + } 150 + } 151 + 152 + impl<'a, S: cl022_state::State> Cl022Builder<'a, S> { 153 + /// Set the `added` field (optional) 154 + pub fn added( 155 + mut self, 156 + value: impl Into<Option<jacquard_common::types::string::Datetime>>, 157 + ) -> Self { 158 + self.__unsafe_private_named.0 = value.into(); 159 + self 160 + } 161 + /// Set the `added` field to an Option value (optional) 162 + pub fn maybe_added( 163 + mut self, 164 + value: Option<jacquard_common::types::string::Datetime>, 165 + ) -> Self { 166 + self.__unsafe_private_named.0 = value; 167 + self 168 + } 169 + } 170 + 171 + impl<'a, S: cl022_state::State> Cl022Builder<'a, S> { 172 + /// Set the `comment` field (optional) 173 + pub fn comment( 174 + mut self, 175 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 176 + ) -> Self { 177 + self.__unsafe_private_named.1 = value.into(); 178 + self 179 + } 180 + /// Set the `comment` field to an Option value (optional) 181 + pub fn maybe_comment(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 182 + self.__unsafe_private_named.1 = value; 183 + self 184 + } 185 + } 186 + 187 + impl<'a, S: cl022_state::State> Cl022Builder<'a, S> { 188 + /// Set the `denominator` field (optional) 189 + pub fn denominator(mut self, value: impl Into<Option<i64>>) -> Self { 190 + self.__unsafe_private_named.2 = value.into(); 191 + self 192 + } 193 + /// Set the `denominator` field to an Option value (optional) 194 + pub fn maybe_denominator(mut self, value: Option<i64>) -> Self { 195 + self.__unsafe_private_named.2 = value; 196 + self 197 + } 198 + } 199 + 200 + impl<'a, S> Cl022Builder<'a, S> 201 + where 202 + S: cl022_state::State, 203 + S::Description: cl022_state::IsUnset, 204 + { 205 + /// Set the `description` field (required) 206 + pub fn description( 207 + mut self, 208 + value: impl Into<jacquard_common::CowStr<'a>>, 209 + ) -> Cl022Builder<'a, cl022_state::SetDescription<S>> { 210 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 211 + Cl022Builder { 212 + _phantom_state: ::core::marker::PhantomData, 213 + __unsafe_private_named: self.__unsafe_private_named, 214 + _phantom: ::core::marker::PhantomData, 215 + } 216 + } 217 + } 218 + 219 + impl<'a, S> Cl022Builder<'a, S> 220 + where 221 + S: cl022_state::State, 222 + S::Id: cl022_state::IsUnset, 223 + { 224 + /// Set the `id` field (required) 225 + pub fn id( 226 + mut self, 227 + value: impl Into<crate::org_farmapps::temp::ecrop::CodeType<'a>>, 228 + ) -> Cl022Builder<'a, cl022_state::SetId<S>> { 229 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 230 + Cl022Builder { 231 + _phantom_state: ::core::marker::PhantomData, 232 + __unsafe_private_named: self.__unsafe_private_named, 233 + _phantom: ::core::marker::PhantomData, 234 + } 235 + } 236 + } 237 + 238 + impl<'a, S: cl022_state::State> Cl022Builder<'a, S> { 239 + /// Set the `k2o` field (optional) 240 + pub fn k2o(mut self, value: impl Into<Option<i64>>) -> Self { 241 + self.__unsafe_private_named.5 = value.into(); 242 + self 243 + } 244 + /// Set the `k2o` field to an Option value (optional) 245 + pub fn maybe_k2o(mut self, value: Option<i64>) -> Self { 246 + self.__unsafe_private_named.5 = value; 247 + self 248 + } 249 + } 250 + 251 + impl<'a, S: cl022_state::State> Cl022Builder<'a, S> { 252 + /// Set the `n` field (optional) 253 + pub fn n(mut self, value: impl Into<Option<i64>>) -> Self { 254 + self.__unsafe_private_named.6 = value.into(); 255 + self 256 + } 257 + /// Set the `n` field to an Option value (optional) 258 + pub fn maybe_n(mut self, value: Option<i64>) -> Self { 259 + self.__unsafe_private_named.6 = value; 260 + self 261 + } 262 + } 263 + 264 + impl<'a, S: cl022_state::State> Cl022Builder<'a, S> { 265 + /// Set the `p2o5` field (optional) 266 + pub fn p2o5(mut self, value: impl Into<Option<i64>>) -> Self { 267 + self.__unsafe_private_named.7 = value.into(); 268 + self 269 + } 270 + /// Set the `p2o5` field to an Option value (optional) 271 + pub fn maybe_p2o5(mut self, value: Option<i64>) -> Self { 272 + self.__unsafe_private_named.7 = value; 273 + self 274 + } 275 + } 276 + 277 + impl<'a, S: cl022_state::State> Cl022Builder<'a, S> { 278 + /// Set the `type` field (optional) 279 + pub fn r#type( 280 + mut self, 281 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 282 + ) -> Self { 283 + self.__unsafe_private_named.8 = value.into(); 284 + self 285 + } 286 + /// Set the `type` field to an Option value (optional) 287 + pub fn maybe_type(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 288 + self.__unsafe_private_named.8 = value; 289 + self 290 + } 291 + } 292 + 293 + impl<'a, S: cl022_state::State> Cl022Builder<'a, S> { 294 + /// Set the `unit` field (optional) 295 + pub fn unit( 296 + mut self, 297 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 298 + ) -> Self { 299 + self.__unsafe_private_named.9 = value.into(); 300 + self 301 + } 302 + /// Set the `unit` field to an Option value (optional) 303 + pub fn maybe_unit(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 304 + self.__unsafe_private_named.9 = value; 305 + self 306 + } 307 + } 308 + 309 + impl<'a, S: cl022_state::State> Cl022Builder<'a, S> { 310 + /// Set the `updated` field (optional) 311 + pub fn updated( 312 + mut self, 313 + value: impl Into<Option<jacquard_common::types::string::Datetime>>, 314 + ) -> Self { 315 + self.__unsafe_private_named.10 = value.into(); 316 + self 317 + } 318 + /// Set the `updated` field to an Option value (optional) 319 + pub fn maybe_updated( 320 + mut self, 321 + value: Option<jacquard_common::types::string::Datetime>, 322 + ) -> Self { 323 + self.__unsafe_private_named.10 = value; 324 + self 325 + } 326 + } 327 + 328 + impl<'a, S> Cl022Builder<'a, S> 329 + where 330 + S: cl022_state::State, 331 + S::Id: cl022_state::IsSet, 332 + S::Description: cl022_state::IsSet, 333 + { 334 + /// Build the final struct 335 + pub fn build(self) -> Cl022<'a> { 336 + Cl022 { 337 + added: self.__unsafe_private_named.0, 338 + comment: self.__unsafe_private_named.1, 339 + denominator: self.__unsafe_private_named.2, 340 + description: self.__unsafe_private_named.3.unwrap(), 341 + id: self.__unsafe_private_named.4.unwrap(), 342 + k2o: self.__unsafe_private_named.5, 343 + n: self.__unsafe_private_named.6, 344 + p2o5: self.__unsafe_private_named.7, 345 + r#type: self.__unsafe_private_named.8, 346 + unit: self.__unsafe_private_named.9, 347 + updated: self.__unsafe_private_named.10, 348 + extra_data: Default::default(), 349 + } 350 + } 351 + /// Build the final struct with custom extra_data 352 + pub fn build_with_data( 353 + self, 354 + extra_data: std::collections::BTreeMap< 355 + jacquard_common::smol_str::SmolStr, 356 + jacquard_common::types::value::Data<'a>, 357 + >, 358 + ) -> Cl022<'a> { 359 + Cl022 { 360 + added: self.__unsafe_private_named.0, 361 + comment: self.__unsafe_private_named.1, 362 + denominator: self.__unsafe_private_named.2, 363 + description: self.__unsafe_private_named.3.unwrap(), 364 + id: self.__unsafe_private_named.4.unwrap(), 365 + k2o: self.__unsafe_private_named.5, 366 + n: self.__unsafe_private_named.6, 367 + p2o5: self.__unsafe_private_named.7, 368 + r#type: self.__unsafe_private_named.8, 369 + unit: self.__unsafe_private_named.9, 370 + updated: self.__unsafe_private_named.10, 371 + extra_data: Some(extra_data), 372 + } 373 + } 374 + } 375 + 376 + impl<'a> Cl022<'a> { 377 + pub fn uri( 378 + uri: impl Into<jacquard_common::CowStr<'a>>, 379 + ) -> Result< 380 + jacquard_common::types::uri::RecordUri<'a, Cl022Record>, 381 + jacquard_common::types::uri::UriError, 382 + > { 383 + jacquard_common::types::uri::RecordUri::try_from_uri( 384 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 385 + ) 386 + } 387 + } 388 + 389 + /// Typed wrapper for GetRecord response with this collection's record type. 390 + #[derive( 391 + serde::Serialize, 392 + serde::Deserialize, 393 + Debug, 394 + Clone, 395 + PartialEq, 396 + Eq, 397 + jacquard_derive::IntoStatic 398 + )] 399 + #[serde(rename_all = "camelCase")] 400 + pub struct Cl022GetRecordOutput<'a> { 401 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 402 + #[serde(borrow)] 403 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 404 + #[serde(borrow)] 405 + pub uri: jacquard_common::types::string::AtUri<'a>, 406 + #[serde(borrow)] 407 + pub value: Cl022<'a>, 408 + } 409 + 410 + impl From<Cl022GetRecordOutput<'_>> for Cl022<'_> { 411 + fn from(output: Cl022GetRecordOutput<'_>) -> Self { 412 + use jacquard_common::IntoStatic; 413 + output.value.into_static() 414 + } 415 + } 416 + 417 + impl jacquard_common::types::collection::Collection for Cl022<'_> { 418 + const NSID: &'static str = "org.farmapps.temp.agroconnect.cl022"; 419 + type Record = Cl022Record; 420 + } 421 + 422 + /// Marker type for deserializing records from this collection. 423 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 424 + pub struct Cl022Record; 425 + impl jacquard_common::xrpc::XrpcResp for Cl022Record { 426 + const NSID: &'static str = "org.farmapps.temp.agroconnect.cl022"; 427 + const ENCODING: &'static str = "application/json"; 428 + type Output<'de> = Cl022GetRecordOutput<'de>; 429 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 430 + } 431 + 432 + impl jacquard_common::types::collection::Collection for Cl022Record { 433 + const NSID: &'static str = "org.farmapps.temp.agroconnect.cl022"; 434 + type Record = Cl022Record; 435 + } 436 + 437 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Cl022<'a> { 438 + fn nsid() -> &'static str { 439 + "org.farmapps.temp.agroconnect.cl022" 440 + } 441 + fn def_name() -> &'static str { 442 + "main" 443 + } 444 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 445 + lexicon_doc_org_farmapps_temp_agroconnect_cl022() 446 + } 447 + fn validate( 448 + &self, 449 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 450 + if let Some(ref value) = self.denominator { 451 + if *value < 1i64 { 452 + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { 453 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 454 + "denominator", 455 + ), 456 + min: 1i64, 457 + actual: *value, 458 + }); 459 + } 460 + } 461 + if let Some(ref value) = self.k2o { 462 + if *value < 0i64 { 463 + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { 464 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 465 + "k2o", 466 + ), 467 + min: 0i64, 468 + actual: *value, 469 + }); 470 + } 471 + } 472 + if let Some(ref value) = self.n { 473 + if *value < 0i64 { 474 + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { 475 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 476 + "n", 477 + ), 478 + min: 0i64, 479 + actual: *value, 480 + }); 481 + } 482 + } 483 + if let Some(ref value) = self.p2o5 { 484 + if *value < 0i64 { 485 + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { 486 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 487 + "p2o5", 488 + ), 489 + min: 0i64, 490 + actual: *value, 491 + }); 492 + } 493 + } 494 + Ok(()) 495 + } 496 + } 497 + 498 + fn lexicon_doc_org_farmapps_temp_agroconnect_cl022() -> ::jacquard_lexicon::lexicon::LexiconDoc< 499 + 'static, 500 + > { 501 + ::jacquard_lexicon::lexicon::LexiconDoc { 502 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 503 + id: ::jacquard_common::CowStr::new_static("org.farmapps.temp.agroconnect.cl022"), 504 + revision: None, 505 + description: None, 506 + defs: { 507 + let mut map = ::std::collections::BTreeMap::new(); 508 + map.insert( 509 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 510 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 511 + description: Some( 512 + ::jacquard_common::CowStr::new_static("Fertilizer codelist"), 513 + ), 514 + key: Some(::jacquard_common::CowStr::new_static("any")), 515 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 516 + description: Some( 517 + ::jacquard_common::CowStr::new_static("Codelist ferilizers"), 518 + ), 519 + required: Some( 520 + vec![ 521 + ::jacquard_common::smol_str::SmolStr::new_static("id"), 522 + ::jacquard_common::smol_str::SmolStr::new_static("description") 523 + ], 524 + ), 525 + nullable: None, 526 + properties: { 527 + #[allow(unused_mut)] 528 + let mut map = ::std::collections::BTreeMap::new(); 529 + map.insert( 530 + ::jacquard_common::smol_str::SmolStr::new_static("added"), 531 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 532 + description: Some( 533 + ::jacquard_common::CowStr::new_static( 534 + "Date when added to the list", 535 + ), 536 + ), 537 + format: Some( 538 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 539 + ), 540 + default: None, 541 + min_length: None, 542 + max_length: None, 543 + min_graphemes: None, 544 + max_graphemes: None, 545 + r#enum: None, 546 + r#const: None, 547 + known_values: None, 548 + }), 549 + ); 550 + map.insert( 551 + ::jacquard_common::smol_str::SmolStr::new_static("comment"), 552 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 553 + description: Some( 554 + ::jacquard_common::CowStr::new_static("Comment"), 555 + ), 556 + format: None, 557 + default: None, 558 + min_length: None, 559 + max_length: None, 560 + min_graphemes: None, 561 + max_graphemes: None, 562 + r#enum: None, 563 + r#const: None, 564 + known_values: None, 565 + }), 566 + ); 567 + map.insert( 568 + ::jacquard_common::smol_str::SmolStr::new_static( 569 + "denominator", 570 + ), 571 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 572 + description: None, 573 + default: None, 574 + minimum: Some(1i64), 575 + maximum: None, 576 + r#enum: None, 577 + r#const: None, 578 + }), 579 + ); 580 + map.insert( 581 + ::jacquard_common::smol_str::SmolStr::new_static( 582 + "description", 583 + ), 584 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 585 + description: Some( 586 + ::jacquard_common::CowStr::new_static( 587 + "Description / name of the fertilizer", 588 + ), 589 + ), 590 + format: None, 591 + default: None, 592 + min_length: None, 593 + max_length: None, 594 + min_graphemes: None, 595 + max_graphemes: None, 596 + r#enum: None, 597 + r#const: None, 598 + known_values: None, 599 + }), 600 + ); 601 + map.insert( 602 + ::jacquard_common::smol_str::SmolStr::new_static("id"), 603 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 604 + description: None, 605 + r#ref: ::jacquard_common::CowStr::new_static( 606 + "org.farmapps.temp.ecrop.defs#codeType", 607 + ), 608 + }), 609 + ); 610 + map.insert( 611 + ::jacquard_common::smol_str::SmolStr::new_static("k2o"), 612 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 613 + description: None, 614 + default: None, 615 + minimum: Some(0i64), 616 + maximum: None, 617 + r#enum: None, 618 + r#const: None, 619 + }), 620 + ); 621 + map.insert( 622 + ::jacquard_common::smol_str::SmolStr::new_static("n"), 623 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 624 + description: None, 625 + default: None, 626 + minimum: Some(0i64), 627 + maximum: None, 628 + r#enum: None, 629 + r#const: None, 630 + }), 631 + ); 632 + map.insert( 633 + ::jacquard_common::smol_str::SmolStr::new_static("p2o5"), 634 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 635 + description: None, 636 + default: None, 637 + minimum: Some(0i64), 638 + maximum: None, 639 + r#enum: None, 640 + r#const: None, 641 + }), 642 + ); 643 + map.insert( 644 + ::jacquard_common::smol_str::SmolStr::new_static("type"), 645 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 646 + description: Some( 647 + ::jacquard_common::CowStr::new_static("Fertlizer type"), 648 + ), 649 + format: None, 650 + default: None, 651 + min_length: None, 652 + max_length: None, 653 + min_graphemes: None, 654 + max_graphemes: None, 655 + r#enum: None, 656 + r#const: None, 657 + known_values: None, 658 + }), 659 + ); 660 + map.insert( 661 + ::jacquard_common::smol_str::SmolStr::new_static("unit"), 662 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 663 + description: Some( 664 + ::jacquard_common::CowStr::new_static("Unit "), 665 + ), 666 + format: None, 667 + default: None, 668 + min_length: None, 669 + max_length: None, 670 + min_graphemes: None, 671 + max_graphemes: None, 672 + r#enum: None, 673 + r#const: None, 674 + known_values: None, 675 + }), 676 + ); 677 + map.insert( 678 + ::jacquard_common::smol_str::SmolStr::new_static("updated"), 679 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 680 + description: Some( 681 + ::jacquard_common::CowStr::new_static("Date when updated"), 682 + ), 683 + format: Some( 684 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 685 + ), 686 + default: None, 687 + min_length: None, 688 + max_length: None, 689 + min_graphemes: None, 690 + max_graphemes: None, 691 + r#enum: None, 692 + r#const: None, 693 + known_values: None, 694 + }), 695 + ); 696 + map 697 + }, 698 + }), 699 + }), 700 + ); 701 + map 702 + }, 703 + } 704 + }
+268
crates/jacquard-api/src/org_farmapps/temp/ecrop.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: org.farmapps.temp.ecrop.defs 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// Generic class to represent the code list and code that is used 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, 12 + serde::Deserialize, 13 + Debug, 14 + Clone, 15 + PartialEq, 16 + Eq, 17 + jacquard_derive::IntoStatic 18 + )] 19 + #[serde(rename_all = "camelCase")] 20 + pub struct CodeType<'a> { 21 + #[serde(borrow)] 22 + pub code: jacquard_common::types::string::RecordKey< 23 + jacquard_common::types::string::Rkey<'a>, 24 + >, 25 + /// Identifier of the standard code list that contains the allowed codes. 26 + #[serde(borrow)] 27 + pub list_id: jacquard_common::types::string::Nsid<'a>, 28 + } 29 + 30 + pub mod code_type_state { 31 + 32 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 33 + #[allow(unused)] 34 + use ::core::marker::PhantomData; 35 + mod sealed { 36 + pub trait Sealed {} 37 + } 38 + /// State trait tracking which required fields have been set 39 + pub trait State: sealed::Sealed { 40 + type ListId; 41 + type Code; 42 + } 43 + /// Empty state - all required fields are unset 44 + pub struct Empty(()); 45 + impl sealed::Sealed for Empty {} 46 + impl State for Empty { 47 + type ListId = Unset; 48 + type Code = Unset; 49 + } 50 + ///State transition - sets the `list_id` field to Set 51 + pub struct SetListId<S: State = Empty>(PhantomData<fn() -> S>); 52 + impl<S: State> sealed::Sealed for SetListId<S> {} 53 + impl<S: State> State for SetListId<S> { 54 + type ListId = Set<members::list_id>; 55 + type Code = S::Code; 56 + } 57 + ///State transition - sets the `code` field to Set 58 + pub struct SetCode<S: State = Empty>(PhantomData<fn() -> S>); 59 + impl<S: State> sealed::Sealed for SetCode<S> {} 60 + impl<S: State> State for SetCode<S> { 61 + type ListId = S::ListId; 62 + type Code = Set<members::code>; 63 + } 64 + /// Marker types for field names 65 + #[allow(non_camel_case_types)] 66 + pub mod members { 67 + ///Marker type for the `list_id` field 68 + pub struct list_id(()); 69 + ///Marker type for the `code` field 70 + pub struct code(()); 71 + } 72 + } 73 + 74 + /// Builder for constructing an instance of this type 75 + pub struct CodeTypeBuilder<'a, S: code_type_state::State> { 76 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 77 + __unsafe_private_named: ( 78 + ::core::option::Option< 79 + jacquard_common::types::string::RecordKey< 80 + jacquard_common::types::string::Rkey<'a>, 81 + >, 82 + >, 83 + ::core::option::Option<jacquard_common::types::string::Nsid<'a>>, 84 + ), 85 + _phantom: ::core::marker::PhantomData<&'a ()>, 86 + } 87 + 88 + impl<'a> CodeType<'a> { 89 + /// Create a new builder for this type 90 + pub fn new() -> CodeTypeBuilder<'a, code_type_state::Empty> { 91 + CodeTypeBuilder::new() 92 + } 93 + } 94 + 95 + impl<'a> CodeTypeBuilder<'a, code_type_state::Empty> { 96 + /// Create a new builder with all fields unset 97 + pub fn new() -> Self { 98 + CodeTypeBuilder { 99 + _phantom_state: ::core::marker::PhantomData, 100 + __unsafe_private_named: (None, None), 101 + _phantom: ::core::marker::PhantomData, 102 + } 103 + } 104 + } 105 + 106 + impl<'a, S> CodeTypeBuilder<'a, S> 107 + where 108 + S: code_type_state::State, 109 + S::Code: code_type_state::IsUnset, 110 + { 111 + /// Set the `code` field (required) 112 + pub fn code( 113 + mut self, 114 + value: impl Into< 115 + jacquard_common::types::string::RecordKey< 116 + jacquard_common::types::string::Rkey<'a>, 117 + >, 118 + >, 119 + ) -> CodeTypeBuilder<'a, code_type_state::SetCode<S>> { 120 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 121 + CodeTypeBuilder { 122 + _phantom_state: ::core::marker::PhantomData, 123 + __unsafe_private_named: self.__unsafe_private_named, 124 + _phantom: ::core::marker::PhantomData, 125 + } 126 + } 127 + } 128 + 129 + impl<'a, S> CodeTypeBuilder<'a, S> 130 + where 131 + S: code_type_state::State, 132 + S::ListId: code_type_state::IsUnset, 133 + { 134 + /// Set the `listId` field (required) 135 + pub fn list_id( 136 + mut self, 137 + value: impl Into<jacquard_common::types::string::Nsid<'a>>, 138 + ) -> CodeTypeBuilder<'a, code_type_state::SetListId<S>> { 139 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 140 + CodeTypeBuilder { 141 + _phantom_state: ::core::marker::PhantomData, 142 + __unsafe_private_named: self.__unsafe_private_named, 143 + _phantom: ::core::marker::PhantomData, 144 + } 145 + } 146 + } 147 + 148 + impl<'a, S> CodeTypeBuilder<'a, S> 149 + where 150 + S: code_type_state::State, 151 + S::ListId: code_type_state::IsSet, 152 + S::Code: code_type_state::IsSet, 153 + { 154 + /// Build the final struct 155 + pub fn build(self) -> CodeType<'a> { 156 + CodeType { 157 + code: self.__unsafe_private_named.0.unwrap(), 158 + list_id: self.__unsafe_private_named.1.unwrap(), 159 + extra_data: Default::default(), 160 + } 161 + } 162 + /// Build the final struct with custom extra_data 163 + pub fn build_with_data( 164 + self, 165 + extra_data: std::collections::BTreeMap< 166 + jacquard_common::smol_str::SmolStr, 167 + jacquard_common::types::value::Data<'a>, 168 + >, 169 + ) -> CodeType<'a> { 170 + CodeType { 171 + code: self.__unsafe_private_named.0.unwrap(), 172 + list_id: self.__unsafe_private_named.1.unwrap(), 173 + extra_data: Some(extra_data), 174 + } 175 + } 176 + } 177 + 178 + fn lexicon_doc_org_farmapps_temp_ecrop_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< 179 + 'static, 180 + > { 181 + ::jacquard_lexicon::lexicon::LexiconDoc { 182 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 183 + id: ::jacquard_common::CowStr::new_static("org.farmapps.temp.ecrop.defs"), 184 + revision: None, 185 + description: None, 186 + defs: { 187 + let mut map = ::std::collections::BTreeMap::new(); 188 + map.insert( 189 + ::jacquard_common::smol_str::SmolStr::new_static("codeType"), 190 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 191 + description: Some( 192 + ::jacquard_common::CowStr::new_static( 193 + "Generic class to represent the code list and code that is used", 194 + ), 195 + ), 196 + required: Some( 197 + vec![ 198 + ::jacquard_common::smol_str::SmolStr::new_static("listId"), 199 + ::jacquard_common::smol_str::SmolStr::new_static("code") 200 + ], 201 + ), 202 + nullable: None, 203 + properties: { 204 + #[allow(unused_mut)] 205 + let mut map = ::std::collections::BTreeMap::new(); 206 + map.insert( 207 + ::jacquard_common::smol_str::SmolStr::new_static("code"), 208 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 209 + description: None, 210 + format: Some( 211 + ::jacquard_lexicon::lexicon::LexStringFormat::RecordKey, 212 + ), 213 + default: None, 214 + min_length: None, 215 + max_length: None, 216 + min_graphemes: None, 217 + max_graphemes: None, 218 + r#enum: None, 219 + r#const: None, 220 + known_values: None, 221 + }), 222 + ); 223 + map.insert( 224 + ::jacquard_common::smol_str::SmolStr::new_static("listId"), 225 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 226 + description: Some( 227 + ::jacquard_common::CowStr::new_static( 228 + "Identifier of the standard code list that contains the allowed codes.", 229 + ), 230 + ), 231 + format: Some( 232 + ::jacquard_lexicon::lexicon::LexStringFormat::Nsid, 233 + ), 234 + default: None, 235 + min_length: None, 236 + max_length: None, 237 + min_graphemes: None, 238 + max_graphemes: None, 239 + r#enum: None, 240 + r#const: None, 241 + known_values: None, 242 + }), 243 + ); 244 + map 245 + }, 246 + }), 247 + ); 248 + map 249 + }, 250 + } 251 + } 252 + 253 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CodeType<'a> { 254 + fn nsid() -> &'static str { 255 + "org.farmapps.temp.ecrop.defs" 256 + } 257 + fn def_name() -> &'static str { 258 + "codeType" 259 + } 260 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 261 + lexicon_doc_org_farmapps_temp_ecrop_defs() 262 + } 263 + fn validate( 264 + &self, 265 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 266 + Ok(()) 267 + } 268 + }
+50 -1
crates/jacquard-api/src/place_stream/broadcast/origin.rs
··· 34 34 pub streamer: jacquard_common::types::string::Did<'a>, 35 35 /// Periodically updated timestamp when this origin last saw a livestream 36 36 pub updated_at: jacquard_common::types::string::Datetime, 37 + /// URL of the websocket endpoint for the livestream 38 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 39 + #[serde(borrow)] 40 + pub websocket_url: Option<jacquard_common::types::string::Uri<'a>>, 37 41 } 38 42 39 43 pub mod origin_state { ··· 103 107 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 104 108 ::core::option::Option<jacquard_common::types::string::Did<'a>>, 105 109 ::core::option::Option<jacquard_common::types::string::Datetime>, 110 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 106 111 ), 107 112 _phantom: ::core::marker::PhantomData<&'a ()>, 108 113 } ··· 119 124 pub fn new() -> Self { 120 125 OriginBuilder { 121 126 _phantom_state: ::core::marker::PhantomData, 122 - __unsafe_private_named: (None, None, None, None, None), 127 + __unsafe_private_named: (None, None, None, None, None, None), 123 128 _phantom: ::core::marker::PhantomData, 124 129 } 125 130 } ··· 217 222 __unsafe_private_named: self.__unsafe_private_named, 218 223 _phantom: ::core::marker::PhantomData, 219 224 } 225 + } 226 + } 227 + 228 + impl<'a, S: origin_state::State> OriginBuilder<'a, S> { 229 + /// Set the `websocketURL` field (optional) 230 + pub fn websocket_url( 231 + mut self, 232 + value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 233 + ) -> Self { 234 + self.__unsafe_private_named.5 = value.into(); 235 + self 236 + } 237 + /// Set the `websocketURL` field to an Option value (optional) 238 + pub fn maybe_websocket_url( 239 + mut self, 240 + value: Option<jacquard_common::types::string::Uri<'a>>, 241 + ) -> Self { 242 + self.__unsafe_private_named.5 = value; 243 + self 220 244 } 221 245 } 222 246 ··· 235 259 server: self.__unsafe_private_named.2.unwrap(), 236 260 streamer: self.__unsafe_private_named.3.unwrap(), 237 261 updated_at: self.__unsafe_private_named.4.unwrap(), 262 + websocket_url: self.__unsafe_private_named.5, 238 263 extra_data: Default::default(), 239 264 } 240 265 } ··· 252 277 server: self.__unsafe_private_named.2.unwrap(), 253 278 streamer: self.__unsafe_private_named.3.unwrap(), 254 279 updated_at: self.__unsafe_private_named.4.unwrap(), 280 + websocket_url: self.__unsafe_private_named.5, 255 281 extra_data: Some(extra_data), 256 282 } 257 283 } ··· 479 505 ), 480 506 format: Some( 481 507 ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 508 + ), 509 + default: None, 510 + min_length: None, 511 + max_length: None, 512 + min_graphemes: None, 513 + max_graphemes: None, 514 + r#enum: None, 515 + r#const: None, 516 + known_values: None, 517 + }), 518 + ); 519 + map.insert( 520 + ::jacquard_common::smol_str::SmolStr::new_static( 521 + "websocketURL", 522 + ), 523 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 524 + description: Some( 525 + ::jacquard_common::CowStr::new_static( 526 + "URL of the websocket endpoint for the livestream", 527 + ), 528 + ), 529 + format: Some( 530 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 482 531 ), 483 532 default: None, 484 533 min_length: None,
+4 -1
crates/jacquard-api/src/place_stream/live.rs
··· 5 5 6 6 pub mod get_live_users; 7 7 pub mod get_profile_card; 8 - pub mod get_segments; 8 + pub mod get_segments; 9 + 10 + #[cfg(feature = "streaming")] 11 + pub mod subscribe_segments;
+198
crates/jacquard-api/src/place_stream/live/subscribe_segments.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: place.stream.live.subscribeSegments 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")] 18 + pub struct SubscribeSegments<'a> { 19 + #[serde(borrow)] 20 + pub streamer: jacquard_common::CowStr<'a>, 21 + } 22 + 23 + pub mod subscribe_segments_state { 24 + 25 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 26 + #[allow(unused)] 27 + use ::core::marker::PhantomData; 28 + mod sealed { 29 + pub trait Sealed {} 30 + } 31 + /// State trait tracking which required fields have been set 32 + pub trait State: sealed::Sealed { 33 + type Streamer; 34 + } 35 + /// Empty state - all required fields are unset 36 + pub struct Empty(()); 37 + impl sealed::Sealed for Empty {} 38 + impl State for Empty { 39 + type Streamer = Unset; 40 + } 41 + ///State transition - sets the `streamer` field to Set 42 + pub struct SetStreamer<S: State = Empty>(PhantomData<fn() -> S>); 43 + impl<S: State> sealed::Sealed for SetStreamer<S> {} 44 + impl<S: State> State for SetStreamer<S> { 45 + type Streamer = Set<members::streamer>; 46 + } 47 + /// Marker types for field names 48 + #[allow(non_camel_case_types)] 49 + pub mod members { 50 + ///Marker type for the `streamer` field 51 + pub struct streamer(()); 52 + } 53 + } 54 + 55 + /// Builder for constructing an instance of this type 56 + pub struct SubscribeSegmentsBuilder<'a, S: subscribe_segments_state::State> { 57 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 58 + __unsafe_private_named: (::core::option::Option<jacquard_common::CowStr<'a>>,), 59 + _phantom: ::core::marker::PhantomData<&'a ()>, 60 + } 61 + 62 + impl<'a> SubscribeSegments<'a> { 63 + /// Create a new builder for this type 64 + pub fn new() -> SubscribeSegmentsBuilder<'a, subscribe_segments_state::Empty> { 65 + SubscribeSegmentsBuilder::new() 66 + } 67 + } 68 + 69 + impl<'a> SubscribeSegmentsBuilder<'a, subscribe_segments_state::Empty> { 70 + /// Create a new builder with all fields unset 71 + pub fn new() -> Self { 72 + SubscribeSegmentsBuilder { 73 + _phantom_state: ::core::marker::PhantomData, 74 + __unsafe_private_named: (None,), 75 + _phantom: ::core::marker::PhantomData, 76 + } 77 + } 78 + } 79 + 80 + impl<'a, S> SubscribeSegmentsBuilder<'a, S> 81 + where 82 + S: subscribe_segments_state::State, 83 + S::Streamer: subscribe_segments_state::IsUnset, 84 + { 85 + /// Set the `streamer` field (required) 86 + pub fn streamer( 87 + mut self, 88 + value: impl Into<jacquard_common::CowStr<'a>>, 89 + ) -> SubscribeSegmentsBuilder<'a, subscribe_segments_state::SetStreamer<S>> { 90 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 91 + SubscribeSegmentsBuilder { 92 + _phantom_state: ::core::marker::PhantomData, 93 + __unsafe_private_named: self.__unsafe_private_named, 94 + _phantom: ::core::marker::PhantomData, 95 + } 96 + } 97 + } 98 + 99 + impl<'a, S> SubscribeSegmentsBuilder<'a, S> 100 + where 101 + S: subscribe_segments_state::State, 102 + S::Streamer: subscribe_segments_state::IsSet, 103 + { 104 + /// Build the final struct 105 + pub fn build(self) -> SubscribeSegments<'a> { 106 + SubscribeSegments { 107 + streamer: self.__unsafe_private_named.0.unwrap(), 108 + } 109 + } 110 + } 111 + 112 + #[jacquard_derive::open_union] 113 + #[derive( 114 + serde::Serialize, 115 + serde::Deserialize, 116 + Debug, 117 + Clone, 118 + PartialEq, 119 + Eq, 120 + jacquard_derive::IntoStatic 121 + )] 122 + #[serde(tag = "$type")] 123 + #[serde(bound(deserialize = "'de: 'a"))] 124 + pub enum SubscribeSegmentsMessage<'a> { 125 + #[serde(rename = "#segment")] 126 + Segment(Box<crate::place_stream::live::subscribe_segments::Segment>), 127 + } 128 + 129 + impl<'a> SubscribeSegmentsMessage<'a> { 130 + /// Decode a framed DAG-CBOR message (header + body). 131 + pub fn decode_framed<'de: 'a>( 132 + bytes: &'de [u8], 133 + ) -> Result<SubscribeSegmentsMessage<'a>, jacquard_common::error::DecodeError> { 134 + let (header, body) = jacquard_common::xrpc::subscription::parse_event_header( 135 + bytes, 136 + )?; 137 + match header.t.as_str() { 138 + "#segment" => { 139 + let variant = serde_ipld_dagcbor::from_slice(body)?; 140 + Ok(Self::Segment(Box::new(variant))) 141 + } 142 + unknown => { 143 + Err( 144 + jacquard_common::error::DecodeError::UnknownEventType(unknown.into()), 145 + ) 146 + } 147 + } 148 + } 149 + } 150 + 151 + #[jacquard_derive::open_union] 152 + #[derive( 153 + serde::Serialize, 154 + serde::Deserialize, 155 + Debug, 156 + Clone, 157 + PartialEq, 158 + Eq, 159 + thiserror::Error, 160 + miette::Diagnostic, 161 + jacquard_derive::IntoStatic 162 + )] 163 + #[serde(tag = "error", content = "message")] 164 + #[serde(bound(deserialize = "'de: 'a"))] 165 + pub enum SubscribeSegmentsError<'a> {} 166 + impl std::fmt::Display for SubscribeSegmentsError<'_> { 167 + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 168 + match self { 169 + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), 170 + } 171 + } 172 + } 173 + 174 + ///Stream response type for 175 + ///place.stream.live.subscribeSegments 176 + pub struct SubscribeSegmentsStream; 177 + impl jacquard_common::xrpc::SubscriptionResp for SubscribeSegmentsStream { 178 + const NSID: &'static str = "place.stream.live.subscribeSegments"; 179 + const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::Json; 180 + type Message<'de> = SubscribeSegmentsMessage<'de>; 181 + type Error<'de> = SubscribeSegmentsError<'de>; 182 + } 183 + 184 + impl<'a> jacquard_common::xrpc::XrpcSubscription for SubscribeSegments<'a> { 185 + const NSID: &'static str = "place.stream.live.subscribeSegments"; 186 + const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::Json; 187 + type Stream = SubscribeSegmentsStream; 188 + } 189 + 190 + pub struct SubscribeSegmentsEndpoint; 191 + impl jacquard_common::xrpc::SubscriptionEndpoint for SubscribeSegmentsEndpoint { 192 + const PATH: &'static str = "/xrpc/place.stream.live.subscribeSegments"; 193 + const ENCODING: jacquard_common::xrpc::MessageEncoding = jacquard_common::xrpc::MessageEncoding::Json; 194 + type Params<'de> = SubscribeSegments<'de>; 195 + type Stream = SubscribeSegmentsStream; 196 + } 197 + 198 + pub type Segment = bytes::Bytes;
+121 -7
crates/jacquard-api/src/place_wisp/fs.rs
··· 275 275 #[allow(unused_mut)] 276 276 let mut map = ::std::collections::BTreeMap::new(); 277 277 map.insert( 278 + ::jacquard_common::smol_str::SmolStr::new_static("base64"), 279 + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 280 + description: None, 281 + default: None, 282 + r#const: None, 283 + }), 284 + ); 285 + map.insert( 278 286 ::jacquard_common::smol_str::SmolStr::new_static("blob"), 279 287 ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 280 288 description: None, 281 289 accept: None, 282 290 max_size: None, 291 + }), 292 + ); 293 + map.insert( 294 + ::jacquard_common::smol_str::SmolStr::new_static("encoding"), 295 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 296 + description: Some( 297 + ::jacquard_common::CowStr::new_static( 298 + "Content encoding (e.g., gzip for compressed files)", 299 + ), 300 + ), 301 + format: None, 302 + default: None, 303 + min_length: None, 304 + max_length: None, 305 + min_graphemes: None, 306 + max_graphemes: None, 307 + r#enum: None, 308 + r#const: None, 309 + known_values: None, 310 + }), 311 + ); 312 + map.insert( 313 + ::jacquard_common::smol_str::SmolStr::new_static("mimeType"), 314 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 315 + description: Some( 316 + ::jacquard_common::CowStr::new_static( 317 + "Original MIME type before compression", 318 + ), 319 + ), 320 + format: None, 321 + default: None, 322 + min_length: None, 323 + max_length: None, 324 + min_graphemes: None, 325 + max_graphemes: None, 326 + r#enum: None, 327 + r#const: None, 328 + known_values: None, 283 329 }), 284 330 ); 285 331 map.insert( ··· 636 682 )] 637 683 #[serde(rename_all = "camelCase")] 638 684 pub struct File<'a> { 685 + /// True if blob content is base64-encoded (used to bypass PDS content sniffing) 686 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 687 + pub base64: Option<bool>, 639 688 /// Content blob ref 640 689 #[serde(borrow)] 641 690 pub blob: jacquard_common::types::blob::BlobRef<'a>, 691 + /// Content encoding (e.g., gzip for compressed files) 692 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 693 + #[serde(borrow)] 694 + pub encoding: Option<jacquard_common::CowStr<'a>>, 695 + /// Original MIME type before compression 696 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 697 + #[serde(borrow)] 698 + pub mime_type: Option<jacquard_common::CowStr<'a>>, 642 699 #[serde(borrow)] 643 700 pub r#type: jacquard_common::CowStr<'a>, 644 701 } ··· 691 748 pub struct FileBuilder<'a, S: file_state::State> { 692 749 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 693 750 __unsafe_private_named: ( 751 + ::core::option::Option<bool>, 694 752 ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 753 + ::core::option::Option<jacquard_common::CowStr<'a>>, 754 + ::core::option::Option<jacquard_common::CowStr<'a>>, 695 755 ::core::option::Option<jacquard_common::CowStr<'a>>, 696 756 ), 697 757 _phantom: ::core::marker::PhantomData<&'a ()>, ··· 709 769 pub fn new() -> Self { 710 770 FileBuilder { 711 771 _phantom_state: ::core::marker::PhantomData, 712 - __unsafe_private_named: (None, None), 772 + __unsafe_private_named: (None, None, None, None, None), 713 773 _phantom: ::core::marker::PhantomData, 714 774 } 715 775 } 716 776 } 717 777 778 + impl<'a, S: file_state::State> FileBuilder<'a, S> { 779 + /// Set the `base64` field (optional) 780 + pub fn base64(mut self, value: impl Into<Option<bool>>) -> Self { 781 + self.__unsafe_private_named.0 = value.into(); 782 + self 783 + } 784 + /// Set the `base64` field to an Option value (optional) 785 + pub fn maybe_base64(mut self, value: Option<bool>) -> Self { 786 + self.__unsafe_private_named.0 = value; 787 + self 788 + } 789 + } 790 + 718 791 impl<'a, S> FileBuilder<'a, S> 719 792 where 720 793 S: file_state::State, ··· 725 798 mut self, 726 799 value: impl Into<jacquard_common::types::blob::BlobRef<'a>>, 727 800 ) -> FileBuilder<'a, file_state::SetBlob<S>> { 728 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 801 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 729 802 FileBuilder { 730 803 _phantom_state: ::core::marker::PhantomData, 731 804 __unsafe_private_named: self.__unsafe_private_named, ··· 734 807 } 735 808 } 736 809 810 + impl<'a, S: file_state::State> FileBuilder<'a, S> { 811 + /// Set the `encoding` field (optional) 812 + pub fn encoding( 813 + mut self, 814 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 815 + ) -> Self { 816 + self.__unsafe_private_named.2 = value.into(); 817 + self 818 + } 819 + /// Set the `encoding` field to an Option value (optional) 820 + pub fn maybe_encoding(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 821 + self.__unsafe_private_named.2 = value; 822 + self 823 + } 824 + } 825 + 826 + impl<'a, S: file_state::State> FileBuilder<'a, S> { 827 + /// Set the `mimeType` field (optional) 828 + pub fn mime_type( 829 + mut self, 830 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 831 + ) -> Self { 832 + self.__unsafe_private_named.3 = value.into(); 833 + self 834 + } 835 + /// Set the `mimeType` field to an Option value (optional) 836 + pub fn maybe_mime_type( 837 + mut self, 838 + value: Option<jacquard_common::CowStr<'a>>, 839 + ) -> Self { 840 + self.__unsafe_private_named.3 = value; 841 + self 842 + } 843 + } 844 + 737 845 impl<'a, S> FileBuilder<'a, S> 738 846 where 739 847 S: file_state::State, ··· 744 852 mut self, 745 853 value: impl Into<jacquard_common::CowStr<'a>>, 746 854 ) -> FileBuilder<'a, file_state::SetType<S>> { 747 - self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 855 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 748 856 FileBuilder { 749 857 _phantom_state: ::core::marker::PhantomData, 750 858 __unsafe_private_named: self.__unsafe_private_named, ··· 762 870 /// Build the final struct 763 871 pub fn build(self) -> File<'a> { 764 872 File { 765 - blob: self.__unsafe_private_named.0.unwrap(), 766 - r#type: self.__unsafe_private_named.1.unwrap(), 873 + base64: self.__unsafe_private_named.0, 874 + blob: self.__unsafe_private_named.1.unwrap(), 875 + encoding: self.__unsafe_private_named.2, 876 + mime_type: self.__unsafe_private_named.3, 877 + r#type: self.__unsafe_private_named.4.unwrap(), 767 878 extra_data: Default::default(), 768 879 } 769 880 } ··· 776 887 >, 777 888 ) -> File<'a> { 778 889 File { 779 - blob: self.__unsafe_private_named.0.unwrap(), 780 - r#type: self.__unsafe_private_named.1.unwrap(), 890 + base64: self.__unsafe_private_named.0, 891 + blob: self.__unsafe_private_named.1.unwrap(), 892 + encoding: self.__unsafe_private_named.2, 893 + mime_type: self.__unsafe_private_named.3, 894 + r#type: self.__unsafe_private_named.4.unwrap(), 781 895 extra_data: Some(extra_data), 782 896 } 783 897 }
+1
crates/jacquard-api/src/pub_leaflet/blocks.rs
··· 5 5 6 6 pub mod blockquote; 7 7 pub mod bsky_post; 8 + pub mod button; 8 9 pub mod code; 9 10 pub mod header; 10 11 pub mod horizontal_rule;
+246
crates/jacquard-api/src/pub_leaflet/blocks/button.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: pub.leaflet.blocks.button 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + #[jacquard_derive::lexicon] 9 + #[derive( 10 + serde::Serialize, 11 + serde::Deserialize, 12 + Debug, 13 + Clone, 14 + PartialEq, 15 + Eq, 16 + jacquard_derive::IntoStatic 17 + )] 18 + #[serde(rename_all = "camelCase")] 19 + pub struct Button<'a> { 20 + #[serde(borrow)] 21 + pub text: jacquard_common::CowStr<'a>, 22 + #[serde(borrow)] 23 + pub url: jacquard_common::types::string::Uri<'a>, 24 + } 25 + 26 + pub mod button_state { 27 + 28 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 29 + #[allow(unused)] 30 + use ::core::marker::PhantomData; 31 + mod sealed { 32 + pub trait Sealed {} 33 + } 34 + /// State trait tracking which required fields have been set 35 + pub trait State: sealed::Sealed { 36 + type Text; 37 + type Url; 38 + } 39 + /// Empty state - all required fields are unset 40 + pub struct Empty(()); 41 + impl sealed::Sealed for Empty {} 42 + impl State for Empty { 43 + type Text = Unset; 44 + type Url = Unset; 45 + } 46 + ///State transition - sets the `text` field to Set 47 + pub struct SetText<S: State = Empty>(PhantomData<fn() -> S>); 48 + impl<S: State> sealed::Sealed for SetText<S> {} 49 + impl<S: State> State for SetText<S> { 50 + type Text = Set<members::text>; 51 + type Url = S::Url; 52 + } 53 + ///State transition - sets the `url` field to Set 54 + pub struct SetUrl<S: State = Empty>(PhantomData<fn() -> S>); 55 + impl<S: State> sealed::Sealed for SetUrl<S> {} 56 + impl<S: State> State for SetUrl<S> { 57 + type Text = S::Text; 58 + type Url = Set<members::url>; 59 + } 60 + /// Marker types for field names 61 + #[allow(non_camel_case_types)] 62 + pub mod members { 63 + ///Marker type for the `text` field 64 + pub struct text(()); 65 + ///Marker type for the `url` field 66 + pub struct url(()); 67 + } 68 + } 69 + 70 + /// Builder for constructing an instance of this type 71 + pub struct ButtonBuilder<'a, S: button_state::State> { 72 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 73 + __unsafe_private_named: ( 74 + ::core::option::Option<jacquard_common::CowStr<'a>>, 75 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 76 + ), 77 + _phantom: ::core::marker::PhantomData<&'a ()>, 78 + } 79 + 80 + impl<'a> Button<'a> { 81 + /// Create a new builder for this type 82 + pub fn new() -> ButtonBuilder<'a, button_state::Empty> { 83 + ButtonBuilder::new() 84 + } 85 + } 86 + 87 + impl<'a> ButtonBuilder<'a, button_state::Empty> { 88 + /// Create a new builder with all fields unset 89 + pub fn new() -> Self { 90 + ButtonBuilder { 91 + _phantom_state: ::core::marker::PhantomData, 92 + __unsafe_private_named: (None, None), 93 + _phantom: ::core::marker::PhantomData, 94 + } 95 + } 96 + } 97 + 98 + impl<'a, S> ButtonBuilder<'a, S> 99 + where 100 + S: button_state::State, 101 + S::Text: button_state::IsUnset, 102 + { 103 + /// Set the `text` field (required) 104 + pub fn text( 105 + mut self, 106 + value: impl Into<jacquard_common::CowStr<'a>>, 107 + ) -> ButtonBuilder<'a, button_state::SetText<S>> { 108 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 109 + ButtonBuilder { 110 + _phantom_state: ::core::marker::PhantomData, 111 + __unsafe_private_named: self.__unsafe_private_named, 112 + _phantom: ::core::marker::PhantomData, 113 + } 114 + } 115 + } 116 + 117 + impl<'a, S> ButtonBuilder<'a, S> 118 + where 119 + S: button_state::State, 120 + S::Url: button_state::IsUnset, 121 + { 122 + /// Set the `url` field (required) 123 + pub fn url( 124 + mut self, 125 + value: impl Into<jacquard_common::types::string::Uri<'a>>, 126 + ) -> ButtonBuilder<'a, button_state::SetUrl<S>> { 127 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 128 + ButtonBuilder { 129 + _phantom_state: ::core::marker::PhantomData, 130 + __unsafe_private_named: self.__unsafe_private_named, 131 + _phantom: ::core::marker::PhantomData, 132 + } 133 + } 134 + } 135 + 136 + impl<'a, S> ButtonBuilder<'a, S> 137 + where 138 + S: button_state::State, 139 + S::Text: button_state::IsSet, 140 + S::Url: button_state::IsSet, 141 + { 142 + /// Build the final struct 143 + pub fn build(self) -> Button<'a> { 144 + Button { 145 + text: self.__unsafe_private_named.0.unwrap(), 146 + url: self.__unsafe_private_named.1.unwrap(), 147 + extra_data: Default::default(), 148 + } 149 + } 150 + /// Build the final struct with custom extra_data 151 + pub fn build_with_data( 152 + self, 153 + extra_data: std::collections::BTreeMap< 154 + jacquard_common::smol_str::SmolStr, 155 + jacquard_common::types::value::Data<'a>, 156 + >, 157 + ) -> Button<'a> { 158 + Button { 159 + text: self.__unsafe_private_named.0.unwrap(), 160 + url: self.__unsafe_private_named.1.unwrap(), 161 + extra_data: Some(extra_data), 162 + } 163 + } 164 + } 165 + 166 + fn lexicon_doc_pub_leaflet_blocks_button() -> ::jacquard_lexicon::lexicon::LexiconDoc< 167 + 'static, 168 + > { 169 + ::jacquard_lexicon::lexicon::LexiconDoc { 170 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 171 + id: ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.button"), 172 + revision: None, 173 + description: None, 174 + defs: { 175 + let mut map = ::std::collections::BTreeMap::new(); 176 + map.insert( 177 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 178 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 179 + description: None, 180 + required: Some( 181 + vec![ 182 + ::jacquard_common::smol_str::SmolStr::new_static("text"), 183 + ::jacquard_common::smol_str::SmolStr::new_static("url") 184 + ], 185 + ), 186 + nullable: None, 187 + properties: { 188 + #[allow(unused_mut)] 189 + let mut map = ::std::collections::BTreeMap::new(); 190 + map.insert( 191 + ::jacquard_common::smol_str::SmolStr::new_static("text"), 192 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 193 + description: None, 194 + format: None, 195 + default: None, 196 + min_length: None, 197 + max_length: None, 198 + min_graphemes: None, 199 + max_graphemes: None, 200 + r#enum: None, 201 + r#const: None, 202 + known_values: None, 203 + }), 204 + ); 205 + map.insert( 206 + ::jacquard_common::smol_str::SmolStr::new_static("url"), 207 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 208 + description: None, 209 + format: Some( 210 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 211 + ), 212 + default: None, 213 + min_length: None, 214 + max_length: None, 215 + min_graphemes: None, 216 + max_graphemes: None, 217 + r#enum: None, 218 + r#const: None, 219 + known_values: None, 220 + }), 221 + ); 222 + map 223 + }, 224 + }), 225 + ); 226 + map 227 + }, 228 + } 229 + } 230 + 231 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Button<'a> { 232 + fn nsid() -> &'static str { 233 + "pub.leaflet.blocks.button" 234 + } 235 + fn def_name() -> &'static str { 236 + "main" 237 + } 238 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 239 + lexicon_doc_pub_leaflet_blocks_button() 240 + } 241 + fn validate( 242 + &self, 243 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 244 + Ok(()) 245 + } 246 + }
+8 -1
crates/jacquard-api/src/pub_leaflet/pages/canvas.rs
··· 21 21 pub block: BlockBlock<'a>, 22 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 23 pub height: Option<i64>, 24 + /// The rotation of the block in degrees 24 25 #[serde(skip_serializing_if = "std::option::Option::is_none")] 25 26 pub rotation: Option<i64>, 26 27 pub width: i64, ··· 307 308 BskyPost(Box<crate::pub_leaflet::blocks::bsky_post::BskyPost<'a>>), 308 309 #[serde(rename = "pub.leaflet.blocks.page")] 309 310 Page(Box<crate::pub_leaflet::blocks::page::Page<'a>>), 311 + #[serde(rename = "pub.leaflet.blocks.poll")] 312 + Poll(Box<crate::pub_leaflet::blocks::poll::Poll<'a>>), 313 + #[serde(rename = "pub.leaflet.blocks.button")] 314 + Button(Box<crate::pub_leaflet::blocks::button::Button<'a>>), 310 315 } 311 316 312 317 fn lexicon_doc_pub_leaflet_pages_canvas() -> ::jacquard_lexicon::lexicon::LexiconDoc< ··· 351 356 ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.code"), 352 357 ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.horizontalRule"), 353 358 ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.bskyPost"), 354 - ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.page") 359 + ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.page"), 360 + ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.poll"), 361 + ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.button") 355 362 ], 356 363 closed: None, 357 364 }),
+27 -1
crates/jacquard-api/src/pub_leaflet/pages/linear_document.rs
··· 190 190 Page(Box<crate::pub_leaflet::blocks::page::Page<'a>>), 191 191 #[serde(rename = "pub.leaflet.blocks.poll")] 192 192 Poll(Box<crate::pub_leaflet::blocks::poll::Poll<'a>>), 193 + #[serde(rename = "pub.leaflet.blocks.button")] 194 + Button(Box<crate::pub_leaflet::blocks::button::Button<'a>>), 193 195 } 194 196 195 197 fn lexicon_doc_pub_leaflet_pages_linearDocument() -> ::jacquard_lexicon::lexicon::LexiconDoc< ··· 247 249 ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.horizontalRule"), 248 250 ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.bskyPost"), 249 251 ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.page"), 250 - ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.poll") 252 + ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.poll"), 253 + ::jacquard_common::CowStr::new_static("pub.leaflet.blocks.button") 251 254 ], 252 255 closed: None, 253 256 }), ··· 377 380 ); 378 381 map.insert( 379 382 ::jacquard_common::smol_str::SmolStr::new_static("textAlignCenter"), 383 + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { 384 + description: None, 385 + }), 386 + ); 387 + map.insert( 388 + ::jacquard_common::smol_str::SmolStr::new_static("textAlignJustify"), 380 389 ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { 381 390 description: None, 382 391 }), ··· 936 945 impl std::fmt::Display for TextAlignCenter { 937 946 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 938 947 write!(f, "textAlignCenter") 948 + } 949 + } 950 + 951 + #[derive( 952 + serde::Serialize, 953 + serde::Deserialize, 954 + Debug, 955 + Clone, 956 + PartialEq, 957 + Eq, 958 + Hash, 959 + jacquard_derive::IntoStatic 960 + )] 961 + pub struct TextAlignJustify; 962 + impl std::fmt::Display for TextAlignJustify { 963 + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 964 + write!(f, "textAlignJustify") 939 965 } 940 966 } 941 967
+919 -51
crates/jacquard-api/src/sh_weaver/actor.rs
··· 261 261 }), 262 262 ); 263 263 map.insert( 264 + ::jacquard_common::smol_str::SmolStr::new_static("pinnedList"), 265 + ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { 266 + description: None, 267 + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 268 + description: None, 269 + r#ref: ::jacquard_common::CowStr::new_static( 270 + "com.atproto.repo.strongRef", 271 + ), 272 + }), 273 + min_length: None, 274 + max_length: None, 275 + }), 276 + ); 277 + map.insert( 264 278 ::jacquard_common::smol_str::SmolStr::new_static("profileDataView"), 265 279 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 266 280 description: None, ··· 276 290 ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 277 291 description: None, 278 292 refs: vec![ 279 - ::jacquard_common::CowStr::new_static("sh.weaver.actor.defs#profileView"), 280 - ::jacquard_common::CowStr::new_static("app.bsky.actor.defs#profileViewDetailed") 293 + ::jacquard_common::CowStr::new_static("#profileView"), 294 + ::jacquard_common::CowStr::new_static("app.bsky.actor.defs#profileViewDetailed"), 295 + ::jacquard_common::CowStr::new_static("#tangledProfileView") 296 + ], 297 + closed: None, 298 + }), 299 + ); 300 + map 301 + }, 302 + }), 303 + ); 304 + map.insert( 305 + ::jacquard_common::smol_str::SmolStr::new_static("profileDataViewBasic"), 306 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 307 + description: None, 308 + required: Some( 309 + vec![::jacquard_common::smol_str::SmolStr::new_static("inner")], 310 + ), 311 + nullable: None, 312 + properties: { 313 + #[allow(unused_mut)] 314 + let mut map = ::std::collections::BTreeMap::new(); 315 + map.insert( 316 + ::jacquard_common::smol_str::SmolStr::new_static("inner"), 317 + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 318 + description: None, 319 + refs: vec![ 320 + ::jacquard_common::CowStr::new_static("#profileViewBasic"), 321 + ::jacquard_common::CowStr::new_static("app.bsky.actor.defs#profileViewBasic"), 322 + ::jacquard_common::CowStr::new_static("#tangledProfileView") 281 323 ], 282 324 closed: None, 283 325 }), ··· 318 360 }), 319 361 ); 320 362 map.insert( 363 + ::jacquard_common::smol_str::SmolStr::new_static("banner"), 364 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 365 + description: None, 366 + format: Some( 367 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 368 + ), 369 + default: None, 370 + min_length: None, 371 + max_length: None, 372 + min_graphemes: None, 373 + max_graphemes: None, 374 + r#enum: None, 375 + r#const: None, 376 + known_values: None, 377 + }), 378 + ); 379 + map.insert( 321 380 ::jacquard_common::smol_str::SmolStr::new_static( 322 381 "createdAt", 323 382 ), ··· 345 404 format: None, 346 405 default: None, 347 406 min_length: None, 348 - max_length: Some(2560usize), 407 + max_length: Some(10240usize), 349 408 min_graphemes: None, 350 - max_graphemes: Some(256usize), 409 + max_graphemes: Some(1024usize), 351 410 r#enum: None, 352 411 r#const: None, 353 412 known_values: None, ··· 483 542 }), 484 543 ); 485 544 map.insert( 545 + ::jacquard_common::smol_str::SmolStr::new_static("pinned"), 546 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 547 + description: None, 548 + r#ref: ::jacquard_common::CowStr::new_static("#pinnedList"), 549 + }), 550 + ); 551 + map.insert( 486 552 ::jacquard_common::smol_str::SmolStr::new_static("pronouns"), 487 553 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 488 554 description: None, 489 555 r#ref: ::jacquard_common::CowStr::new_static( 490 - "sh.weaver.actor.profile#pronounsList", 556 + "#pronounsList", 557 + ), 558 + }), 559 + ); 560 + map.insert( 561 + ::jacquard_common::smol_str::SmolStr::new_static( 562 + "subscribedCount", 563 + ), 564 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 565 + description: None, 566 + default: None, 567 + minimum: None, 568 + maximum: None, 569 + r#enum: None, 570 + r#const: None, 571 + }), 572 + ); 573 + map.insert( 574 + ::jacquard_common::smol_str::SmolStr::new_static( 575 + "subscriberCount", 576 + ), 577 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 578 + description: None, 579 + default: None, 580 + minimum: None, 581 + maximum: None, 582 + r#enum: None, 583 + r#const: None, 584 + }), 585 + ); 586 + map 587 + }, 588 + }), 589 + ); 590 + map.insert( 591 + ::jacquard_common::smol_str::SmolStr::new_static("profileViewBasic"), 592 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 593 + description: None, 594 + required: Some( 595 + vec![ 596 + ::jacquard_common::smol_str::SmolStr::new_static("did"), 597 + ::jacquard_common::smol_str::SmolStr::new_static("handle") 598 + ], 599 + ), 600 + nullable: None, 601 + properties: { 602 + #[allow(unused_mut)] 603 + let mut map = ::std::collections::BTreeMap::new(); 604 + map.insert( 605 + ::jacquard_common::smol_str::SmolStr::new_static("avatar"), 606 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 607 + description: None, 608 + format: Some( 609 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 610 + ), 611 + default: None, 612 + min_length: None, 613 + max_length: None, 614 + min_graphemes: None, 615 + max_graphemes: None, 616 + r#enum: None, 617 + r#const: None, 618 + known_values: None, 619 + }), 620 + ); 621 + map.insert( 622 + ::jacquard_common::smol_str::SmolStr::new_static( 623 + "createdAt", 624 + ), 625 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 626 + description: None, 627 + format: Some( 628 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 629 + ), 630 + default: None, 631 + min_length: None, 632 + max_length: None, 633 + min_graphemes: None, 634 + max_graphemes: None, 635 + r#enum: None, 636 + r#const: None, 637 + known_values: None, 638 + }), 639 + ); 640 + map.insert( 641 + ::jacquard_common::smol_str::SmolStr::new_static("did"), 642 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 643 + description: None, 644 + format: Some( 645 + ::jacquard_lexicon::lexicon::LexStringFormat::Did, 646 + ), 647 + default: None, 648 + min_length: None, 649 + max_length: None, 650 + min_graphemes: None, 651 + max_graphemes: None, 652 + r#enum: None, 653 + r#const: None, 654 + known_values: None, 655 + }), 656 + ); 657 + map.insert( 658 + ::jacquard_common::smol_str::SmolStr::new_static( 659 + "displayName", 660 + ), 661 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 662 + description: None, 663 + format: None, 664 + default: None, 665 + min_length: None, 666 + max_length: Some(640usize), 667 + min_graphemes: None, 668 + max_graphemes: Some(64usize), 669 + r#enum: None, 670 + r#const: None, 671 + known_values: None, 672 + }), 673 + ); 674 + map.insert( 675 + ::jacquard_common::smol_str::SmolStr::new_static("handle"), 676 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 677 + description: None, 678 + format: Some( 679 + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, 680 + ), 681 + default: None, 682 + min_length: None, 683 + max_length: None, 684 + min_graphemes: None, 685 + max_graphemes: None, 686 + r#enum: None, 687 + r#const: None, 688 + known_values: None, 689 + }), 690 + ); 691 + map.insert( 692 + ::jacquard_common::smol_str::SmolStr::new_static( 693 + "indexedAt", 694 + ), 695 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 696 + description: None, 697 + format: Some( 698 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 699 + ), 700 + default: None, 701 + min_length: None, 702 + max_length: None, 703 + min_graphemes: None, 704 + max_graphemes: None, 705 + r#enum: None, 706 + r#const: None, 707 + known_values: None, 708 + }), 709 + ); 710 + map.insert( 711 + ::jacquard_common::smol_str::SmolStr::new_static("labels"), 712 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 713 + description: None, 714 + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 715 + description: None, 716 + r#ref: ::jacquard_common::CowStr::new_static( 717 + "com.atproto.label.defs#label", 718 + ), 719 + }), 720 + min_length: None, 721 + max_length: None, 722 + }), 723 + ); 724 + map.insert( 725 + ::jacquard_common::smol_str::SmolStr::new_static("pronouns"), 726 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 727 + description: None, 728 + r#ref: ::jacquard_common::CowStr::new_static( 729 + "#pronounsList", 491 730 ), 492 731 }), 493 732 ); 494 733 map 495 734 }, 735 + }), 736 + ); 737 + map.insert( 738 + ::jacquard_common::smol_str::SmolStr::new_static("pronounsList"), 739 + ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { 740 + description: None, 741 + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 742 + description: None, 743 + format: None, 744 + default: None, 745 + min_length: None, 746 + max_length: Some(500usize), 747 + min_graphemes: None, 748 + max_graphemes: Some(50usize), 749 + r#enum: None, 750 + r#const: None, 751 + known_values: None, 752 + }), 753 + min_length: None, 754 + max_length: Some(5usize), 496 755 }), 497 756 ); 498 757 map.insert( ··· 724 983 } 725 984 } 726 985 986 + pub type PinnedList<'a> = Vec<crate::com_atproto::repo::strong_ref::StrongRef<'a>>; 727 987 #[jacquard_derive::lexicon] 728 988 #[derive( 729 989 serde::Serialize, ··· 860 1120 ProfileView(Box<crate::sh_weaver::actor::ProfileView<'a>>), 861 1121 #[serde(rename = "app.bsky.actor.defs#profileViewDetailed")] 862 1122 ProfileViewDetailed(Box<crate::app_bsky::actor::ProfileViewDetailed<'a>>), 1123 + #[serde(rename = "sh.weaver.actor.defs#tangledProfileView")] 1124 + TangledProfileView(Box<crate::sh_weaver::actor::TangledProfileView<'a>>), 863 1125 } 864 1126 865 1127 impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileDataView<'a> { ··· 890 1152 jacquard_derive::IntoStatic 891 1153 )] 892 1154 #[serde(rename_all = "camelCase")] 1155 + pub struct ProfileDataViewBasic<'a> { 1156 + #[serde(borrow)] 1157 + pub inner: ProfileDataViewBasicInner<'a>, 1158 + } 1159 + 1160 + pub mod profile_data_view_basic_state { 1161 + 1162 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 1163 + #[allow(unused)] 1164 + use ::core::marker::PhantomData; 1165 + mod sealed { 1166 + pub trait Sealed {} 1167 + } 1168 + /// State trait tracking which required fields have been set 1169 + pub trait State: sealed::Sealed { 1170 + type Inner; 1171 + } 1172 + /// Empty state - all required fields are unset 1173 + pub struct Empty(()); 1174 + impl sealed::Sealed for Empty {} 1175 + impl State for Empty { 1176 + type Inner = Unset; 1177 + } 1178 + ///State transition - sets the `inner` field to Set 1179 + pub struct SetInner<S: State = Empty>(PhantomData<fn() -> S>); 1180 + impl<S: State> sealed::Sealed for SetInner<S> {} 1181 + impl<S: State> State for SetInner<S> { 1182 + type Inner = Set<members::inner>; 1183 + } 1184 + /// Marker types for field names 1185 + #[allow(non_camel_case_types)] 1186 + pub mod members { 1187 + ///Marker type for the `inner` field 1188 + pub struct inner(()); 1189 + } 1190 + } 1191 + 1192 + /// Builder for constructing an instance of this type 1193 + pub struct ProfileDataViewBasicBuilder<'a, S: profile_data_view_basic_state::State> { 1194 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 1195 + __unsafe_private_named: (::core::option::Option<ProfileDataViewBasicInner<'a>>,), 1196 + _phantom: ::core::marker::PhantomData<&'a ()>, 1197 + } 1198 + 1199 + impl<'a> ProfileDataViewBasic<'a> { 1200 + /// Create a new builder for this type 1201 + pub fn new() -> ProfileDataViewBasicBuilder< 1202 + 'a, 1203 + profile_data_view_basic_state::Empty, 1204 + > { 1205 + ProfileDataViewBasicBuilder::new() 1206 + } 1207 + } 1208 + 1209 + impl<'a> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::Empty> { 1210 + /// Create a new builder with all fields unset 1211 + pub fn new() -> Self { 1212 + ProfileDataViewBasicBuilder { 1213 + _phantom_state: ::core::marker::PhantomData, 1214 + __unsafe_private_named: (None,), 1215 + _phantom: ::core::marker::PhantomData, 1216 + } 1217 + } 1218 + } 1219 + 1220 + impl<'a, S> ProfileDataViewBasicBuilder<'a, S> 1221 + where 1222 + S: profile_data_view_basic_state::State, 1223 + S::Inner: profile_data_view_basic_state::IsUnset, 1224 + { 1225 + /// Set the `inner` field (required) 1226 + pub fn inner( 1227 + mut self, 1228 + value: impl Into<ProfileDataViewBasicInner<'a>>, 1229 + ) -> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::SetInner<S>> { 1230 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 1231 + ProfileDataViewBasicBuilder { 1232 + _phantom_state: ::core::marker::PhantomData, 1233 + __unsafe_private_named: self.__unsafe_private_named, 1234 + _phantom: ::core::marker::PhantomData, 1235 + } 1236 + } 1237 + } 1238 + 1239 + impl<'a, S> ProfileDataViewBasicBuilder<'a, S> 1240 + where 1241 + S: profile_data_view_basic_state::State, 1242 + S::Inner: profile_data_view_basic_state::IsSet, 1243 + { 1244 + /// Build the final struct 1245 + pub fn build(self) -> ProfileDataViewBasic<'a> { 1246 + ProfileDataViewBasic { 1247 + inner: self.__unsafe_private_named.0.unwrap(), 1248 + extra_data: Default::default(), 1249 + } 1250 + } 1251 + /// Build the final struct with custom extra_data 1252 + pub fn build_with_data( 1253 + self, 1254 + extra_data: std::collections::BTreeMap< 1255 + jacquard_common::smol_str::SmolStr, 1256 + jacquard_common::types::value::Data<'a>, 1257 + >, 1258 + ) -> ProfileDataViewBasic<'a> { 1259 + ProfileDataViewBasic { 1260 + inner: self.__unsafe_private_named.0.unwrap(), 1261 + extra_data: Some(extra_data), 1262 + } 1263 + } 1264 + } 1265 + 1266 + #[jacquard_derive::open_union] 1267 + #[derive( 1268 + serde::Serialize, 1269 + serde::Deserialize, 1270 + Debug, 1271 + Clone, 1272 + PartialEq, 1273 + Eq, 1274 + jacquard_derive::IntoStatic 1275 + )] 1276 + #[serde(tag = "$type")] 1277 + #[serde(bound(deserialize = "'de: 'a"))] 1278 + pub enum ProfileDataViewBasicInner<'a> { 1279 + #[serde(rename = "sh.weaver.actor.defs#profileViewBasic")] 1280 + ProfileViewBasic(Box<crate::sh_weaver::actor::ProfileViewBasic<'a>>), 1281 + #[serde(rename = "app.bsky.actor.defs#profileViewBasic")] 1282 + BskyProfileViewBasic(Box<crate::app_bsky::actor::ProfileViewBasic<'a>>), 1283 + #[serde(rename = "sh.weaver.actor.defs#tangledProfileView")] 1284 + TangledProfileView(Box<crate::sh_weaver::actor::TangledProfileView<'a>>), 1285 + } 1286 + 1287 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileDataViewBasic<'a> { 1288 + fn nsid() -> &'static str { 1289 + "sh.weaver.actor.defs" 1290 + } 1291 + fn def_name() -> &'static str { 1292 + "profileDataViewBasic" 1293 + } 1294 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1295 + lexicon_doc_sh_weaver_actor_defs() 1296 + } 1297 + fn validate( 1298 + &self, 1299 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1300 + Ok(()) 1301 + } 1302 + } 1303 + 1304 + #[jacquard_derive::lexicon] 1305 + #[derive( 1306 + serde::Serialize, 1307 + serde::Deserialize, 1308 + Debug, 1309 + Clone, 1310 + PartialEq, 1311 + Eq, 1312 + jacquard_derive::IntoStatic 1313 + )] 1314 + #[serde(rename_all = "camelCase")] 893 1315 pub struct ProfileView<'a> { 894 1316 #[serde(skip_serializing_if = "std::option::Option::is_none")] 895 1317 #[serde(borrow)] 896 1318 pub avatar: Option<jacquard_common::types::string::Uri<'a>>, 1319 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1320 + #[serde(borrow)] 1321 + pub banner: Option<jacquard_common::types::string::Uri<'a>>, 897 1322 #[serde(skip_serializing_if = "std::option::Option::is_none")] 898 1323 pub created_at: Option<jacquard_common::types::string::Datetime>, 899 1324 #[serde(skip_serializing_if = "std::option::Option::is_none")] ··· 918 1343 #[serde(skip_serializing_if = "std::option::Option::is_none")] 919 1344 #[serde(borrow)] 920 1345 pub location: Option<jacquard_common::CowStr<'a>>, 1346 + /// Notebooks or other records pinned for display. 1347 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1348 + #[serde(borrow)] 1349 + pub pinned: Option<crate::sh_weaver::actor::PinnedList<'a>>, 921 1350 /// Pronouns to use in user-generated content. 922 1351 #[serde(skip_serializing_if = "std::option::Option::is_none")] 923 1352 #[serde(borrow)] 924 - pub pronouns: Option<crate::sh_weaver::actor::profile::PronounsList<'a>>, 1353 + pub pronouns: Option<crate::sh_weaver::actor::PronounsList<'a>>, 1354 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1355 + pub subscribed_count: Option<i64>, 1356 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1357 + pub subscriber_count: Option<i64>, 925 1358 } 926 1359 927 1360 pub mod profile_view_state { ··· 973 1406 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 974 1407 __unsafe_private_named: ( 975 1408 ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 1409 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 976 1410 ::core::option::Option<jacquard_common::types::string::Datetime>, 977 1411 ::core::option::Option<jacquard_common::CowStr<'a>>, 978 1412 ::core::option::Option<jacquard_common::types::string::Did<'a>>, ··· 982 1416 ::core::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, 983 1417 ::core::option::Option<Vec<jacquard_common::types::string::Uri<'a>>>, 984 1418 ::core::option::Option<jacquard_common::CowStr<'a>>, 985 - ::core::option::Option<crate::sh_weaver::actor::profile::PronounsList<'a>>, 1419 + ::core::option::Option<crate::sh_weaver::actor::PinnedList<'a>>, 1420 + ::core::option::Option<crate::sh_weaver::actor::PronounsList<'a>>, 1421 + ::core::option::Option<i64>, 1422 + ::core::option::Option<i64>, 986 1423 ), 987 1424 _phantom: ::core::marker::PhantomData<&'a ()>, 988 1425 } ··· 1000 1437 ProfileViewBuilder { 1001 1438 _phantom_state: ::core::marker::PhantomData, 1002 1439 __unsafe_private_named: ( 1440 + None, 1441 + None, 1442 + None, 1443 + None, 1003 1444 None, 1004 1445 None, 1005 1446 None, ··· 1037 1478 } 1038 1479 1039 1480 impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 1481 + /// Set the `banner` field (optional) 1482 + pub fn banner( 1483 + mut self, 1484 + value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 1485 + ) -> Self { 1486 + self.__unsafe_private_named.1 = value.into(); 1487 + self 1488 + } 1489 + /// Set the `banner` field to an Option value (optional) 1490 + pub fn maybe_banner( 1491 + mut self, 1492 + value: Option<jacquard_common::types::string::Uri<'a>>, 1493 + ) -> Self { 1494 + self.__unsafe_private_named.1 = value; 1495 + self 1496 + } 1497 + } 1498 + 1499 + impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 1040 1500 /// Set the `createdAt` field (optional) 1041 1501 pub fn created_at( 1042 1502 mut self, 1043 1503 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 1044 1504 ) -> Self { 1045 - self.__unsafe_private_named.1 = value.into(); 1505 + self.__unsafe_private_named.2 = value.into(); 1046 1506 self 1047 1507 } 1048 1508 /// Set the `createdAt` field to an Option value (optional) ··· 1050 1510 mut self, 1051 1511 value: Option<jacquard_common::types::string::Datetime>, 1052 1512 ) -> Self { 1053 - self.__unsafe_private_named.1 = value; 1513 + self.__unsafe_private_named.2 = value; 1054 1514 self 1055 1515 } 1056 1516 } ··· 1061 1521 mut self, 1062 1522 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 1063 1523 ) -> Self { 1064 - self.__unsafe_private_named.2 = value.into(); 1524 + self.__unsafe_private_named.3 = value.into(); 1065 1525 self 1066 1526 } 1067 1527 /// Set the `description` field to an Option value (optional) ··· 1069 1529 mut self, 1070 1530 value: Option<jacquard_common::CowStr<'a>>, 1071 1531 ) -> Self { 1072 - self.__unsafe_private_named.2 = value; 1532 + self.__unsafe_private_named.3 = value; 1073 1533 self 1074 1534 } 1075 1535 } ··· 1084 1544 mut self, 1085 1545 value: impl Into<jacquard_common::types::string::Did<'a>>, 1086 1546 ) -> ProfileViewBuilder<'a, profile_view_state::SetDid<S>> { 1087 - self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 1547 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 1088 1548 ProfileViewBuilder { 1089 1549 _phantom_state: ::core::marker::PhantomData, 1090 1550 __unsafe_private_named: self.__unsafe_private_named, ··· 1099 1559 mut self, 1100 1560 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 1101 1561 ) -> Self { 1102 - self.__unsafe_private_named.4 = value.into(); 1562 + self.__unsafe_private_named.5 = value.into(); 1103 1563 self 1104 1564 } 1105 1565 /// Set the `displayName` field to an Option value (optional) ··· 1107 1567 mut self, 1108 1568 value: Option<jacquard_common::CowStr<'a>>, 1109 1569 ) -> Self { 1110 - self.__unsafe_private_named.4 = value; 1570 + self.__unsafe_private_named.5 = value; 1111 1571 self 1112 1572 } 1113 1573 } ··· 1122 1582 mut self, 1123 1583 value: impl Into<jacquard_common::types::string::Handle<'a>>, 1124 1584 ) -> ProfileViewBuilder<'a, profile_view_state::SetHandle<S>> { 1125 - self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 1585 + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 1126 1586 ProfileViewBuilder { 1127 1587 _phantom_state: ::core::marker::PhantomData, 1128 1588 __unsafe_private_named: self.__unsafe_private_named, ··· 1137 1597 mut self, 1138 1598 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 1139 1599 ) -> Self { 1140 - self.__unsafe_private_named.6 = value.into(); 1600 + self.__unsafe_private_named.7 = value.into(); 1141 1601 self 1142 1602 } 1143 1603 /// Set the `indexedAt` field to an Option value (optional) ··· 1145 1605 mut self, 1146 1606 value: Option<jacquard_common::types::string::Datetime>, 1147 1607 ) -> Self { 1148 - self.__unsafe_private_named.6 = value; 1608 + self.__unsafe_private_named.7 = value; 1149 1609 self 1150 1610 } 1151 1611 } ··· 1156 1616 mut self, 1157 1617 value: impl Into<Option<Vec<crate::com_atproto::label::Label<'a>>>>, 1158 1618 ) -> Self { 1159 - self.__unsafe_private_named.7 = value.into(); 1619 + self.__unsafe_private_named.8 = value.into(); 1160 1620 self 1161 1621 } 1162 1622 /// Set the `labels` field to an Option value (optional) ··· 1164 1624 mut self, 1165 1625 value: Option<Vec<crate::com_atproto::label::Label<'a>>>, 1166 1626 ) -> Self { 1167 - self.__unsafe_private_named.7 = value; 1627 + self.__unsafe_private_named.8 = value; 1168 1628 self 1169 1629 } 1170 1630 } ··· 1175 1635 mut self, 1176 1636 value: impl Into<Option<Vec<jacquard_common::types::string::Uri<'a>>>>, 1177 1637 ) -> Self { 1178 - self.__unsafe_private_named.8 = value.into(); 1638 + self.__unsafe_private_named.9 = value.into(); 1179 1639 self 1180 1640 } 1181 1641 /// Set the `links` field to an Option value (optional) ··· 1183 1643 mut self, 1184 1644 value: Option<Vec<jacquard_common::types::string::Uri<'a>>>, 1185 1645 ) -> Self { 1186 - self.__unsafe_private_named.8 = value; 1646 + self.__unsafe_private_named.9 = value; 1187 1647 self 1188 1648 } 1189 1649 } ··· 1194 1654 mut self, 1195 1655 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 1196 1656 ) -> Self { 1197 - self.__unsafe_private_named.9 = value.into(); 1657 + self.__unsafe_private_named.10 = value.into(); 1198 1658 self 1199 1659 } 1200 1660 /// Set the `location` field to an Option value (optional) 1201 1661 pub fn maybe_location(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 1202 - self.__unsafe_private_named.9 = value; 1662 + self.__unsafe_private_named.10 = value; 1663 + self 1664 + } 1665 + } 1666 + 1667 + impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 1668 + /// Set the `pinned` field (optional) 1669 + pub fn pinned( 1670 + mut self, 1671 + value: impl Into<Option<crate::sh_weaver::actor::PinnedList<'a>>>, 1672 + ) -> Self { 1673 + self.__unsafe_private_named.11 = value.into(); 1674 + self 1675 + } 1676 + /// Set the `pinned` field to an Option value (optional) 1677 + pub fn maybe_pinned( 1678 + mut self, 1679 + value: Option<crate::sh_weaver::actor::PinnedList<'a>>, 1680 + ) -> Self { 1681 + self.__unsafe_private_named.11 = value; 1203 1682 self 1204 1683 } 1205 1684 } ··· 1208 1687 /// Set the `pronouns` field (optional) 1209 1688 pub fn pronouns( 1210 1689 mut self, 1211 - value: impl Into<Option<crate::sh_weaver::actor::profile::PronounsList<'a>>>, 1690 + value: impl Into<Option<crate::sh_weaver::actor::PronounsList<'a>>>, 1212 1691 ) -> Self { 1213 - self.__unsafe_private_named.10 = value.into(); 1692 + self.__unsafe_private_named.12 = value.into(); 1214 1693 self 1215 1694 } 1216 1695 /// Set the `pronouns` field to an Option value (optional) 1217 1696 pub fn maybe_pronouns( 1218 1697 mut self, 1219 - value: Option<crate::sh_weaver::actor::profile::PronounsList<'a>>, 1698 + value: Option<crate::sh_weaver::actor::PronounsList<'a>>, 1220 1699 ) -> Self { 1221 - self.__unsafe_private_named.10 = value; 1700 + self.__unsafe_private_named.12 = value; 1701 + self 1702 + } 1703 + } 1704 + 1705 + impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 1706 + /// Set the `subscribedCount` field (optional) 1707 + pub fn subscribed_count(mut self, value: impl Into<Option<i64>>) -> Self { 1708 + self.__unsafe_private_named.13 = value.into(); 1709 + self 1710 + } 1711 + /// Set the `subscribedCount` field to an Option value (optional) 1712 + pub fn maybe_subscribed_count(mut self, value: Option<i64>) -> Self { 1713 + self.__unsafe_private_named.13 = value; 1714 + self 1715 + } 1716 + } 1717 + 1718 + impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { 1719 + /// Set the `subscriberCount` field (optional) 1720 + pub fn subscriber_count(mut self, value: impl Into<Option<i64>>) -> Self { 1721 + self.__unsafe_private_named.14 = value.into(); 1722 + self 1723 + } 1724 + /// Set the `subscriberCount` field to an Option value (optional) 1725 + pub fn maybe_subscriber_count(mut self, value: Option<i64>) -> Self { 1726 + self.__unsafe_private_named.14 = value; 1222 1727 self 1223 1728 } 1224 1729 } ··· 1233 1738 pub fn build(self) -> ProfileView<'a> { 1234 1739 ProfileView { 1235 1740 avatar: self.__unsafe_private_named.0, 1236 - created_at: self.__unsafe_private_named.1, 1237 - description: self.__unsafe_private_named.2, 1238 - did: self.__unsafe_private_named.3.unwrap(), 1239 - display_name: self.__unsafe_private_named.4, 1240 - handle: self.__unsafe_private_named.5.unwrap(), 1241 - indexed_at: self.__unsafe_private_named.6, 1242 - labels: self.__unsafe_private_named.7, 1243 - links: self.__unsafe_private_named.8, 1244 - location: self.__unsafe_private_named.9, 1245 - pronouns: self.__unsafe_private_named.10, 1741 + banner: self.__unsafe_private_named.1, 1742 + created_at: self.__unsafe_private_named.2, 1743 + description: self.__unsafe_private_named.3, 1744 + did: self.__unsafe_private_named.4.unwrap(), 1745 + display_name: self.__unsafe_private_named.5, 1746 + handle: self.__unsafe_private_named.6.unwrap(), 1747 + indexed_at: self.__unsafe_private_named.7, 1748 + labels: self.__unsafe_private_named.8, 1749 + links: self.__unsafe_private_named.9, 1750 + location: self.__unsafe_private_named.10, 1751 + pinned: self.__unsafe_private_named.11, 1752 + pronouns: self.__unsafe_private_named.12, 1753 + subscribed_count: self.__unsafe_private_named.13, 1754 + subscriber_count: self.__unsafe_private_named.14, 1246 1755 extra_data: Default::default(), 1247 1756 } 1248 1757 } ··· 1256 1765 ) -> ProfileView<'a> { 1257 1766 ProfileView { 1258 1767 avatar: self.__unsafe_private_named.0, 1259 - created_at: self.__unsafe_private_named.1, 1260 - description: self.__unsafe_private_named.2, 1261 - did: self.__unsafe_private_named.3.unwrap(), 1262 - display_name: self.__unsafe_private_named.4, 1263 - handle: self.__unsafe_private_named.5.unwrap(), 1264 - indexed_at: self.__unsafe_private_named.6, 1265 - labels: self.__unsafe_private_named.7, 1266 - links: self.__unsafe_private_named.8, 1267 - location: self.__unsafe_private_named.9, 1268 - pronouns: self.__unsafe_private_named.10, 1768 + banner: self.__unsafe_private_named.1, 1769 + created_at: self.__unsafe_private_named.2, 1770 + description: self.__unsafe_private_named.3, 1771 + did: self.__unsafe_private_named.4.unwrap(), 1772 + display_name: self.__unsafe_private_named.5, 1773 + handle: self.__unsafe_private_named.6.unwrap(), 1774 + indexed_at: self.__unsafe_private_named.7, 1775 + labels: self.__unsafe_private_named.8, 1776 + links: self.__unsafe_private_named.9, 1777 + location: self.__unsafe_private_named.10, 1778 + pinned: self.__unsafe_private_named.11, 1779 + pronouns: self.__unsafe_private_named.12, 1780 + subscribed_count: self.__unsafe_private_named.13, 1781 + subscriber_count: self.__unsafe_private_named.14, 1269 1782 extra_data: Some(extra_data), 1270 1783 } 1271 1784 } ··· 1286 1799 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1287 1800 if let Some(ref value) = self.description { 1288 1801 #[allow(unused_comparisons)] 1289 - if <str>::len(value.as_ref()) > 2560usize { 1802 + if <str>::len(value.as_ref()) > 10240usize { 1290 1803 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 1291 1804 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 1292 1805 "description", 1293 1806 ), 1294 - max: 2560usize, 1807 + max: 10240usize, 1295 1808 actual: <str>::len(value.as_ref()), 1296 1809 }); 1297 1810 } ··· 1303 1816 true, 1304 1817 ) 1305 1818 .count(); 1306 - if count > 256usize { 1819 + if count > 1024usize { 1307 1820 return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 1308 1821 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 1309 1822 "description", 1310 1823 ), 1311 - max: 256usize, 1824 + max: 1024usize, 1312 1825 actual: count, 1313 1826 }); 1314 1827 } ··· 1402 1915 } 1403 1916 } 1404 1917 1918 + #[jacquard_derive::lexicon] 1919 + #[derive( 1920 + serde::Serialize, 1921 + serde::Deserialize, 1922 + Debug, 1923 + Clone, 1924 + PartialEq, 1925 + Eq, 1926 + jacquard_derive::IntoStatic 1927 + )] 1928 + #[serde(rename_all = "camelCase")] 1929 + pub struct ProfileViewBasic<'a> { 1930 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1931 + #[serde(borrow)] 1932 + pub avatar: Option<jacquard_common::types::string::Uri<'a>>, 1933 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1934 + pub created_at: Option<jacquard_common::types::string::Datetime>, 1935 + #[serde(borrow)] 1936 + pub did: jacquard_common::types::string::Did<'a>, 1937 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1938 + #[serde(borrow)] 1939 + pub display_name: Option<jacquard_common::CowStr<'a>>, 1940 + #[serde(borrow)] 1941 + pub handle: jacquard_common::types::string::Handle<'a>, 1942 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1943 + pub indexed_at: Option<jacquard_common::types::string::Datetime>, 1944 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1945 + #[serde(borrow)] 1946 + pub labels: Option<Vec<crate::com_atproto::label::Label<'a>>>, 1947 + /// Pronouns to use in user-generated content. 1948 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1949 + #[serde(borrow)] 1950 + pub pronouns: Option<crate::sh_weaver::actor::PronounsList<'a>>, 1951 + } 1952 + 1953 + pub mod profile_view_basic_state { 1954 + 1955 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 1956 + #[allow(unused)] 1957 + use ::core::marker::PhantomData; 1958 + mod sealed { 1959 + pub trait Sealed {} 1960 + } 1961 + /// State trait tracking which required fields have been set 1962 + pub trait State: sealed::Sealed { 1963 + type Did; 1964 + type Handle; 1965 + } 1966 + /// Empty state - all required fields are unset 1967 + pub struct Empty(()); 1968 + impl sealed::Sealed for Empty {} 1969 + impl State for Empty { 1970 + type Did = Unset; 1971 + type Handle = Unset; 1972 + } 1973 + ///State transition - sets the `did` field to Set 1974 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 1975 + impl<S: State> sealed::Sealed for SetDid<S> {} 1976 + impl<S: State> State for SetDid<S> { 1977 + type Did = Set<members::did>; 1978 + type Handle = S::Handle; 1979 + } 1980 + ///State transition - sets the `handle` field to Set 1981 + pub struct SetHandle<S: State = Empty>(PhantomData<fn() -> S>); 1982 + impl<S: State> sealed::Sealed for SetHandle<S> {} 1983 + impl<S: State> State for SetHandle<S> { 1984 + type Did = S::Did; 1985 + type Handle = Set<members::handle>; 1986 + } 1987 + /// Marker types for field names 1988 + #[allow(non_camel_case_types)] 1989 + pub mod members { 1990 + ///Marker type for the `did` field 1991 + pub struct did(()); 1992 + ///Marker type for the `handle` field 1993 + pub struct handle(()); 1994 + } 1995 + } 1996 + 1997 + /// Builder for constructing an instance of this type 1998 + pub struct ProfileViewBasicBuilder<'a, S: profile_view_basic_state::State> { 1999 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 2000 + __unsafe_private_named: ( 2001 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 2002 + ::core::option::Option<jacquard_common::types::string::Datetime>, 2003 + ::core::option::Option<jacquard_common::types::string::Did<'a>>, 2004 + ::core::option::Option<jacquard_common::CowStr<'a>>, 2005 + ::core::option::Option<jacquard_common::types::string::Handle<'a>>, 2006 + ::core::option::Option<jacquard_common::types::string::Datetime>, 2007 + ::core::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, 2008 + ::core::option::Option<crate::sh_weaver::actor::PronounsList<'a>>, 2009 + ), 2010 + _phantom: ::core::marker::PhantomData<&'a ()>, 2011 + } 2012 + 2013 + impl<'a> ProfileViewBasic<'a> { 2014 + /// Create a new builder for this type 2015 + pub fn new() -> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { 2016 + ProfileViewBasicBuilder::new() 2017 + } 2018 + } 2019 + 2020 + impl<'a> ProfileViewBasicBuilder<'a, profile_view_basic_state::Empty> { 2021 + /// Create a new builder with all fields unset 2022 + pub fn new() -> Self { 2023 + ProfileViewBasicBuilder { 2024 + _phantom_state: ::core::marker::PhantomData, 2025 + __unsafe_private_named: (None, None, None, None, None, None, None, None), 2026 + _phantom: ::core::marker::PhantomData, 2027 + } 2028 + } 2029 + } 2030 + 2031 + impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2032 + /// Set the `avatar` field (optional) 2033 + pub fn avatar( 2034 + mut self, 2035 + value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 2036 + ) -> Self { 2037 + self.__unsafe_private_named.0 = value.into(); 2038 + self 2039 + } 2040 + /// Set the `avatar` field to an Option value (optional) 2041 + pub fn maybe_avatar( 2042 + mut self, 2043 + value: Option<jacquard_common::types::string::Uri<'a>>, 2044 + ) -> Self { 2045 + self.__unsafe_private_named.0 = value; 2046 + self 2047 + } 2048 + } 2049 + 2050 + impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2051 + /// Set the `createdAt` field (optional) 2052 + pub fn created_at( 2053 + mut self, 2054 + value: impl Into<Option<jacquard_common::types::string::Datetime>>, 2055 + ) -> Self { 2056 + self.__unsafe_private_named.1 = value.into(); 2057 + self 2058 + } 2059 + /// Set the `createdAt` field to an Option value (optional) 2060 + pub fn maybe_created_at( 2061 + mut self, 2062 + value: Option<jacquard_common::types::string::Datetime>, 2063 + ) -> Self { 2064 + self.__unsafe_private_named.1 = value; 2065 + self 2066 + } 2067 + } 2068 + 2069 + impl<'a, S> ProfileViewBasicBuilder<'a, S> 2070 + where 2071 + S: profile_view_basic_state::State, 2072 + S::Did: profile_view_basic_state::IsUnset, 2073 + { 2074 + /// Set the `did` field (required) 2075 + pub fn did( 2076 + mut self, 2077 + value: impl Into<jacquard_common::types::string::Did<'a>>, 2078 + ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetDid<S>> { 2079 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 2080 + ProfileViewBasicBuilder { 2081 + _phantom_state: ::core::marker::PhantomData, 2082 + __unsafe_private_named: self.__unsafe_private_named, 2083 + _phantom: ::core::marker::PhantomData, 2084 + } 2085 + } 2086 + } 2087 + 2088 + impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2089 + /// Set the `displayName` field (optional) 2090 + pub fn display_name( 2091 + mut self, 2092 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 2093 + ) -> Self { 2094 + self.__unsafe_private_named.3 = value.into(); 2095 + self 2096 + } 2097 + /// Set the `displayName` field to an Option value (optional) 2098 + pub fn maybe_display_name( 2099 + mut self, 2100 + value: Option<jacquard_common::CowStr<'a>>, 2101 + ) -> Self { 2102 + self.__unsafe_private_named.3 = value; 2103 + self 2104 + } 2105 + } 2106 + 2107 + impl<'a, S> ProfileViewBasicBuilder<'a, S> 2108 + where 2109 + S: profile_view_basic_state::State, 2110 + S::Handle: profile_view_basic_state::IsUnset, 2111 + { 2112 + /// Set the `handle` field (required) 2113 + pub fn handle( 2114 + mut self, 2115 + value: impl Into<jacquard_common::types::string::Handle<'a>>, 2116 + ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetHandle<S>> { 2117 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 2118 + ProfileViewBasicBuilder { 2119 + _phantom_state: ::core::marker::PhantomData, 2120 + __unsafe_private_named: self.__unsafe_private_named, 2121 + _phantom: ::core::marker::PhantomData, 2122 + } 2123 + } 2124 + } 2125 + 2126 + impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2127 + /// Set the `indexedAt` field (optional) 2128 + pub fn indexed_at( 2129 + mut self, 2130 + value: impl Into<Option<jacquard_common::types::string::Datetime>>, 2131 + ) -> Self { 2132 + self.__unsafe_private_named.5 = value.into(); 2133 + self 2134 + } 2135 + /// Set the `indexedAt` field to an Option value (optional) 2136 + pub fn maybe_indexed_at( 2137 + mut self, 2138 + value: Option<jacquard_common::types::string::Datetime>, 2139 + ) -> Self { 2140 + self.__unsafe_private_named.5 = value; 2141 + self 2142 + } 2143 + } 2144 + 2145 + impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2146 + /// Set the `labels` field (optional) 2147 + pub fn labels( 2148 + mut self, 2149 + value: impl Into<Option<Vec<crate::com_atproto::label::Label<'a>>>>, 2150 + ) -> Self { 2151 + self.__unsafe_private_named.6 = value.into(); 2152 + self 2153 + } 2154 + /// Set the `labels` field to an Option value (optional) 2155 + pub fn maybe_labels( 2156 + mut self, 2157 + value: Option<Vec<crate::com_atproto::label::Label<'a>>>, 2158 + ) -> Self { 2159 + self.__unsafe_private_named.6 = value; 2160 + self 2161 + } 2162 + } 2163 + 2164 + impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { 2165 + /// Set the `pronouns` field (optional) 2166 + pub fn pronouns( 2167 + mut self, 2168 + value: impl Into<Option<crate::sh_weaver::actor::PronounsList<'a>>>, 2169 + ) -> Self { 2170 + self.__unsafe_private_named.7 = value.into(); 2171 + self 2172 + } 2173 + /// Set the `pronouns` field to an Option value (optional) 2174 + pub fn maybe_pronouns( 2175 + mut self, 2176 + value: Option<crate::sh_weaver::actor::PronounsList<'a>>, 2177 + ) -> Self { 2178 + self.__unsafe_private_named.7 = value; 2179 + self 2180 + } 2181 + } 2182 + 2183 + impl<'a, S> ProfileViewBasicBuilder<'a, S> 2184 + where 2185 + S: profile_view_basic_state::State, 2186 + S::Did: profile_view_basic_state::IsSet, 2187 + S::Handle: profile_view_basic_state::IsSet, 2188 + { 2189 + /// Build the final struct 2190 + pub fn build(self) -> ProfileViewBasic<'a> { 2191 + ProfileViewBasic { 2192 + avatar: self.__unsafe_private_named.0, 2193 + created_at: self.__unsafe_private_named.1, 2194 + did: self.__unsafe_private_named.2.unwrap(), 2195 + display_name: self.__unsafe_private_named.3, 2196 + handle: self.__unsafe_private_named.4.unwrap(), 2197 + indexed_at: self.__unsafe_private_named.5, 2198 + labels: self.__unsafe_private_named.6, 2199 + pronouns: self.__unsafe_private_named.7, 2200 + extra_data: Default::default(), 2201 + } 2202 + } 2203 + /// Build the final struct with custom extra_data 2204 + pub fn build_with_data( 2205 + self, 2206 + extra_data: std::collections::BTreeMap< 2207 + jacquard_common::smol_str::SmolStr, 2208 + jacquard_common::types::value::Data<'a>, 2209 + >, 2210 + ) -> ProfileViewBasic<'a> { 2211 + ProfileViewBasic { 2212 + avatar: self.__unsafe_private_named.0, 2213 + created_at: self.__unsafe_private_named.1, 2214 + did: self.__unsafe_private_named.2.unwrap(), 2215 + display_name: self.__unsafe_private_named.3, 2216 + handle: self.__unsafe_private_named.4.unwrap(), 2217 + indexed_at: self.__unsafe_private_named.5, 2218 + labels: self.__unsafe_private_named.6, 2219 + pronouns: self.__unsafe_private_named.7, 2220 + extra_data: Some(extra_data), 2221 + } 2222 + } 2223 + } 2224 + 2225 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileViewBasic<'a> { 2226 + fn nsid() -> &'static str { 2227 + "sh.weaver.actor.defs" 2228 + } 2229 + fn def_name() -> &'static str { 2230 + "profileViewBasic" 2231 + } 2232 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 2233 + lexicon_doc_sh_weaver_actor_defs() 2234 + } 2235 + fn validate( 2236 + &self, 2237 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 2238 + if let Some(ref value) = self.display_name { 2239 + #[allow(unused_comparisons)] 2240 + if <str>::len(value.as_ref()) > 640usize { 2241 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 2242 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2243 + "display_name", 2244 + ), 2245 + max: 640usize, 2246 + actual: <str>::len(value.as_ref()), 2247 + }); 2248 + } 2249 + } 2250 + if let Some(ref value) = self.display_name { 2251 + { 2252 + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( 2253 + value.as_ref(), 2254 + true, 2255 + ) 2256 + .count(); 2257 + if count > 64usize { 2258 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 2259 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 2260 + "display_name", 2261 + ), 2262 + max: 64usize, 2263 + actual: count, 2264 + }); 2265 + } 2266 + } 2267 + } 2268 + Ok(()) 2269 + } 2270 + } 2271 + 2272 + pub type PronounsList<'a> = Vec<jacquard_common::CowStr<'a>>; 1405 2273 #[jacquard_derive::lexicon] 1406 2274 #[derive( 1407 2275 serde::Serialize,
+165 -82
crates/jacquard-api/src/sh_weaver/actor/profile.rs
··· 22 22 #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 23 #[serde(borrow)] 24 24 pub avatar: Option<jacquard_common::types::blob::BlobRef<'a>>, 25 + /// Larger horizontal image to display behind profile view. 26 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 27 + #[serde(borrow)] 28 + pub banner: Option<jacquard_common::types::blob::BlobRef<'a>>, 25 29 /// Include link to this account on Bluesky. 26 30 #[serde(skip_serializing_if = "std::option::Option::is_none")] 27 31 pub bluesky: Option<bool>, ··· 34 38 #[serde(skip_serializing_if = "std::option::Option::is_none")] 35 39 #[serde(borrow)] 36 40 pub display_name: Option<jacquard_common::CowStr<'a>>, 41 + /// Self-label values, specific to the application, on the overall account. 42 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 43 + #[serde(borrow)] 44 + pub labels: Option<crate::com_atproto::label::SelfLabels<'a>>, 37 45 #[serde(skip_serializing_if = "std::option::Option::is_none")] 38 46 #[serde(borrow)] 39 47 pub links: Option<Vec<jacquard_common::types::string::Uri<'a>>>, ··· 41 49 #[serde(skip_serializing_if = "std::option::Option::is_none")] 42 50 #[serde(borrow)] 43 51 pub location: Option<jacquard_common::CowStr<'a>>, 52 + /// Notebooks or other records pinned for display. 44 53 #[serde(skip_serializing_if = "std::option::Option::is_none")] 45 54 #[serde(borrow)] 46 - pub pinned_post: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 55 + pub pinned: Option<crate::sh_weaver::actor::PinnedList<'a>>, 47 56 /// Pronouns to use in user-generated content. 48 57 #[serde(skip_serializing_if = "std::option::Option::is_none")] 49 58 #[serde(borrow)] 50 - pub pronouns: Option<crate::sh_weaver::actor::profile::PronounsList<'a>>, 59 + pub pronouns: Option<crate::sh_weaver::actor::PronounsList<'a>>, 60 + /// Include link to this account on stream.place. 61 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 62 + pub streamplace: Option<bool>, 51 63 /// Include link to this account on Tangled. 52 64 #[serde(skip_serializing_if = "std::option::Option::is_none")] 53 65 pub tangled: Option<bool>, ··· 77 89 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 78 90 __unsafe_private_named: ( 79 91 ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 92 + ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 80 93 ::core::option::Option<bool>, 81 94 ::core::option::Option<jacquard_common::types::string::Datetime>, 82 95 ::core::option::Option<jacquard_common::CowStr<'a>>, 83 96 ::core::option::Option<jacquard_common::CowStr<'a>>, 97 + ::core::option::Option<crate::com_atproto::label::SelfLabels<'a>>, 84 98 ::core::option::Option<Vec<jacquard_common::types::string::Uri<'a>>>, 85 99 ::core::option::Option<jacquard_common::CowStr<'a>>, 86 - ::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 87 - ::core::option::Option<crate::sh_weaver::actor::profile::PronounsList<'a>>, 100 + ::core::option::Option<crate::sh_weaver::actor::PinnedList<'a>>, 101 + ::core::option::Option<crate::sh_weaver::actor::PronounsList<'a>>, 102 + ::core::option::Option<bool>, 88 103 ::core::option::Option<bool>, 89 104 ), 90 105 _phantom: ::core::marker::PhantomData<&'a ()>, ··· 103 118 ProfileBuilder { 104 119 _phantom_state: ::core::marker::PhantomData, 105 120 __unsafe_private_named: ( 121 + None, 106 122 None, 107 123 None, 108 124 None, ··· 113 129 None, 114 130 None, 115 131 None, 132 + None, 133 + None, 116 134 ), 117 135 _phantom: ::core::marker::PhantomData, 118 136 } ··· 139 157 } 140 158 141 159 impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 160 + /// Set the `banner` field (optional) 161 + pub fn banner( 162 + mut self, 163 + value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>, 164 + ) -> Self { 165 + self.__unsafe_private_named.1 = value.into(); 166 + self 167 + } 168 + /// Set the `banner` field to an Option value (optional) 169 + pub fn maybe_banner( 170 + mut self, 171 + value: Option<jacquard_common::types::blob::BlobRef<'a>>, 172 + ) -> Self { 173 + self.__unsafe_private_named.1 = value; 174 + self 175 + } 176 + } 177 + 178 + impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 142 179 /// Set the `bluesky` field (optional) 143 180 pub fn bluesky(mut self, value: impl Into<Option<bool>>) -> Self { 144 - self.__unsafe_private_named.1 = value.into(); 181 + self.__unsafe_private_named.2 = value.into(); 145 182 self 146 183 } 147 184 /// Set the `bluesky` field to an Option value (optional) 148 185 pub fn maybe_bluesky(mut self, value: Option<bool>) -> Self { 149 - self.__unsafe_private_named.1 = value; 186 + self.__unsafe_private_named.2 = value; 150 187 self 151 188 } 152 189 } ··· 157 194 mut self, 158 195 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 159 196 ) -> Self { 160 - self.__unsafe_private_named.2 = value.into(); 197 + self.__unsafe_private_named.3 = value.into(); 161 198 self 162 199 } 163 200 /// Set the `createdAt` field to an Option value (optional) ··· 165 202 mut self, 166 203 value: Option<jacquard_common::types::string::Datetime>, 167 204 ) -> Self { 168 - self.__unsafe_private_named.2 = value; 205 + self.__unsafe_private_named.3 = value; 169 206 self 170 207 } 171 208 } ··· 176 213 mut self, 177 214 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 178 215 ) -> Self { 179 - self.__unsafe_private_named.3 = value.into(); 216 + self.__unsafe_private_named.4 = value.into(); 180 217 self 181 218 } 182 219 /// Set the `description` field to an Option value (optional) ··· 184 221 mut self, 185 222 value: Option<jacquard_common::CowStr<'a>>, 186 223 ) -> Self { 187 - self.__unsafe_private_named.3 = value; 224 + self.__unsafe_private_named.4 = value; 188 225 self 189 226 } 190 227 } ··· 195 232 mut self, 196 233 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 197 234 ) -> Self { 198 - self.__unsafe_private_named.4 = value.into(); 235 + self.__unsafe_private_named.5 = value.into(); 199 236 self 200 237 } 201 238 /// Set the `displayName` field to an Option value (optional) ··· 203 240 mut self, 204 241 value: Option<jacquard_common::CowStr<'a>>, 205 242 ) -> Self { 206 - self.__unsafe_private_named.4 = value; 243 + self.__unsafe_private_named.5 = value; 244 + self 245 + } 246 + } 247 + 248 + impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 249 + /// Set the `labels` field (optional) 250 + pub fn labels( 251 + mut self, 252 + value: impl Into<Option<crate::com_atproto::label::SelfLabels<'a>>>, 253 + ) -> Self { 254 + self.__unsafe_private_named.6 = value.into(); 255 + self 256 + } 257 + /// Set the `labels` field to an Option value (optional) 258 + pub fn maybe_labels( 259 + mut self, 260 + value: Option<crate::com_atproto::label::SelfLabels<'a>>, 261 + ) -> Self { 262 + self.__unsafe_private_named.6 = value; 207 263 self 208 264 } 209 265 } ··· 214 270 mut self, 215 271 value: impl Into<Option<Vec<jacquard_common::types::string::Uri<'a>>>>, 216 272 ) -> Self { 217 - self.__unsafe_private_named.5 = value.into(); 273 + self.__unsafe_private_named.7 = value.into(); 218 274 self 219 275 } 220 276 /// Set the `links` field to an Option value (optional) ··· 222 278 mut self, 223 279 value: Option<Vec<jacquard_common::types::string::Uri<'a>>>, 224 280 ) -> Self { 225 - self.__unsafe_private_named.5 = value; 281 + self.__unsafe_private_named.7 = value; 226 282 self 227 283 } 228 284 } ··· 233 289 mut self, 234 290 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 235 291 ) -> Self { 236 - self.__unsafe_private_named.6 = value.into(); 292 + self.__unsafe_private_named.8 = value.into(); 237 293 self 238 294 } 239 295 /// Set the `location` field to an Option value (optional) 240 296 pub fn maybe_location(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 241 - self.__unsafe_private_named.6 = value; 297 + self.__unsafe_private_named.8 = value; 242 298 self 243 299 } 244 300 } 245 301 246 302 impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 247 - /// Set the `pinnedPost` field (optional) 248 - pub fn pinned_post( 303 + /// Set the `pinned` field (optional) 304 + pub fn pinned( 249 305 mut self, 250 - value: impl Into<Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>, 306 + value: impl Into<Option<crate::sh_weaver::actor::PinnedList<'a>>>, 251 307 ) -> Self { 252 - self.__unsafe_private_named.7 = value.into(); 308 + self.__unsafe_private_named.9 = value.into(); 253 309 self 254 310 } 255 - /// Set the `pinnedPost` field to an Option value (optional) 256 - pub fn maybe_pinned_post( 311 + /// Set the `pinned` field to an Option value (optional) 312 + pub fn maybe_pinned( 257 313 mut self, 258 - value: Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 314 + value: Option<crate::sh_weaver::actor::PinnedList<'a>>, 259 315 ) -> Self { 260 - self.__unsafe_private_named.7 = value; 316 + self.__unsafe_private_named.9 = value; 261 317 self 262 318 } 263 319 } ··· 266 322 /// Set the `pronouns` field (optional) 267 323 pub fn pronouns( 268 324 mut self, 269 - value: impl Into<Option<crate::sh_weaver::actor::profile::PronounsList<'a>>>, 325 + value: impl Into<Option<crate::sh_weaver::actor::PronounsList<'a>>>, 270 326 ) -> Self { 271 - self.__unsafe_private_named.8 = value.into(); 327 + self.__unsafe_private_named.10 = value.into(); 272 328 self 273 329 } 274 330 /// Set the `pronouns` field to an Option value (optional) 275 331 pub fn maybe_pronouns( 276 332 mut self, 277 - value: Option<crate::sh_weaver::actor::profile::PronounsList<'a>>, 333 + value: Option<crate::sh_weaver::actor::PronounsList<'a>>, 278 334 ) -> Self { 279 - self.__unsafe_private_named.8 = value; 335 + self.__unsafe_private_named.10 = value; 336 + self 337 + } 338 + } 339 + 340 + impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 341 + /// Set the `streamplace` field (optional) 342 + pub fn streamplace(mut self, value: impl Into<Option<bool>>) -> Self { 343 + self.__unsafe_private_named.11 = value.into(); 344 + self 345 + } 346 + /// Set the `streamplace` field to an Option value (optional) 347 + pub fn maybe_streamplace(mut self, value: Option<bool>) -> Self { 348 + self.__unsafe_private_named.11 = value; 280 349 self 281 350 } 282 351 } ··· 284 353 impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 285 354 /// Set the `tangled` field (optional) 286 355 pub fn tangled(mut self, value: impl Into<Option<bool>>) -> Self { 287 - self.__unsafe_private_named.9 = value.into(); 356 + self.__unsafe_private_named.12 = value.into(); 288 357 self 289 358 } 290 359 /// Set the `tangled` field to an Option value (optional) 291 360 pub fn maybe_tangled(mut self, value: Option<bool>) -> Self { 292 - self.__unsafe_private_named.9 = value; 361 + self.__unsafe_private_named.12 = value; 293 362 self 294 363 } 295 364 } ··· 302 371 pub fn build(self) -> Profile<'a> { 303 372 Profile { 304 373 avatar: self.__unsafe_private_named.0, 305 - bluesky: self.__unsafe_private_named.1, 306 - created_at: self.__unsafe_private_named.2, 307 - description: self.__unsafe_private_named.3, 308 - display_name: self.__unsafe_private_named.4, 309 - links: self.__unsafe_private_named.5, 310 - location: self.__unsafe_private_named.6, 311 - pinned_post: self.__unsafe_private_named.7, 312 - pronouns: self.__unsafe_private_named.8, 313 - tangled: self.__unsafe_private_named.9, 374 + banner: self.__unsafe_private_named.1, 375 + bluesky: self.__unsafe_private_named.2, 376 + created_at: self.__unsafe_private_named.3, 377 + description: self.__unsafe_private_named.4, 378 + display_name: self.__unsafe_private_named.5, 379 + labels: self.__unsafe_private_named.6, 380 + links: self.__unsafe_private_named.7, 381 + location: self.__unsafe_private_named.8, 382 + pinned: self.__unsafe_private_named.9, 383 + pronouns: self.__unsafe_private_named.10, 384 + streamplace: self.__unsafe_private_named.11, 385 + tangled: self.__unsafe_private_named.12, 314 386 extra_data: Default::default(), 315 387 } 316 388 } ··· 324 396 ) -> Profile<'a> { 325 397 Profile { 326 398 avatar: self.__unsafe_private_named.0, 327 - bluesky: self.__unsafe_private_named.1, 328 - created_at: self.__unsafe_private_named.2, 329 - description: self.__unsafe_private_named.3, 330 - display_name: self.__unsafe_private_named.4, 331 - links: self.__unsafe_private_named.5, 332 - location: self.__unsafe_private_named.6, 333 - pinned_post: self.__unsafe_private_named.7, 334 - pronouns: self.__unsafe_private_named.8, 335 - tangled: self.__unsafe_private_named.9, 399 + banner: self.__unsafe_private_named.1, 400 + bluesky: self.__unsafe_private_named.2, 401 + created_at: self.__unsafe_private_named.3, 402 + description: self.__unsafe_private_named.4, 403 + display_name: self.__unsafe_private_named.5, 404 + labels: self.__unsafe_private_named.6, 405 + links: self.__unsafe_private_named.7, 406 + location: self.__unsafe_private_named.8, 407 + pinned: self.__unsafe_private_named.9, 408 + pronouns: self.__unsafe_private_named.10, 409 + streamplace: self.__unsafe_private_named.11, 410 + tangled: self.__unsafe_private_named.12, 336 411 extra_data: Some(extra_data), 337 412 } 338 413 } ··· 414 489 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 415 490 if let Some(ref value) = self.description { 416 491 #[allow(unused_comparisons)] 417 - if <str>::len(value.as_ref()) > 2560usize { 492 + if <str>::len(value.as_ref()) > 10240usize { 418 493 return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 419 494 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 420 495 "description", 421 496 ), 422 - max: 2560usize, 497 + max: 10240usize, 423 498 actual: <str>::len(value.as_ref()), 424 499 }); 425 500 } ··· 431 506 true, 432 507 ) 433 508 .count(); 434 - if count > 256usize { 509 + if count > 1024usize { 435 510 return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 436 511 path: ::jacquard_lexicon::validation::ValidationPath::from_field( 437 512 "description", 438 513 ), 439 - max: 256usize, 514 + max: 1024usize, 440 515 actual: count, 441 516 }); 442 517 } ··· 565 640 }), 566 641 ); 567 642 map.insert( 643 + ::jacquard_common::smol_str::SmolStr::new_static("banner"), 644 + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 645 + description: None, 646 + accept: None, 647 + max_size: None, 648 + }), 649 + ); 650 + map.insert( 568 651 ::jacquard_common::smol_str::SmolStr::new_static("bluesky"), 569 652 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 570 653 description: None, ··· 604 687 format: None, 605 688 default: None, 606 689 min_length: None, 607 - max_length: Some(2560usize), 690 + max_length: Some(10240usize), 608 691 min_graphemes: None, 609 - max_graphemes: Some(256usize), 692 + max_graphemes: Some(1024usize), 610 693 r#enum: None, 611 694 r#const: None, 612 695 known_values: None, ··· 630 713 }), 631 714 ); 632 715 map.insert( 716 + ::jacquard_common::smol_str::SmolStr::new_static("labels"), 717 + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 718 + description: Some( 719 + ::jacquard_common::CowStr::new_static( 720 + "Self-label values, specific to the application, on the overall account.", 721 + ), 722 + ), 723 + refs: vec![ 724 + ::jacquard_common::CowStr::new_static("com.atproto.label.defs#selfLabels") 725 + ], 726 + closed: None, 727 + }), 728 + ); 729 + map.insert( 633 730 ::jacquard_common::smol_str::SmolStr::new_static("links"), 634 731 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 635 732 description: None, ··· 677 774 }), 678 775 ); 679 776 map.insert( 680 - ::jacquard_common::smol_str::SmolStr::new_static( 681 - "pinnedPost", 682 - ), 777 + ::jacquard_common::smol_str::SmolStr::new_static("pinned"), 683 778 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 684 779 description: None, 685 780 r#ref: ::jacquard_common::CowStr::new_static( 686 - "com.atproto.repo.strongRef", 781 + "sh.weaver.actor.defs#pinnedList", 687 782 ), 688 783 }), 689 784 ); ··· 694 789 ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 695 790 description: None, 696 791 r#ref: ::jacquard_common::CowStr::new_static( 697 - "#pronounsList", 792 + "sh.weaver.actor.defs#pronounsList", 698 793 ), 699 794 }), 700 795 ); 701 796 map.insert( 797 + ::jacquard_common::smol_str::SmolStr::new_static( 798 + "streamplace", 799 + ), 800 + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 801 + description: None, 802 + default: None, 803 + r#const: None, 804 + }), 805 + ); 806 + map.insert( 702 807 ::jacquard_common::smol_str::SmolStr::new_static("tangled"), 703 808 ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 704 809 description: None, ··· 711 816 }), 712 817 }), 713 818 ); 714 - map.insert( 715 - ::jacquard_common::smol_str::SmolStr::new_static("pronounsList"), 716 - ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { 717 - description: None, 718 - items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 719 - description: None, 720 - format: None, 721 - default: None, 722 - min_length: None, 723 - max_length: None, 724 - min_graphemes: None, 725 - max_graphemes: None, 726 - r#enum: None, 727 - r#const: None, 728 - known_values: None, 729 - }), 730 - min_length: None, 731 - max_length: None, 732 - }), 733 - ); 734 819 map 735 820 }, 736 821 } 737 - } 738 - 739 - pub type PronounsList<'a> = Vec<jacquard_common::CowStr<'a>>; 822 + }
+29 -30
crates/jacquard-api/src/sh_weaver/edit/cursor.rs
··· 259 259 required: Some( 260 260 vec![ 261 261 ::jacquard_common::smol_str::SmolStr::new_static("container"), 262 - ::jacquard_common::smol_str::SmolStr::new_static("die") 262 + ::jacquard_common::smol_str::SmolStr::new_static("id") 263 263 ], 264 264 ), 265 265 nullable: None, ··· 742 742 pub struct Cursor<'a> { 743 743 #[serde(borrow)] 744 744 pub container: crate::sh_weaver::edit::cursor::ContainerId<'a>, 745 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 746 745 #[serde(borrow)] 747 - pub id: Option<crate::sh_weaver::edit::cursor::Id<'a>>, 746 + pub id: crate::sh_weaver::edit::cursor::Id<'a>, 748 747 #[serde(skip_serializing_if = "std::option::Option::is_none")] 749 748 #[serde(borrow)] 750 749 pub side: Option<crate::sh_weaver::edit::cursor::CursorSide<'a>>, ··· 761 760 /// State trait tracking which required fields have been set 762 761 pub trait State: sealed::Sealed { 763 762 type Container; 764 - type Die; 763 + type Id; 765 764 } 766 765 /// Empty state - all required fields are unset 767 766 pub struct Empty(()); 768 767 impl sealed::Sealed for Empty {} 769 768 impl State for Empty { 770 769 type Container = Unset; 771 - type Die = Unset; 770 + type Id = Unset; 772 771 } 773 772 ///State transition - sets the `container` field to Set 774 773 pub struct SetContainer<S: State = Empty>(PhantomData<fn() -> S>); 775 774 impl<S: State> sealed::Sealed for SetContainer<S> {} 776 775 impl<S: State> State for SetContainer<S> { 777 776 type Container = Set<members::container>; 778 - type Die = S::Die; 777 + type Id = S::Id; 779 778 } 780 - ///State transition - sets the `die` field to Set 781 - pub struct SetDie<S: State = Empty>(PhantomData<fn() -> S>); 782 - impl<S: State> sealed::Sealed for SetDie<S> {} 783 - impl<S: State> State for SetDie<S> { 779 + ///State transition - sets the `id` field to Set 780 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 781 + impl<S: State> sealed::Sealed for SetId<S> {} 782 + impl<S: State> State for SetId<S> { 784 783 type Container = S::Container; 785 - type Die = Set<members::die>; 784 + type Id = Set<members::id>; 786 785 } 787 786 /// Marker types for field names 788 787 #[allow(non_camel_case_types)] 789 788 pub mod members { 790 789 ///Marker type for the `container` field 791 790 pub struct container(()); 792 - ///Marker type for the `die` field 793 - pub struct die(()); 791 + ///Marker type for the `id` field 792 + pub struct id(()); 794 793 } 795 794 } 796 795 ··· 842 841 } 843 842 } 844 843 845 - impl<'a, S: cursor_state::State> CursorBuilder<'a, S> { 846 - /// Set the `id` field (optional) 844 + impl<'a, S> CursorBuilder<'a, S> 845 + where 846 + S: cursor_state::State, 847 + S::Id: cursor_state::IsUnset, 848 + { 849 + /// Set the `id` field (required) 847 850 pub fn id( 848 851 mut self, 849 - value: impl Into<Option<crate::sh_weaver::edit::cursor::Id<'a>>>, 850 - ) -> Self { 851 - self.__unsafe_private_named.1 = value.into(); 852 - self 853 - } 854 - /// Set the `id` field to an Option value (optional) 855 - pub fn maybe_id( 856 - mut self, 857 - value: Option<crate::sh_weaver::edit::cursor::Id<'a>>, 858 - ) -> Self { 859 - self.__unsafe_private_named.1 = value; 860 - self 852 + value: impl Into<crate::sh_weaver::edit::cursor::Id<'a>>, 853 + ) -> CursorBuilder<'a, cursor_state::SetId<S>> { 854 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 855 + CursorBuilder { 856 + _phantom_state: ::core::marker::PhantomData, 857 + __unsafe_private_named: self.__unsafe_private_named, 858 + _phantom: ::core::marker::PhantomData, 859 + } 861 860 } 862 861 } 863 862 ··· 884 883 where 885 884 S: cursor_state::State, 886 885 S::Container: cursor_state::IsSet, 887 - S::Die: cursor_state::IsSet, 886 + S::Id: cursor_state::IsSet, 888 887 { 889 888 /// Build the final struct 890 889 pub fn build(self) -> Cursor<'a> { 891 890 Cursor { 892 891 container: self.__unsafe_private_named.0.unwrap(), 893 - id: self.__unsafe_private_named.1, 892 + id: self.__unsafe_private_named.1.unwrap(), 894 893 side: self.__unsafe_private_named.2, 895 894 extra_data: Default::default(), 896 895 } ··· 905 904 ) -> Cursor<'a> { 906 905 Cursor { 907 906 container: self.__unsafe_private_named.0.unwrap(), 908 - id: self.__unsafe_private_named.1, 907 + id: self.__unsafe_private_named.1.unwrap(), 909 908 side: self.__unsafe_private_named.2, 910 909 extra_data: Some(extra_data), 911 910 }
+631 -1
crates/jacquard-api/src/sh_weaver/embed/images.rs
··· 29 29 pub dimensions: Option<ImageDimensions<'a>>, 30 30 #[serde(borrow)] 31 31 pub image: jacquard_common::types::blob::BlobRef<'a>, 32 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 33 + #[serde(borrow)] 34 + pub name: Option<jacquard_common::CowStr<'a>>, 32 35 } 33 36 34 37 pub mod image_state { ··· 83 86 ::core::option::Option<jacquard_common::CowStr<'a>>, 84 87 ::core::option::Option<ImageDimensions<'a>>, 85 88 ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 89 + ::core::option::Option<jacquard_common::CowStr<'a>>, 86 90 ), 87 91 _phantom: ::core::marker::PhantomData<&'a ()>, 88 92 } ··· 99 103 pub fn new() -> Self { 100 104 ImageBuilder { 101 105 _phantom_state: ::core::marker::PhantomData, 102 - __unsafe_private_named: (None, None, None, None), 106 + __unsafe_private_named: (None, None, None, None, None), 103 107 _phantom: ::core::marker::PhantomData, 104 108 } 105 109 } ··· 172 176 } 173 177 } 174 178 179 + impl<'a, S: image_state::State> ImageBuilder<'a, S> { 180 + /// Set the `name` field (optional) 181 + pub fn name( 182 + mut self, 183 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 184 + ) -> Self { 185 + self.__unsafe_private_named.4 = value.into(); 186 + self 187 + } 188 + /// Set the `name` field to an Option value (optional) 189 + pub fn maybe_name(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 190 + self.__unsafe_private_named.4 = value; 191 + self 192 + } 193 + } 194 + 175 195 impl<'a, S> ImageBuilder<'a, S> 176 196 where 177 197 S: image_state::State, ··· 185 205 blurhash: self.__unsafe_private_named.1, 186 206 dimensions: self.__unsafe_private_named.2, 187 207 image: self.__unsafe_private_named.3.unwrap(), 208 + name: self.__unsafe_private_named.4, 188 209 extra_data: Default::default(), 189 210 } 190 211 } ··· 201 222 blurhash: self.__unsafe_private_named.1, 202 223 dimensions: self.__unsafe_private_named.2, 203 224 image: self.__unsafe_private_named.3.unwrap(), 225 + name: self.__unsafe_private_named.4, 204 226 extra_data: Some(extra_data), 205 227 } 206 228 } ··· 311 333 max_size: None, 312 334 }), 313 335 ); 336 + map.insert( 337 + ::jacquard_common::smol_str::SmolStr::new_static("name"), 338 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 339 + description: None, 340 + format: None, 341 + default: None, 342 + min_length: None, 343 + max_length: Some(128usize), 344 + min_graphemes: None, 345 + max_graphemes: None, 346 + r#enum: None, 347 + r#const: None, 348 + known_values: None, 349 + }), 350 + ); 314 351 map 315 352 }, 316 353 }), ··· 342 379 }, 343 380 }), 344 381 ); 382 + map.insert( 383 + ::jacquard_common::smol_str::SmolStr::new_static("view"), 384 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 385 + description: None, 386 + required: Some( 387 + vec![::jacquard_common::smol_str::SmolStr::new_static("images")], 388 + ), 389 + nullable: None, 390 + properties: { 391 + #[allow(unused_mut)] 392 + let mut map = ::std::collections::BTreeMap::new(); 393 + map.insert( 394 + ::jacquard_common::smol_str::SmolStr::new_static("images"), 395 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 396 + description: None, 397 + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 398 + description: None, 399 + r#ref: ::jacquard_common::CowStr::new_static("#viewImage"), 400 + }), 401 + min_length: None, 402 + max_length: Some(48usize), 403 + }), 404 + ); 405 + map 406 + }, 407 + }), 408 + ); 409 + map.insert( 410 + ::jacquard_common::smol_str::SmolStr::new_static("viewImage"), 411 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 412 + description: None, 413 + required: Some( 414 + vec![ 415 + ::jacquard_common::smol_str::SmolStr::new_static("thumb"), 416 + ::jacquard_common::smol_str::SmolStr::new_static("fullsize"), 417 + ::jacquard_common::smol_str::SmolStr::new_static("alt") 418 + ], 419 + ), 420 + nullable: None, 421 + properties: { 422 + #[allow(unused_mut)] 423 + let mut map = ::std::collections::BTreeMap::new(); 424 + map.insert( 425 + ::jacquard_common::smol_str::SmolStr::new_static("alt"), 426 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 427 + description: Some( 428 + ::jacquard_common::CowStr::new_static( 429 + "Alt text description of the image, for accessibility.", 430 + ), 431 + ), 432 + format: None, 433 + default: None, 434 + min_length: None, 435 + max_length: None, 436 + min_graphemes: None, 437 + max_graphemes: None, 438 + r#enum: None, 439 + r#const: None, 440 + known_values: None, 441 + }), 442 + ); 443 + map.insert( 444 + ::jacquard_common::smol_str::SmolStr::new_static( 445 + "dimensions", 446 + ), 447 + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 448 + description: None, 449 + refs: vec![ 450 + ::jacquard_common::CowStr::new_static("app.bsky.embed.defs#aspectRatio"), 451 + ::jacquard_common::CowStr::new_static("sh.weaver.embed.defs#percentSize"), 452 + ::jacquard_common::CowStr::new_static("sh.weaver.embed.defs#pixelSize") 453 + ], 454 + closed: None, 455 + }), 456 + ); 457 + map.insert( 458 + ::jacquard_common::smol_str::SmolStr::new_static("fullsize"), 459 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 460 + description: Some( 461 + ::jacquard_common::CowStr::new_static( 462 + "Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View.", 463 + ), 464 + ), 465 + format: Some( 466 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 467 + ), 468 + default: None, 469 + min_length: None, 470 + max_length: None, 471 + min_graphemes: None, 472 + max_graphemes: None, 473 + r#enum: None, 474 + r#const: None, 475 + known_values: None, 476 + }), 477 + ); 478 + map.insert( 479 + ::jacquard_common::smol_str::SmolStr::new_static("name"), 480 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 481 + description: None, 482 + format: None, 483 + default: None, 484 + min_length: None, 485 + max_length: Some(128usize), 486 + min_graphemes: None, 487 + max_graphemes: None, 488 + r#enum: None, 489 + r#const: None, 490 + known_values: None, 491 + }), 492 + ); 493 + map.insert( 494 + ::jacquard_common::smol_str::SmolStr::new_static("thumb"), 495 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 496 + description: Some( 497 + ::jacquard_common::CowStr::new_static( 498 + "Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View.", 499 + ), 500 + ), 501 + format: Some( 502 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 503 + ), 504 + default: None, 505 + min_length: None, 506 + max_length: None, 507 + min_graphemes: None, 508 + max_graphemes: None, 509 + r#enum: None, 510 + r#const: None, 511 + known_values: None, 512 + }), 513 + ); 514 + map 515 + }, 516 + }), 517 + ); 345 518 map 346 519 }, 347 520 } ··· 368 541 "blurhash", 369 542 ), 370 543 max: 32usize, 544 + actual: <str>::len(value.as_ref()), 545 + }); 546 + } 547 + } 548 + if let Some(ref value) = self.name { 549 + #[allow(unused_comparisons)] 550 + if <str>::len(value.as_ref()) > 128usize { 551 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 552 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 553 + "name", 554 + ), 555 + max: 128usize, 371 556 actual: <str>::len(value.as_ref()), 372 557 }); 373 558 } ··· 520 705 ), 521 706 max: 48usize, 522 707 actual: value.len(), 708 + }); 709 + } 710 + } 711 + Ok(()) 712 + } 713 + } 714 + 715 + #[jacquard_derive::lexicon] 716 + #[derive( 717 + serde::Serialize, 718 + serde::Deserialize, 719 + Debug, 720 + Clone, 721 + PartialEq, 722 + Eq, 723 + jacquard_derive::IntoStatic 724 + )] 725 + #[serde(rename_all = "camelCase")] 726 + pub struct View<'a> { 727 + #[serde(borrow)] 728 + pub images: Vec<crate::sh_weaver::embed::images::ViewImage<'a>>, 729 + } 730 + 731 + pub mod view_state { 732 + 733 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 734 + #[allow(unused)] 735 + use ::core::marker::PhantomData; 736 + mod sealed { 737 + pub trait Sealed {} 738 + } 739 + /// State trait tracking which required fields have been set 740 + pub trait State: sealed::Sealed { 741 + type Images; 742 + } 743 + /// Empty state - all required fields are unset 744 + pub struct Empty(()); 745 + impl sealed::Sealed for Empty {} 746 + impl State for Empty { 747 + type Images = Unset; 748 + } 749 + ///State transition - sets the `images` field to Set 750 + pub struct SetImages<S: State = Empty>(PhantomData<fn() -> S>); 751 + impl<S: State> sealed::Sealed for SetImages<S> {} 752 + impl<S: State> State for SetImages<S> { 753 + type Images = Set<members::images>; 754 + } 755 + /// Marker types for field names 756 + #[allow(non_camel_case_types)] 757 + pub mod members { 758 + ///Marker type for the `images` field 759 + pub struct images(()); 760 + } 761 + } 762 + 763 + /// Builder for constructing an instance of this type 764 + pub struct ViewBuilder<'a, S: view_state::State> { 765 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 766 + __unsafe_private_named: ( 767 + ::core::option::Option<Vec<crate::sh_weaver::embed::images::ViewImage<'a>>>, 768 + ), 769 + _phantom: ::core::marker::PhantomData<&'a ()>, 770 + } 771 + 772 + impl<'a> View<'a> { 773 + /// Create a new builder for this type 774 + pub fn new() -> ViewBuilder<'a, view_state::Empty> { 775 + ViewBuilder::new() 776 + } 777 + } 778 + 779 + impl<'a> ViewBuilder<'a, view_state::Empty> { 780 + /// Create a new builder with all fields unset 781 + pub fn new() -> Self { 782 + ViewBuilder { 783 + _phantom_state: ::core::marker::PhantomData, 784 + __unsafe_private_named: (None,), 785 + _phantom: ::core::marker::PhantomData, 786 + } 787 + } 788 + } 789 + 790 + impl<'a, S> ViewBuilder<'a, S> 791 + where 792 + S: view_state::State, 793 + S::Images: view_state::IsUnset, 794 + { 795 + /// Set the `images` field (required) 796 + pub fn images( 797 + mut self, 798 + value: impl Into<Vec<crate::sh_weaver::embed::images::ViewImage<'a>>>, 799 + ) -> ViewBuilder<'a, view_state::SetImages<S>> { 800 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 801 + ViewBuilder { 802 + _phantom_state: ::core::marker::PhantomData, 803 + __unsafe_private_named: self.__unsafe_private_named, 804 + _phantom: ::core::marker::PhantomData, 805 + } 806 + } 807 + } 808 + 809 + impl<'a, S> ViewBuilder<'a, S> 810 + where 811 + S: view_state::State, 812 + S::Images: view_state::IsSet, 813 + { 814 + /// Build the final struct 815 + pub fn build(self) -> View<'a> { 816 + View { 817 + images: self.__unsafe_private_named.0.unwrap(), 818 + extra_data: Default::default(), 819 + } 820 + } 821 + /// Build the final struct with custom extra_data 822 + pub fn build_with_data( 823 + self, 824 + extra_data: std::collections::BTreeMap< 825 + jacquard_common::smol_str::SmolStr, 826 + jacquard_common::types::value::Data<'a>, 827 + >, 828 + ) -> View<'a> { 829 + View { 830 + images: self.__unsafe_private_named.0.unwrap(), 831 + extra_data: Some(extra_data), 832 + } 833 + } 834 + } 835 + 836 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for View<'a> { 837 + fn nsid() -> &'static str { 838 + "sh.weaver.embed.images" 839 + } 840 + fn def_name() -> &'static str { 841 + "view" 842 + } 843 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 844 + lexicon_doc_sh_weaver_embed_images() 845 + } 846 + fn validate( 847 + &self, 848 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 849 + { 850 + let value = &self.images; 851 + #[allow(unused_comparisons)] 852 + if value.len() > 48usize { 853 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 854 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 855 + "images", 856 + ), 857 + max: 48usize, 858 + actual: value.len(), 859 + }); 860 + } 861 + } 862 + Ok(()) 863 + } 864 + } 865 + 866 + #[jacquard_derive::lexicon] 867 + #[derive( 868 + serde::Serialize, 869 + serde::Deserialize, 870 + Debug, 871 + Clone, 872 + PartialEq, 873 + Eq, 874 + jacquard_derive::IntoStatic 875 + )] 876 + #[serde(rename_all = "camelCase")] 877 + pub struct ViewImage<'a> { 878 + /// Alt text description of the image, for accessibility. 879 + #[serde(borrow)] 880 + pub alt: jacquard_common::CowStr<'a>, 881 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 882 + #[serde(borrow)] 883 + pub dimensions: Option<ViewImageDimensions<'a>>, 884 + /// Fully-qualified URL where a large version of the image can be fetched. May or may not be the exact original blob. For example, CDN location provided by the App View. 885 + #[serde(borrow)] 886 + pub fullsize: jacquard_common::types::string::Uri<'a>, 887 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 888 + #[serde(borrow)] 889 + pub name: Option<jacquard_common::CowStr<'a>>, 890 + /// Fully-qualified URL where a thumbnail of the image can be fetched. For example, CDN location provided by the App View. 891 + #[serde(borrow)] 892 + pub thumb: jacquard_common::types::string::Uri<'a>, 893 + } 894 + 895 + pub mod view_image_state { 896 + 897 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 898 + #[allow(unused)] 899 + use ::core::marker::PhantomData; 900 + mod sealed { 901 + pub trait Sealed {} 902 + } 903 + /// State trait tracking which required fields have been set 904 + pub trait State: sealed::Sealed { 905 + type Thumb; 906 + type Fullsize; 907 + type Alt; 908 + } 909 + /// Empty state - all required fields are unset 910 + pub struct Empty(()); 911 + impl sealed::Sealed for Empty {} 912 + impl State for Empty { 913 + type Thumb = Unset; 914 + type Fullsize = Unset; 915 + type Alt = Unset; 916 + } 917 + ///State transition - sets the `thumb` field to Set 918 + pub struct SetThumb<S: State = Empty>(PhantomData<fn() -> S>); 919 + impl<S: State> sealed::Sealed for SetThumb<S> {} 920 + impl<S: State> State for SetThumb<S> { 921 + type Thumb = Set<members::thumb>; 922 + type Fullsize = S::Fullsize; 923 + type Alt = S::Alt; 924 + } 925 + ///State transition - sets the `fullsize` field to Set 926 + pub struct SetFullsize<S: State = Empty>(PhantomData<fn() -> S>); 927 + impl<S: State> sealed::Sealed for SetFullsize<S> {} 928 + impl<S: State> State for SetFullsize<S> { 929 + type Thumb = S::Thumb; 930 + type Fullsize = Set<members::fullsize>; 931 + type Alt = S::Alt; 932 + } 933 + ///State transition - sets the `alt` field to Set 934 + pub struct SetAlt<S: State = Empty>(PhantomData<fn() -> S>); 935 + impl<S: State> sealed::Sealed for SetAlt<S> {} 936 + impl<S: State> State for SetAlt<S> { 937 + type Thumb = S::Thumb; 938 + type Fullsize = S::Fullsize; 939 + type Alt = Set<members::alt>; 940 + } 941 + /// Marker types for field names 942 + #[allow(non_camel_case_types)] 943 + pub mod members { 944 + ///Marker type for the `thumb` field 945 + pub struct thumb(()); 946 + ///Marker type for the `fullsize` field 947 + pub struct fullsize(()); 948 + ///Marker type for the `alt` field 949 + pub struct alt(()); 950 + } 951 + } 952 + 953 + /// Builder for constructing an instance of this type 954 + pub struct ViewImageBuilder<'a, S: view_image_state::State> { 955 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 956 + __unsafe_private_named: ( 957 + ::core::option::Option<jacquard_common::CowStr<'a>>, 958 + ::core::option::Option<ViewImageDimensions<'a>>, 959 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 960 + ::core::option::Option<jacquard_common::CowStr<'a>>, 961 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 962 + ), 963 + _phantom: ::core::marker::PhantomData<&'a ()>, 964 + } 965 + 966 + impl<'a> ViewImage<'a> { 967 + /// Create a new builder for this type 968 + pub fn new() -> ViewImageBuilder<'a, view_image_state::Empty> { 969 + ViewImageBuilder::new() 970 + } 971 + } 972 + 973 + impl<'a> ViewImageBuilder<'a, view_image_state::Empty> { 974 + /// Create a new builder with all fields unset 975 + pub fn new() -> Self { 976 + ViewImageBuilder { 977 + _phantom_state: ::core::marker::PhantomData, 978 + __unsafe_private_named: (None, None, None, None, None), 979 + _phantom: ::core::marker::PhantomData, 980 + } 981 + } 982 + } 983 + 984 + impl<'a, S> ViewImageBuilder<'a, S> 985 + where 986 + S: view_image_state::State, 987 + S::Alt: view_image_state::IsUnset, 988 + { 989 + /// Set the `alt` field (required) 990 + pub fn alt( 991 + mut self, 992 + value: impl Into<jacquard_common::CowStr<'a>>, 993 + ) -> ViewImageBuilder<'a, view_image_state::SetAlt<S>> { 994 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 995 + ViewImageBuilder { 996 + _phantom_state: ::core::marker::PhantomData, 997 + __unsafe_private_named: self.__unsafe_private_named, 998 + _phantom: ::core::marker::PhantomData, 999 + } 1000 + } 1001 + } 1002 + 1003 + impl<'a, S: view_image_state::State> ViewImageBuilder<'a, S> { 1004 + /// Set the `dimensions` field (optional) 1005 + pub fn dimensions( 1006 + mut self, 1007 + value: impl Into<Option<ViewImageDimensions<'a>>>, 1008 + ) -> Self { 1009 + self.__unsafe_private_named.1 = value.into(); 1010 + self 1011 + } 1012 + /// Set the `dimensions` field to an Option value (optional) 1013 + pub fn maybe_dimensions(mut self, value: Option<ViewImageDimensions<'a>>) -> Self { 1014 + self.__unsafe_private_named.1 = value; 1015 + self 1016 + } 1017 + } 1018 + 1019 + impl<'a, S> ViewImageBuilder<'a, S> 1020 + where 1021 + S: view_image_state::State, 1022 + S::Fullsize: view_image_state::IsUnset, 1023 + { 1024 + /// Set the `fullsize` field (required) 1025 + pub fn fullsize( 1026 + mut self, 1027 + value: impl Into<jacquard_common::types::string::Uri<'a>>, 1028 + ) -> ViewImageBuilder<'a, view_image_state::SetFullsize<S>> { 1029 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 1030 + ViewImageBuilder { 1031 + _phantom_state: ::core::marker::PhantomData, 1032 + __unsafe_private_named: self.__unsafe_private_named, 1033 + _phantom: ::core::marker::PhantomData, 1034 + } 1035 + } 1036 + } 1037 + 1038 + impl<'a, S: view_image_state::State> ViewImageBuilder<'a, S> { 1039 + /// Set the `name` field (optional) 1040 + pub fn name( 1041 + mut self, 1042 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 1043 + ) -> Self { 1044 + self.__unsafe_private_named.3 = value.into(); 1045 + self 1046 + } 1047 + /// Set the `name` field to an Option value (optional) 1048 + pub fn maybe_name(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 1049 + self.__unsafe_private_named.3 = value; 1050 + self 1051 + } 1052 + } 1053 + 1054 + impl<'a, S> ViewImageBuilder<'a, S> 1055 + where 1056 + S: view_image_state::State, 1057 + S::Thumb: view_image_state::IsUnset, 1058 + { 1059 + /// Set the `thumb` field (required) 1060 + pub fn thumb( 1061 + mut self, 1062 + value: impl Into<jacquard_common::types::string::Uri<'a>>, 1063 + ) -> ViewImageBuilder<'a, view_image_state::SetThumb<S>> { 1064 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 1065 + ViewImageBuilder { 1066 + _phantom_state: ::core::marker::PhantomData, 1067 + __unsafe_private_named: self.__unsafe_private_named, 1068 + _phantom: ::core::marker::PhantomData, 1069 + } 1070 + } 1071 + } 1072 + 1073 + impl<'a, S> ViewImageBuilder<'a, S> 1074 + where 1075 + S: view_image_state::State, 1076 + S::Thumb: view_image_state::IsSet, 1077 + S::Fullsize: view_image_state::IsSet, 1078 + S::Alt: view_image_state::IsSet, 1079 + { 1080 + /// Build the final struct 1081 + pub fn build(self) -> ViewImage<'a> { 1082 + ViewImage { 1083 + alt: self.__unsafe_private_named.0.unwrap(), 1084 + dimensions: self.__unsafe_private_named.1, 1085 + fullsize: self.__unsafe_private_named.2.unwrap(), 1086 + name: self.__unsafe_private_named.3, 1087 + thumb: self.__unsafe_private_named.4.unwrap(), 1088 + extra_data: Default::default(), 1089 + } 1090 + } 1091 + /// Build the final struct with custom extra_data 1092 + pub fn build_with_data( 1093 + self, 1094 + extra_data: std::collections::BTreeMap< 1095 + jacquard_common::smol_str::SmolStr, 1096 + jacquard_common::types::value::Data<'a>, 1097 + >, 1098 + ) -> ViewImage<'a> { 1099 + ViewImage { 1100 + alt: self.__unsafe_private_named.0.unwrap(), 1101 + dimensions: self.__unsafe_private_named.1, 1102 + fullsize: self.__unsafe_private_named.2.unwrap(), 1103 + name: self.__unsafe_private_named.3, 1104 + thumb: self.__unsafe_private_named.4.unwrap(), 1105 + extra_data: Some(extra_data), 1106 + } 1107 + } 1108 + } 1109 + 1110 + #[jacquard_derive::open_union] 1111 + #[derive( 1112 + serde::Serialize, 1113 + serde::Deserialize, 1114 + Debug, 1115 + Clone, 1116 + PartialEq, 1117 + Eq, 1118 + jacquard_derive::IntoStatic 1119 + )] 1120 + #[serde(tag = "$type")] 1121 + #[serde(bound(deserialize = "'de: 'a"))] 1122 + pub enum ViewImageDimensions<'a> { 1123 + #[serde(rename = "app.bsky.embed.defs#aspectRatio")] 1124 + AspectRatio(Box<crate::app_bsky::embed::AspectRatio<'a>>), 1125 + #[serde(rename = "sh.weaver.embed.defs#percentSize")] 1126 + PercentSize(Box<crate::sh_weaver::embed::PercentSize<'a>>), 1127 + #[serde(rename = "sh.weaver.embed.defs#pixelSize")] 1128 + PixelSize(Box<crate::sh_weaver::embed::PixelSize<'a>>), 1129 + } 1130 + 1131 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewImage<'a> { 1132 + fn nsid() -> &'static str { 1133 + "sh.weaver.embed.images" 1134 + } 1135 + fn def_name() -> &'static str { 1136 + "viewImage" 1137 + } 1138 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1139 + lexicon_doc_sh_weaver_embed_images() 1140 + } 1141 + fn validate( 1142 + &self, 1143 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1144 + if let Some(ref value) = self.name { 1145 + #[allow(unused_comparisons)] 1146 + if <str>::len(value.as_ref()) > 128usize { 1147 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 1148 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 1149 + "name", 1150 + ), 1151 + max: 128usize, 1152 + actual: <str>::len(value.as_ref()), 523 1153 }); 524 1154 } 525 1155 }
+488 -55
crates/jacquard-api/src/sh_weaver/embed/records.rs
··· 18 18 #[serde(rename_all = "camelCase")] 19 19 pub struct Records<'a> { 20 20 #[serde(borrow)] 21 - pub records: Vec<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 21 + pub records: Vec<crate::sh_weaver::embed::records::RecordEmbed<'a>>, 22 22 } 23 23 24 24 pub mod records_state { ··· 57 57 pub struct RecordsBuilder<'a, S: records_state::State> { 58 58 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 59 59 __unsafe_private_named: ( 60 - ::core::option::Option<Vec<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>, 60 + ::core::option::Option<Vec<crate::sh_weaver::embed::records::RecordEmbed<'a>>>, 61 61 ), 62 62 _phantom: ::core::marker::PhantomData<&'a ()>, 63 63 } ··· 88 88 /// Set the `records` field (required) 89 89 pub fn records( 90 90 mut self, 91 - value: impl Into<Vec<crate::com_atproto::repo::strong_ref::StrongRef<'a>>>, 91 + value: impl Into<Vec<crate::sh_weaver::embed::records::RecordEmbed<'a>>>, 92 92 ) -> RecordsBuilder<'a, records_state::SetRecords<S>> { 93 93 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 94 94 RecordsBuilder { ··· 153 153 description: None, 154 154 items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 155 155 description: None, 156 - r#ref: ::jacquard_common::CowStr::new_static( 157 - "com.atproto.repo.strongRef", 158 - ), 156 + r#ref: ::jacquard_common::CowStr::new_static("#recordEmbed"), 159 157 }), 160 158 min_length: None, 161 159 max_length: Some(48usize), ··· 166 164 }), 167 165 ); 168 166 map.insert( 167 + ::jacquard_common::smol_str::SmolStr::new_static("recordEmbed"), 168 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 169 + description: None, 170 + required: Some( 171 + vec![::jacquard_common::smol_str::SmolStr::new_static("record")], 172 + ), 173 + nullable: None, 174 + properties: { 175 + #[allow(unused_mut)] 176 + let mut map = ::std::collections::BTreeMap::new(); 177 + map.insert( 178 + ::jacquard_common::smol_str::SmolStr::new_static("name"), 179 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 180 + description: None, 181 + format: None, 182 + default: None, 183 + min_length: None, 184 + max_length: Some(128usize), 185 + min_graphemes: None, 186 + max_graphemes: None, 187 + r#enum: None, 188 + r#const: None, 189 + known_values: None, 190 + }), 191 + ); 192 + map.insert( 193 + ::jacquard_common::smol_str::SmolStr::new_static("record"), 194 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 195 + description: None, 196 + r#ref: ::jacquard_common::CowStr::new_static( 197 + "com.atproto.repo.strongRef", 198 + ), 199 + }), 200 + ); 201 + map 202 + }, 203 + }), 204 + ); 205 + map.insert( 206 + ::jacquard_common::smol_str::SmolStr::new_static("recordEmbedView"), 207 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 208 + description: None, 209 + required: Some( 210 + vec![ 211 + ::jacquard_common::smol_str::SmolStr::new_static("recordView") 212 + ], 213 + ), 214 + nullable: None, 215 + properties: { 216 + #[allow(unused_mut)] 217 + let mut map = ::std::collections::BTreeMap::new(); 218 + map.insert( 219 + ::jacquard_common::smol_str::SmolStr::new_static("name"), 220 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 221 + description: None, 222 + format: None, 223 + default: None, 224 + min_length: None, 225 + max_length: Some(128usize), 226 + min_graphemes: None, 227 + max_graphemes: None, 228 + r#enum: None, 229 + r#const: None, 230 + known_values: None, 231 + }), 232 + ); 233 + map.insert( 234 + ::jacquard_common::smol_str::SmolStr::new_static( 235 + "recordView", 236 + ), 237 + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 238 + description: None, 239 + refs: vec![ 240 + ::jacquard_common::CowStr::new_static("app.bsky.embed.images#view"), 241 + ::jacquard_common::CowStr::new_static("app.bsky.embed.video#view"), 242 + ::jacquard_common::CowStr::new_static("app.bsky.embed.external#view"), 243 + ::jacquard_common::CowStr::new_static("app.bsky.embed.record#view"), 244 + ::jacquard_common::CowStr::new_static("app.bsky.embed.recordWithMedia#view"), 245 + ::jacquard_common::CowStr::new_static("sh.weaver.embed.records#view"), 246 + ::jacquard_common::CowStr::new_static("sh.weaver.embed.images#view") 247 + ], 248 + closed: None, 249 + }), 250 + ); 251 + map 252 + }, 253 + }), 254 + ); 255 + map.insert( 169 256 ::jacquard_common::smol_str::SmolStr::new_static("view"), 170 257 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 171 258 description: None, ··· 355 442 let mut map = ::std::collections::BTreeMap::new(); 356 443 map.insert( 357 444 ::jacquard_common::smol_str::SmolStr::new_static("author"), 358 - ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { 445 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 359 446 description: None, 360 - refs: vec![ 361 - ::jacquard_common::CowStr::new_static("app.bsky.actor.defs#profileViewBasic") 362 - ], 363 - closed: None, 447 + r#ref: ::jacquard_common::CowStr::new_static( 448 + "sh.weaver.actor.defs#profileDataViewBasic", 449 + ), 364 450 }), 365 451 ); 366 452 map.insert( ··· 384 470 ::jacquard_common::smol_str::SmolStr::new_static("embeds"), 385 471 ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 386 472 description: None, 387 - items: ::jacquard_lexicon::lexicon::LexArrayItem::Union(::jacquard_lexicon::lexicon::LexRefUnion { 473 + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 388 474 description: None, 389 - refs: vec![ 390 - ::jacquard_common::CowStr::new_static("app.bsky.embed.images#view"), 391 - ::jacquard_common::CowStr::new_static("app.bsky.embed.video#view"), 392 - ::jacquard_common::CowStr::new_static("app.bsky.embed.external#view"), 393 - ::jacquard_common::CowStr::new_static("app.bsky.embed.record#view"), 394 - ::jacquard_common::CowStr::new_static("app.bsky.embed.recordWithMedia#view"), 395 - ::jacquard_common::CowStr::new_static("sh.weaver.embed.records#view") 396 - ], 397 - closed: None, 475 + r#ref: ::jacquard_common::CowStr::new_static( 476 + "#recordEmbedView", 477 + ), 398 478 }), 399 479 min_length: None, 400 480 max_length: None, ··· 558 638 jacquard_derive::IntoStatic 559 639 )] 560 640 #[serde(rename_all = "camelCase")] 641 + pub struct RecordEmbed<'a> { 642 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 643 + #[serde(borrow)] 644 + pub name: Option<jacquard_common::CowStr<'a>>, 645 + #[serde(borrow)] 646 + pub record: crate::com_atproto::repo::strong_ref::StrongRef<'a>, 647 + } 648 + 649 + pub mod record_embed_state { 650 + 651 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 652 + #[allow(unused)] 653 + use ::core::marker::PhantomData; 654 + mod sealed { 655 + pub trait Sealed {} 656 + } 657 + /// State trait tracking which required fields have been set 658 + pub trait State: sealed::Sealed { 659 + type Record; 660 + } 661 + /// Empty state - all required fields are unset 662 + pub struct Empty(()); 663 + impl sealed::Sealed for Empty {} 664 + impl State for Empty { 665 + type Record = Unset; 666 + } 667 + ///State transition - sets the `record` field to Set 668 + pub struct SetRecord<S: State = Empty>(PhantomData<fn() -> S>); 669 + impl<S: State> sealed::Sealed for SetRecord<S> {} 670 + impl<S: State> State for SetRecord<S> { 671 + type Record = Set<members::record>; 672 + } 673 + /// Marker types for field names 674 + #[allow(non_camel_case_types)] 675 + pub mod members { 676 + ///Marker type for the `record` field 677 + pub struct record(()); 678 + } 679 + } 680 + 681 + /// Builder for constructing an instance of this type 682 + pub struct RecordEmbedBuilder<'a, S: record_embed_state::State> { 683 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 684 + __unsafe_private_named: ( 685 + ::core::option::Option<jacquard_common::CowStr<'a>>, 686 + ::core::option::Option<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 687 + ), 688 + _phantom: ::core::marker::PhantomData<&'a ()>, 689 + } 690 + 691 + impl<'a> RecordEmbed<'a> { 692 + /// Create a new builder for this type 693 + pub fn new() -> RecordEmbedBuilder<'a, record_embed_state::Empty> { 694 + RecordEmbedBuilder::new() 695 + } 696 + } 697 + 698 + impl<'a> RecordEmbedBuilder<'a, record_embed_state::Empty> { 699 + /// Create a new builder with all fields unset 700 + pub fn new() -> Self { 701 + RecordEmbedBuilder { 702 + _phantom_state: ::core::marker::PhantomData, 703 + __unsafe_private_named: (None, None), 704 + _phantom: ::core::marker::PhantomData, 705 + } 706 + } 707 + } 708 + 709 + impl<'a, S: record_embed_state::State> RecordEmbedBuilder<'a, S> { 710 + /// Set the `name` field (optional) 711 + pub fn name( 712 + mut self, 713 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 714 + ) -> Self { 715 + self.__unsafe_private_named.0 = value.into(); 716 + self 717 + } 718 + /// Set the `name` field to an Option value (optional) 719 + pub fn maybe_name(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 720 + self.__unsafe_private_named.0 = value; 721 + self 722 + } 723 + } 724 + 725 + impl<'a, S> RecordEmbedBuilder<'a, S> 726 + where 727 + S: record_embed_state::State, 728 + S::Record: record_embed_state::IsUnset, 729 + { 730 + /// Set the `record` field (required) 731 + pub fn record( 732 + mut self, 733 + value: impl Into<crate::com_atproto::repo::strong_ref::StrongRef<'a>>, 734 + ) -> RecordEmbedBuilder<'a, record_embed_state::SetRecord<S>> { 735 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 736 + RecordEmbedBuilder { 737 + _phantom_state: ::core::marker::PhantomData, 738 + __unsafe_private_named: self.__unsafe_private_named, 739 + _phantom: ::core::marker::PhantomData, 740 + } 741 + } 742 + } 743 + 744 + impl<'a, S> RecordEmbedBuilder<'a, S> 745 + where 746 + S: record_embed_state::State, 747 + S::Record: record_embed_state::IsSet, 748 + { 749 + /// Build the final struct 750 + pub fn build(self) -> RecordEmbed<'a> { 751 + RecordEmbed { 752 + name: self.__unsafe_private_named.0, 753 + record: self.__unsafe_private_named.1.unwrap(), 754 + extra_data: Default::default(), 755 + } 756 + } 757 + /// Build the final struct with custom extra_data 758 + pub fn build_with_data( 759 + self, 760 + extra_data: std::collections::BTreeMap< 761 + jacquard_common::smol_str::SmolStr, 762 + jacquard_common::types::value::Data<'a>, 763 + >, 764 + ) -> RecordEmbed<'a> { 765 + RecordEmbed { 766 + name: self.__unsafe_private_named.0, 767 + record: self.__unsafe_private_named.1.unwrap(), 768 + extra_data: Some(extra_data), 769 + } 770 + } 771 + } 772 + 773 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordEmbed<'a> { 774 + fn nsid() -> &'static str { 775 + "sh.weaver.embed.records" 776 + } 777 + fn def_name() -> &'static str { 778 + "recordEmbed" 779 + } 780 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 781 + lexicon_doc_sh_weaver_embed_records() 782 + } 783 + fn validate( 784 + &self, 785 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 786 + if let Some(ref value) = self.name { 787 + #[allow(unused_comparisons)] 788 + if <str>::len(value.as_ref()) > 128usize { 789 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 790 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 791 + "name", 792 + ), 793 + max: 128usize, 794 + actual: <str>::len(value.as_ref()), 795 + }); 796 + } 797 + } 798 + Ok(()) 799 + } 800 + } 801 + 802 + #[jacquard_derive::lexicon] 803 + #[derive( 804 + serde::Serialize, 805 + serde::Deserialize, 806 + Debug, 807 + Clone, 808 + PartialEq, 809 + Eq, 810 + jacquard_derive::IntoStatic 811 + )] 812 + #[serde(rename_all = "camelCase")] 813 + pub struct RecordEmbedView<'a> { 814 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 815 + #[serde(borrow)] 816 + pub name: Option<jacquard_common::CowStr<'a>>, 817 + #[serde(borrow)] 818 + pub record_view: RecordEmbedViewRecordView<'a>, 819 + } 820 + 821 + pub mod record_embed_view_state { 822 + 823 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 824 + #[allow(unused)] 825 + use ::core::marker::PhantomData; 826 + mod sealed { 827 + pub trait Sealed {} 828 + } 829 + /// State trait tracking which required fields have been set 830 + pub trait State: sealed::Sealed { 831 + type RecordView; 832 + } 833 + /// Empty state - all required fields are unset 834 + pub struct Empty(()); 835 + impl sealed::Sealed for Empty {} 836 + impl State for Empty { 837 + type RecordView = Unset; 838 + } 839 + ///State transition - sets the `record_view` field to Set 840 + pub struct SetRecordView<S: State = Empty>(PhantomData<fn() -> S>); 841 + impl<S: State> sealed::Sealed for SetRecordView<S> {} 842 + impl<S: State> State for SetRecordView<S> { 843 + type RecordView = Set<members::record_view>; 844 + } 845 + /// Marker types for field names 846 + #[allow(non_camel_case_types)] 847 + pub mod members { 848 + ///Marker type for the `record_view` field 849 + pub struct record_view(()); 850 + } 851 + } 852 + 853 + /// Builder for constructing an instance of this type 854 + pub struct RecordEmbedViewBuilder<'a, S: record_embed_view_state::State> { 855 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 856 + __unsafe_private_named: ( 857 + ::core::option::Option<jacquard_common::CowStr<'a>>, 858 + ::core::option::Option<RecordEmbedViewRecordView<'a>>, 859 + ), 860 + _phantom: ::core::marker::PhantomData<&'a ()>, 861 + } 862 + 863 + impl<'a> RecordEmbedView<'a> { 864 + /// Create a new builder for this type 865 + pub fn new() -> RecordEmbedViewBuilder<'a, record_embed_view_state::Empty> { 866 + RecordEmbedViewBuilder::new() 867 + } 868 + } 869 + 870 + impl<'a> RecordEmbedViewBuilder<'a, record_embed_view_state::Empty> { 871 + /// Create a new builder with all fields unset 872 + pub fn new() -> Self { 873 + RecordEmbedViewBuilder { 874 + _phantom_state: ::core::marker::PhantomData, 875 + __unsafe_private_named: (None, None), 876 + _phantom: ::core::marker::PhantomData, 877 + } 878 + } 879 + } 880 + 881 + impl<'a, S: record_embed_view_state::State> RecordEmbedViewBuilder<'a, S> { 882 + /// Set the `name` field (optional) 883 + pub fn name( 884 + mut self, 885 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 886 + ) -> Self { 887 + self.__unsafe_private_named.0 = value.into(); 888 + self 889 + } 890 + /// Set the `name` field to an Option value (optional) 891 + pub fn maybe_name(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 892 + self.__unsafe_private_named.0 = value; 893 + self 894 + } 895 + } 896 + 897 + impl<'a, S> RecordEmbedViewBuilder<'a, S> 898 + where 899 + S: record_embed_view_state::State, 900 + S::RecordView: record_embed_view_state::IsUnset, 901 + { 902 + /// Set the `recordView` field (required) 903 + pub fn record_view( 904 + mut self, 905 + value: impl Into<RecordEmbedViewRecordView<'a>>, 906 + ) -> RecordEmbedViewBuilder<'a, record_embed_view_state::SetRecordView<S>> { 907 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 908 + RecordEmbedViewBuilder { 909 + _phantom_state: ::core::marker::PhantomData, 910 + __unsafe_private_named: self.__unsafe_private_named, 911 + _phantom: ::core::marker::PhantomData, 912 + } 913 + } 914 + } 915 + 916 + impl<'a, S> RecordEmbedViewBuilder<'a, S> 917 + where 918 + S: record_embed_view_state::State, 919 + S::RecordView: record_embed_view_state::IsSet, 920 + { 921 + /// Build the final struct 922 + pub fn build(self) -> RecordEmbedView<'a> { 923 + RecordEmbedView { 924 + name: self.__unsafe_private_named.0, 925 + record_view: self.__unsafe_private_named.1.unwrap(), 926 + extra_data: Default::default(), 927 + } 928 + } 929 + /// Build the final struct with custom extra_data 930 + pub fn build_with_data( 931 + self, 932 + extra_data: std::collections::BTreeMap< 933 + jacquard_common::smol_str::SmolStr, 934 + jacquard_common::types::value::Data<'a>, 935 + >, 936 + ) -> RecordEmbedView<'a> { 937 + RecordEmbedView { 938 + name: self.__unsafe_private_named.0, 939 + record_view: self.__unsafe_private_named.1.unwrap(), 940 + extra_data: Some(extra_data), 941 + } 942 + } 943 + } 944 + 945 + #[jacquard_derive::open_union] 946 + #[derive( 947 + serde::Serialize, 948 + serde::Deserialize, 949 + Debug, 950 + Clone, 951 + PartialEq, 952 + Eq, 953 + jacquard_derive::IntoStatic 954 + )] 955 + #[serde(tag = "$type")] 956 + #[serde(bound(deserialize = "'de: 'a"))] 957 + pub enum RecordEmbedViewRecordView<'a> { 958 + #[serde(rename = "app.bsky.embed.images#view")] 959 + BskyImagesView(Box<crate::app_bsky::embed::images::View<'a>>), 960 + #[serde(rename = "app.bsky.embed.video#view")] 961 + VideoView(Box<crate::app_bsky::embed::video::View<'a>>), 962 + #[serde(rename = "app.bsky.embed.external#view")] 963 + ExternalView(Box<crate::app_bsky::embed::external::View<'a>>), 964 + #[serde(rename = "app.bsky.embed.record#view")] 965 + RecordView(Box<crate::app_bsky::embed::record::View<'a>>), 966 + #[serde(rename = "app.bsky.embed.recordWithMedia#view")] 967 + RecordWithMediaView(Box<crate::app_bsky::embed::record_with_media::View<'a>>), 968 + #[serde(rename = "sh.weaver.embed.records#view")] 969 + View(Box<crate::sh_weaver::embed::records::View<'a>>), 970 + #[serde(rename = "sh.weaver.embed.images#view")] 971 + ImagesView(Box<crate::sh_weaver::embed::images::View<'a>>), 972 + } 973 + 974 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordEmbedView<'a> { 975 + fn nsid() -> &'static str { 976 + "sh.weaver.embed.records" 977 + } 978 + fn def_name() -> &'static str { 979 + "recordEmbedView" 980 + } 981 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 982 + lexicon_doc_sh_weaver_embed_records() 983 + } 984 + fn validate( 985 + &self, 986 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 987 + if let Some(ref value) = self.name { 988 + #[allow(unused_comparisons)] 989 + if <str>::len(value.as_ref()) > 128usize { 990 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 991 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 992 + "name", 993 + ), 994 + max: 128usize, 995 + actual: <str>::len(value.as_ref()), 996 + }); 997 + } 998 + } 999 + Ok(()) 1000 + } 1001 + } 1002 + 1003 + #[jacquard_derive::lexicon] 1004 + #[derive( 1005 + serde::Serialize, 1006 + serde::Deserialize, 1007 + Debug, 1008 + Clone, 1009 + PartialEq, 1010 + Eq, 1011 + jacquard_derive::IntoStatic 1012 + )] 1013 + #[serde(rename_all = "camelCase")] 561 1014 pub struct View<'a> { 562 1015 #[serde(borrow)] 563 1016 pub record: ViewUnionRecord<'a>, ··· 1288 1741 #[serde(rename_all = "camelCase")] 1289 1742 pub struct ViewRecord<'a> { 1290 1743 #[serde(borrow)] 1291 - pub author: crate::app_bsky::actor::ProfileViewBasic<'a>, 1744 + pub author: crate::sh_weaver::actor::ProfileDataViewBasic<'a>, 1292 1745 #[serde(borrow)] 1293 1746 pub cid: jacquard_common::types::string::Cid<'a>, 1294 1747 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1295 1748 #[serde(borrow)] 1296 - pub embeds: Option<Vec<ViewRecordEmbedsItem<'a>>>, 1749 + pub embeds: Option<Vec<crate::sh_weaver::embed::records::RecordEmbedView<'a>>>, 1297 1750 pub indexed_at: jacquard_common::types::string::Datetime, 1298 1751 #[serde(skip_serializing_if = "std::option::Option::is_none")] 1299 1752 #[serde(borrow)] ··· 1409 1862 pub struct ViewRecordBuilder<'a, S: view_record_state::State> { 1410 1863 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 1411 1864 __unsafe_private_named: ( 1412 - ::core::option::Option<crate::app_bsky::actor::ProfileViewBasic<'a>>, 1865 + ::core::option::Option<crate::sh_weaver::actor::ProfileDataViewBasic<'a>>, 1413 1866 ::core::option::Option<jacquard_common::types::string::Cid<'a>>, 1414 - ::core::option::Option<Vec<ViewRecordEmbedsItem<'a>>>, 1867 + ::core::option::Option< 1868 + Vec<crate::sh_weaver::embed::records::RecordEmbedView<'a>>, 1869 + >, 1415 1870 ::core::option::Option<jacquard_common::types::string::Datetime>, 1416 1871 ::core::option::Option<Vec<crate::com_atproto::label::Label<'a>>>, 1417 1872 ::core::option::Option<i64>, ··· 1462 1917 /// Set the `author` field (required) 1463 1918 pub fn author( 1464 1919 mut self, 1465 - value: impl Into<crate::app_bsky::actor::ProfileViewBasic<'a>>, 1920 + value: impl Into<crate::sh_weaver::actor::ProfileDataViewBasic<'a>>, 1466 1921 ) -> ViewRecordBuilder<'a, view_record_state::SetAuthor<S>> { 1467 1922 self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 1468 1923 ViewRecordBuilder { ··· 1496 1951 /// Set the `embeds` field (optional) 1497 1952 pub fn embeds( 1498 1953 mut self, 1499 - value: impl Into<Option<Vec<ViewRecordEmbedsItem<'a>>>>, 1954 + value: impl Into< 1955 + Option<Vec<crate::sh_weaver::embed::records::RecordEmbedView<'a>>>, 1956 + >, 1500 1957 ) -> Self { 1501 1958 self.__unsafe_private_named.2 = value.into(); 1502 1959 self 1503 1960 } 1504 1961 /// Set the `embeds` field to an Option value (optional) 1505 - pub fn maybe_embeds(mut self, value: Option<Vec<ViewRecordEmbedsItem<'a>>>) -> Self { 1962 + pub fn maybe_embeds( 1963 + mut self, 1964 + value: Option<Vec<crate::sh_weaver::embed::records::RecordEmbedView<'a>>>, 1965 + ) -> Self { 1506 1966 self.__unsafe_private_named.2 = value; 1507 1967 self 1508 1968 } ··· 1685 2145 extra_data: Some(extra_data), 1686 2146 } 1687 2147 } 1688 - } 1689 - 1690 - #[jacquard_derive::open_union] 1691 - #[derive( 1692 - serde::Serialize, 1693 - serde::Deserialize, 1694 - Debug, 1695 - Clone, 1696 - PartialEq, 1697 - Eq, 1698 - jacquard_derive::IntoStatic 1699 - )] 1700 - #[serde(tag = "$type")] 1701 - #[serde(bound(deserialize = "'de: 'a"))] 1702 - pub enum ViewRecordEmbedsItem<'a> { 1703 - #[serde(rename = "app.bsky.embed.images#view")] 1704 - ImagesView(Box<crate::app_bsky::embed::images::View<'a>>), 1705 - #[serde(rename = "app.bsky.embed.video#view")] 1706 - VideoView(Box<crate::app_bsky::embed::video::View<'a>>), 1707 - #[serde(rename = "app.bsky.embed.external#view")] 1708 - ExternalView(Box<crate::app_bsky::embed::external::View<'a>>), 1709 - #[serde(rename = "app.bsky.embed.record#view")] 1710 - RecordView(Box<crate::app_bsky::embed::record::View<'a>>), 1711 - #[serde(rename = "app.bsky.embed.recordWithMedia#view")] 1712 - RecordWithMediaView(Box<crate::app_bsky::embed::record_with_media::View<'a>>), 1713 - #[serde(rename = "sh.weaver.embed.records#view")] 1714 - View(Box<crate::sh_weaver::embed::records::View<'a>>), 1715 2148 } 1716 2149 1717 2150 impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewRecord<'a> {
+1 -1
crates/jacquard-api/src/sh_weaver/notebook.rs
··· 696 696 format: None, 697 697 default: None, 698 698 min_length: None, 699 - max_length: Some(420usize), 699 + max_length: Some(300usize), 700 700 min_graphemes: None, 701 701 max_graphemes: None, 702 702 r#enum: None,
+1
crates/jacquard-api/src/social_flockfeeds/lexical.rs
··· 69 69 pub mod textobject; 70 70 pub mod thing; 71 71 pub mod videoobject; 72 + pub mod vocab; 72 73 pub mod webcontent; 73 74 pub mod webpage;
+483
crates/jacquard-api/src/social_flockfeeds/lexical/vocab.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: social.flockfeeds.lexical.vocab 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// Canonical schema for vocabulary entries. 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, 12 + serde::Deserialize, 13 + Debug, 14 + Clone, 15 + PartialEq, 16 + Eq, 17 + jacquard_derive::IntoStatic 18 + )] 19 + #[serde(rename_all = "camelCase")] 20 + pub struct Vocab<'a> { 21 + /// Specifies the kind of this record, expected to be a URI (recommended) or plain string. 22 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 + #[serde(borrow)] 24 + pub alternate_type: Option<jacquard_common::CowStr<'a>>, 25 + /// Timestamp when this vocab entry was created (ISO 8601). 26 + pub created_at: jacquard_common::types::string::Datetime, 27 + /// Optional longer description. 28 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 29 + #[serde(borrow)] 30 + pub description: Option<jacquard_common::CowStr<'a>>, 31 + /// Canonical URI/IRI for this vocab term. 32 + #[serde(borrow)] 33 + pub id: jacquard_common::types::string::Uri<'a>, 34 + /// Human-readable label. 35 + #[serde(borrow)] 36 + pub label: jacquard_common::CowStr<'a>, 37 + } 38 + 39 + pub mod vocab_state { 40 + 41 + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; 42 + #[allow(unused)] 43 + use ::core::marker::PhantomData; 44 + mod sealed { 45 + pub trait Sealed {} 46 + } 47 + /// State trait tracking which required fields have been set 48 + pub trait State: sealed::Sealed { 49 + type Id; 50 + type Label; 51 + type CreatedAt; 52 + } 53 + /// Empty state - all required fields are unset 54 + pub struct Empty(()); 55 + impl sealed::Sealed for Empty {} 56 + impl State for Empty { 57 + type Id = Unset; 58 + type Label = Unset; 59 + type CreatedAt = Unset; 60 + } 61 + ///State transition - sets the `id` field to Set 62 + pub struct SetId<S: State = Empty>(PhantomData<fn() -> S>); 63 + impl<S: State> sealed::Sealed for SetId<S> {} 64 + impl<S: State> State for SetId<S> { 65 + type Id = Set<members::id>; 66 + type Label = S::Label; 67 + type CreatedAt = S::CreatedAt; 68 + } 69 + ///State transition - sets the `label` field to Set 70 + pub struct SetLabel<S: State = Empty>(PhantomData<fn() -> S>); 71 + impl<S: State> sealed::Sealed for SetLabel<S> {} 72 + impl<S: State> State for SetLabel<S> { 73 + type Id = S::Id; 74 + type Label = Set<members::label>; 75 + type CreatedAt = S::CreatedAt; 76 + } 77 + ///State transition - sets the `created_at` field to Set 78 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 79 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 80 + impl<S: State> State for SetCreatedAt<S> { 81 + type Id = S::Id; 82 + type Label = S::Label; 83 + type CreatedAt = Set<members::created_at>; 84 + } 85 + /// Marker types for field names 86 + #[allow(non_camel_case_types)] 87 + pub mod members { 88 + ///Marker type for the `id` field 89 + pub struct id(()); 90 + ///Marker type for the `label` field 91 + pub struct label(()); 92 + ///Marker type for the `created_at` field 93 + pub struct created_at(()); 94 + } 95 + } 96 + 97 + /// Builder for constructing an instance of this type 98 + pub struct VocabBuilder<'a, S: vocab_state::State> { 99 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 100 + __unsafe_private_named: ( 101 + ::core::option::Option<jacquard_common::CowStr<'a>>, 102 + ::core::option::Option<jacquard_common::types::string::Datetime>, 103 + ::core::option::Option<jacquard_common::CowStr<'a>>, 104 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 105 + ::core::option::Option<jacquard_common::CowStr<'a>>, 106 + ), 107 + _phantom: ::core::marker::PhantomData<&'a ()>, 108 + } 109 + 110 + impl<'a> Vocab<'a> { 111 + /// Create a new builder for this type 112 + pub fn new() -> VocabBuilder<'a, vocab_state::Empty> { 113 + VocabBuilder::new() 114 + } 115 + } 116 + 117 + impl<'a> VocabBuilder<'a, vocab_state::Empty> { 118 + /// Create a new builder with all fields unset 119 + pub fn new() -> Self { 120 + VocabBuilder { 121 + _phantom_state: ::core::marker::PhantomData, 122 + __unsafe_private_named: (None, None, None, None, None), 123 + _phantom: ::core::marker::PhantomData, 124 + } 125 + } 126 + } 127 + 128 + impl<'a, S: vocab_state::State> VocabBuilder<'a, S> { 129 + /// Set the `alternateType` field (optional) 130 + pub fn alternate_type( 131 + mut self, 132 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 133 + ) -> Self { 134 + self.__unsafe_private_named.0 = value.into(); 135 + self 136 + } 137 + /// Set the `alternateType` field to an Option value (optional) 138 + pub fn maybe_alternate_type( 139 + mut self, 140 + value: Option<jacquard_common::CowStr<'a>>, 141 + ) -> Self { 142 + self.__unsafe_private_named.0 = value; 143 + self 144 + } 145 + } 146 + 147 + impl<'a, S> VocabBuilder<'a, S> 148 + where 149 + S: vocab_state::State, 150 + S::CreatedAt: vocab_state::IsUnset, 151 + { 152 + /// Set the `createdAt` field (required) 153 + pub fn created_at( 154 + mut self, 155 + value: impl Into<jacquard_common::types::string::Datetime>, 156 + ) -> VocabBuilder<'a, vocab_state::SetCreatedAt<S>> { 157 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 158 + VocabBuilder { 159 + _phantom_state: ::core::marker::PhantomData, 160 + __unsafe_private_named: self.__unsafe_private_named, 161 + _phantom: ::core::marker::PhantomData, 162 + } 163 + } 164 + } 165 + 166 + impl<'a, S: vocab_state::State> VocabBuilder<'a, S> { 167 + /// Set the `description` field (optional) 168 + pub fn description( 169 + mut self, 170 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 171 + ) -> Self { 172 + self.__unsafe_private_named.2 = value.into(); 173 + self 174 + } 175 + /// Set the `description` field to an Option value (optional) 176 + pub fn maybe_description( 177 + mut self, 178 + value: Option<jacquard_common::CowStr<'a>>, 179 + ) -> Self { 180 + self.__unsafe_private_named.2 = value; 181 + self 182 + } 183 + } 184 + 185 + impl<'a, S> VocabBuilder<'a, S> 186 + where 187 + S: vocab_state::State, 188 + S::Id: vocab_state::IsUnset, 189 + { 190 + /// Set the `id` field (required) 191 + pub fn id( 192 + mut self, 193 + value: impl Into<jacquard_common::types::string::Uri<'a>>, 194 + ) -> VocabBuilder<'a, vocab_state::SetId<S>> { 195 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 196 + VocabBuilder { 197 + _phantom_state: ::core::marker::PhantomData, 198 + __unsafe_private_named: self.__unsafe_private_named, 199 + _phantom: ::core::marker::PhantomData, 200 + } 201 + } 202 + } 203 + 204 + impl<'a, S> VocabBuilder<'a, S> 205 + where 206 + S: vocab_state::State, 207 + S::Label: vocab_state::IsUnset, 208 + { 209 + /// Set the `label` field (required) 210 + pub fn label( 211 + mut self, 212 + value: impl Into<jacquard_common::CowStr<'a>>, 213 + ) -> VocabBuilder<'a, vocab_state::SetLabel<S>> { 214 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 215 + VocabBuilder { 216 + _phantom_state: ::core::marker::PhantomData, 217 + __unsafe_private_named: self.__unsafe_private_named, 218 + _phantom: ::core::marker::PhantomData, 219 + } 220 + } 221 + } 222 + 223 + impl<'a, S> VocabBuilder<'a, S> 224 + where 225 + S: vocab_state::State, 226 + S::Id: vocab_state::IsSet, 227 + S::Label: vocab_state::IsSet, 228 + S::CreatedAt: vocab_state::IsSet, 229 + { 230 + /// Build the final struct 231 + pub fn build(self) -> Vocab<'a> { 232 + Vocab { 233 + alternate_type: self.__unsafe_private_named.0, 234 + created_at: self.__unsafe_private_named.1.unwrap(), 235 + description: self.__unsafe_private_named.2, 236 + id: self.__unsafe_private_named.3.unwrap(), 237 + label: self.__unsafe_private_named.4.unwrap(), 238 + extra_data: Default::default(), 239 + } 240 + } 241 + /// Build the final struct with custom extra_data 242 + pub fn build_with_data( 243 + self, 244 + extra_data: std::collections::BTreeMap< 245 + jacquard_common::smol_str::SmolStr, 246 + jacquard_common::types::value::Data<'a>, 247 + >, 248 + ) -> Vocab<'a> { 249 + Vocab { 250 + alternate_type: self.__unsafe_private_named.0, 251 + created_at: self.__unsafe_private_named.1.unwrap(), 252 + description: self.__unsafe_private_named.2, 253 + id: self.__unsafe_private_named.3.unwrap(), 254 + label: self.__unsafe_private_named.4.unwrap(), 255 + extra_data: Some(extra_data), 256 + } 257 + } 258 + } 259 + 260 + impl<'a> Vocab<'a> { 261 + pub fn uri( 262 + uri: impl Into<jacquard_common::CowStr<'a>>, 263 + ) -> Result< 264 + jacquard_common::types::uri::RecordUri<'a, VocabRecord>, 265 + jacquard_common::types::uri::UriError, 266 + > { 267 + jacquard_common::types::uri::RecordUri::try_from_uri( 268 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 269 + ) 270 + } 271 + } 272 + 273 + /// Typed wrapper for GetRecord response with this collection's record type. 274 + #[derive( 275 + serde::Serialize, 276 + serde::Deserialize, 277 + Debug, 278 + Clone, 279 + PartialEq, 280 + Eq, 281 + jacquard_derive::IntoStatic 282 + )] 283 + #[serde(rename_all = "camelCase")] 284 + pub struct VocabGetRecordOutput<'a> { 285 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 286 + #[serde(borrow)] 287 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 288 + #[serde(borrow)] 289 + pub uri: jacquard_common::types::string::AtUri<'a>, 290 + #[serde(borrow)] 291 + pub value: Vocab<'a>, 292 + } 293 + 294 + impl From<VocabGetRecordOutput<'_>> for Vocab<'_> { 295 + fn from(output: VocabGetRecordOutput<'_>) -> Self { 296 + use jacquard_common::IntoStatic; 297 + output.value.into_static() 298 + } 299 + } 300 + 301 + impl jacquard_common::types::collection::Collection for Vocab<'_> { 302 + const NSID: &'static str = "social.flockfeeds.lexical.vocab"; 303 + type Record = VocabRecord; 304 + } 305 + 306 + /// Marker type for deserializing records from this collection. 307 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 308 + pub struct VocabRecord; 309 + impl jacquard_common::xrpc::XrpcResp for VocabRecord { 310 + const NSID: &'static str = "social.flockfeeds.lexical.vocab"; 311 + const ENCODING: &'static str = "application/json"; 312 + type Output<'de> = VocabGetRecordOutput<'de>; 313 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 314 + } 315 + 316 + impl jacquard_common::types::collection::Collection for VocabRecord { 317 + const NSID: &'static str = "social.flockfeeds.lexical.vocab"; 318 + type Record = VocabRecord; 319 + } 320 + 321 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Vocab<'a> { 322 + fn nsid() -> &'static str { 323 + "social.flockfeeds.lexical.vocab" 324 + } 325 + fn def_name() -> &'static str { 326 + "main" 327 + } 328 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 329 + lexicon_doc_social_flockfeeds_lexical_vocab() 330 + } 331 + fn validate( 332 + &self, 333 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 334 + Ok(()) 335 + } 336 + } 337 + 338 + fn lexicon_doc_social_flockfeeds_lexical_vocab() -> ::jacquard_lexicon::lexicon::LexiconDoc< 339 + 'static, 340 + > { 341 + ::jacquard_lexicon::lexicon::LexiconDoc { 342 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 343 + id: ::jacquard_common::CowStr::new_static("social.flockfeeds.lexical.vocab"), 344 + revision: None, 345 + description: None, 346 + defs: { 347 + let mut map = ::std::collections::BTreeMap::new(); 348 + map.insert( 349 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 350 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 351 + description: Some( 352 + ::jacquard_common::CowStr::new_static( 353 + "Canonical schema for vocabulary entries.", 354 + ), 355 + ), 356 + key: Some(::jacquard_common::CowStr::new_static("tid")), 357 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 358 + description: None, 359 + required: Some( 360 + vec![ 361 + ::jacquard_common::smol_str::SmolStr::new_static("id"), 362 + ::jacquard_common::smol_str::SmolStr::new_static("label"), 363 + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") 364 + ], 365 + ), 366 + nullable: None, 367 + properties: { 368 + #[allow(unused_mut)] 369 + let mut map = ::std::collections::BTreeMap::new(); 370 + map.insert( 371 + ::jacquard_common::smol_str::SmolStr::new_static( 372 + "alternateType", 373 + ), 374 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 375 + description: Some( 376 + ::jacquard_common::CowStr::new_static( 377 + "Specifies the kind of this record, expected to be a URI (recommended) or plain string.", 378 + ), 379 + ), 380 + format: None, 381 + default: None, 382 + min_length: None, 383 + max_length: None, 384 + min_graphemes: None, 385 + max_graphemes: None, 386 + r#enum: None, 387 + r#const: None, 388 + known_values: None, 389 + }), 390 + ); 391 + map.insert( 392 + ::jacquard_common::smol_str::SmolStr::new_static( 393 + "createdAt", 394 + ), 395 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 396 + description: Some( 397 + ::jacquard_common::CowStr::new_static( 398 + "Timestamp when this vocab entry was created (ISO 8601).", 399 + ), 400 + ), 401 + format: Some( 402 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 403 + ), 404 + default: None, 405 + min_length: None, 406 + max_length: None, 407 + min_graphemes: None, 408 + max_graphemes: None, 409 + r#enum: None, 410 + r#const: None, 411 + known_values: None, 412 + }), 413 + ); 414 + map.insert( 415 + ::jacquard_common::smol_str::SmolStr::new_static( 416 + "description", 417 + ), 418 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 419 + description: Some( 420 + ::jacquard_common::CowStr::new_static( 421 + "Optional longer description.", 422 + ), 423 + ), 424 + format: None, 425 + default: None, 426 + min_length: None, 427 + max_length: None, 428 + min_graphemes: None, 429 + max_graphemes: None, 430 + r#enum: None, 431 + r#const: None, 432 + known_values: None, 433 + }), 434 + ); 435 + map.insert( 436 + ::jacquard_common::smol_str::SmolStr::new_static("id"), 437 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 438 + description: Some( 439 + ::jacquard_common::CowStr::new_static( 440 + "Canonical URI/IRI for this vocab term.", 441 + ), 442 + ), 443 + format: Some( 444 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 445 + ), 446 + default: None, 447 + min_length: None, 448 + max_length: None, 449 + min_graphemes: None, 450 + max_graphemes: None, 451 + r#enum: None, 452 + r#const: None, 453 + known_values: None, 454 + }), 455 + ); 456 + map.insert( 457 + ::jacquard_common::smol_str::SmolStr::new_static("label"), 458 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 459 + description: Some( 460 + ::jacquard_common::CowStr::new_static( 461 + "Human-readable label.", 462 + ), 463 + ), 464 + format: None, 465 + default: None, 466 + min_length: None, 467 + max_length: None, 468 + min_graphemes: None, 469 + max_graphemes: None, 470 + r#enum: None, 471 + r#const: None, 472 + known_values: None, 473 + }), 474 + ); 475 + map 476 + }, 477 + }), 478 + }), 479 + ); 480 + map 481 + }, 482 + } 483 + }
+514 -87
crates/jacquard-api/src/tools_ozone/moderation.rs
··· 520 520 }), 521 521 ); 522 522 map.insert( 523 + ::jacquard_common::smol_str::SmolStr::new_static("accountStrike"), 524 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 525 + description: Some( 526 + ::jacquard_common::CowStr::new_static( 527 + "Strike information for an account", 528 + ), 529 + ), 530 + required: None, 531 + nullable: None, 532 + properties: { 533 + #[allow(unused_mut)] 534 + let mut map = ::std::collections::BTreeMap::new(); 535 + map.insert( 536 + ::jacquard_common::smol_str::SmolStr::new_static( 537 + "activeStrikeCount", 538 + ), 539 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 540 + description: None, 541 + default: None, 542 + minimum: None, 543 + maximum: None, 544 + r#enum: None, 545 + r#const: None, 546 + }), 547 + ); 548 + map.insert( 549 + ::jacquard_common::smol_str::SmolStr::new_static( 550 + "firstStrikeAt", 551 + ), 552 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 553 + description: Some( 554 + ::jacquard_common::CowStr::new_static( 555 + "Timestamp of the first strike received", 556 + ), 557 + ), 558 + format: Some( 559 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 560 + ), 561 + default: None, 562 + min_length: None, 563 + max_length: None, 564 + min_graphemes: None, 565 + max_graphemes: None, 566 + r#enum: None, 567 + r#const: None, 568 + known_values: None, 569 + }), 570 + ); 571 + map.insert( 572 + ::jacquard_common::smol_str::SmolStr::new_static( 573 + "lastStrikeAt", 574 + ), 575 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 576 + description: Some( 577 + ::jacquard_common::CowStr::new_static( 578 + "Timestamp of the most recent strike received", 579 + ), 580 + ), 581 + format: Some( 582 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 583 + ), 584 + default: None, 585 + min_length: None, 586 + max_length: None, 587 + min_graphemes: None, 588 + max_graphemes: None, 589 + r#enum: None, 590 + r#const: None, 591 + known_values: None, 592 + }), 593 + ); 594 + map.insert( 595 + ::jacquard_common::smol_str::SmolStr::new_static( 596 + "totalStrikeCount", 597 + ), 598 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 599 + description: None, 600 + default: None, 601 + minimum: None, 602 + maximum: None, 603 + r#enum: None, 604 + r#const: None, 605 + }), 606 + ); 607 + map 608 + }, 609 + }), 610 + ); 611 + map.insert( 523 612 ::jacquard_common::smol_str::SmolStr::new_static("ageAssuranceEvent"), 524 613 ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 525 614 description: Some( ··· 1188 1277 }), 1189 1278 ); 1190 1279 map.insert( 1280 + ::jacquard_common::smol_str::SmolStr::new_static("policies"), 1281 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 1282 + description: Some( 1283 + ::jacquard_common::CowStr::new_static( 1284 + "Names/Keywords of the policies that necessitated the email.", 1285 + ), 1286 + ), 1287 + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 1288 + description: None, 1289 + format: None, 1290 + default: None, 1291 + min_length: None, 1292 + max_length: None, 1293 + min_graphemes: None, 1294 + max_graphemes: None, 1295 + r#enum: None, 1296 + r#const: None, 1297 + known_values: None, 1298 + }), 1299 + min_length: None, 1300 + max_length: Some(5usize), 1301 + }), 1302 + ); 1303 + map.insert( 1304 + ::jacquard_common::smol_str::SmolStr::new_static( 1305 + "severityLevel", 1306 + ), 1307 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1308 + description: Some( 1309 + ::jacquard_common::CowStr::new_static( 1310 + "Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense", 1311 + ), 1312 + ), 1313 + format: None, 1314 + default: None, 1315 + min_length: None, 1316 + max_length: None, 1317 + min_graphemes: None, 1318 + max_graphemes: None, 1319 + r#enum: None, 1320 + r#const: None, 1321 + known_values: None, 1322 + }), 1323 + ); 1324 + map.insert( 1325 + ::jacquard_common::smol_str::SmolStr::new_static( 1326 + "strikeCount", 1327 + ), 1328 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 1329 + description: None, 1330 + default: None, 1331 + minimum: None, 1332 + maximum: None, 1333 + r#enum: None, 1334 + r#const: None, 1335 + }), 1336 + ); 1337 + map.insert( 1338 + ::jacquard_common::smol_str::SmolStr::new_static( 1339 + "strikeExpiresAt", 1340 + ), 1341 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1342 + description: Some( 1343 + ::jacquard_common::CowStr::new_static( 1344 + "When the strike should expire. If not provided, the strike never expires.", 1345 + ), 1346 + ), 1347 + format: Some( 1348 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 1349 + ), 1350 + default: None, 1351 + min_length: None, 1352 + max_length: None, 1353 + min_graphemes: None, 1354 + max_graphemes: None, 1355 + r#enum: None, 1356 + r#const: None, 1357 + known_values: None, 1358 + }), 1359 + ); 1360 + map.insert( 1191 1361 ::jacquard_common::smol_str::SmolStr::new_static( 1192 1362 "subjectLine", 1193 1363 ), ··· 1602 1772 known_values: None, 1603 1773 }), 1604 1774 ); 1775 + map.insert( 1776 + ::jacquard_common::smol_str::SmolStr::new_static("policies"), 1777 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 1778 + description: Some( 1779 + ::jacquard_common::CowStr::new_static( 1780 + "Names/Keywords of the policy infraction for which takedown is being reversed.", 1781 + ), 1782 + ), 1783 + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 1784 + description: None, 1785 + format: None, 1786 + default: None, 1787 + min_length: None, 1788 + max_length: None, 1789 + min_graphemes: None, 1790 + max_graphemes: None, 1791 + r#enum: None, 1792 + r#const: None, 1793 + known_values: None, 1794 + }), 1795 + min_length: None, 1796 + max_length: Some(5usize), 1797 + }), 1798 + ); 1799 + map.insert( 1800 + ::jacquard_common::smol_str::SmolStr::new_static( 1801 + "severityLevel", 1802 + ), 1803 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1804 + description: Some( 1805 + ::jacquard_common::CowStr::new_static( 1806 + "Severity level of the violation. Usually set from the last policy infraction's severity.", 1807 + ), 1808 + ), 1809 + format: None, 1810 + default: None, 1811 + min_length: None, 1812 + max_length: None, 1813 + min_graphemes: None, 1814 + max_graphemes: None, 1815 + r#enum: None, 1816 + r#const: None, 1817 + known_values: None, 1818 + }), 1819 + ); 1820 + map.insert( 1821 + ::jacquard_common::smol_str::SmolStr::new_static( 1822 + "strikeCount", 1823 + ), 1824 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 1825 + description: None, 1826 + default: None, 1827 + minimum: None, 1828 + maximum: None, 1829 + r#enum: None, 1830 + r#const: None, 1831 + }), 1832 + ); 1605 1833 map 1606 1834 }, 1607 1835 }), ··· 1768 1996 }), 1769 1997 min_length: None, 1770 1998 max_length: Some(5usize), 1999 + }), 2000 + ); 2001 + map.insert( 2002 + ::jacquard_common::smol_str::SmolStr::new_static( 2003 + "severityLevel", 2004 + ), 2005 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 2006 + description: Some( 2007 + ::jacquard_common::CowStr::new_static( 2008 + "Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.).", 2009 + ), 2010 + ), 2011 + format: None, 2012 + default: None, 2013 + min_length: None, 2014 + max_length: None, 2015 + min_graphemes: None, 2016 + max_graphemes: None, 2017 + r#enum: None, 2018 + r#const: None, 2019 + known_values: None, 2020 + }), 2021 + ); 2022 + map.insert( 2023 + ::jacquard_common::smol_str::SmolStr::new_static( 2024 + "strikeCount", 2025 + ), 2026 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 2027 + description: None, 2028 + default: None, 2029 + minimum: None, 2030 + maximum: None, 2031 + r#enum: None, 2032 + r#const: None, 2033 + }), 2034 + ); 2035 + map.insert( 2036 + ::jacquard_common::smol_str::SmolStr::new_static( 2037 + "strikeExpiresAt", 2038 + ), 2039 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 2040 + description: Some( 2041 + ::jacquard_common::CowStr::new_static( 2042 + "When the strike should expire. If not provided, the strike never expires.", 2043 + ), 2044 + ), 2045 + format: Some( 2046 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 2047 + ), 2048 + default: None, 2049 + min_length: None, 2050 + max_length: None, 2051 + min_graphemes: None, 2052 + max_graphemes: None, 2053 + r#enum: None, 2054 + r#const: None, 2055 + known_values: None, 1771 2056 }), 1772 2057 ); 1773 2058 map ··· 3935 4220 ); 3936 4221 map.insert( 3937 4222 ::jacquard_common::smol_str::SmolStr::new_static( 4223 + "accountStrike", 4224 + ), 4225 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 4226 + description: None, 4227 + r#ref: ::jacquard_common::CowStr::new_static( 4228 + "#accountStrike", 4229 + ), 4230 + }), 4231 + ); 4232 + map.insert( 4233 + ::jacquard_common::smol_str::SmolStr::new_static( 3938 4234 "ageAssuranceState", 3939 4235 ), 3940 4236 ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { ··· 4600 4896 } 4601 4897 } 4602 4898 4899 + /// Strike information for an account 4900 + #[jacquard_derive::lexicon] 4901 + #[derive( 4902 + serde::Serialize, 4903 + serde::Deserialize, 4904 + Debug, 4905 + Clone, 4906 + PartialEq, 4907 + Eq, 4908 + jacquard_derive::IntoStatic, 4909 + Default 4910 + )] 4911 + #[serde(rename_all = "camelCase")] 4912 + pub struct AccountStrike<'a> { 4913 + /// Current number of active strikes (excluding expired strikes) 4914 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 4915 + pub active_strike_count: std::option::Option<i64>, 4916 + /// Timestamp of the first strike received 4917 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 4918 + pub first_strike_at: std::option::Option<jacquard_common::types::string::Datetime>, 4919 + /// Timestamp of the most recent strike received 4920 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 4921 + pub last_strike_at: std::option::Option<jacquard_common::types::string::Datetime>, 4922 + /// Total number of strikes ever received (including expired strikes) 4923 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 4924 + pub total_strike_count: std::option::Option<i64>, 4925 + } 4926 + 4927 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AccountStrike<'a> { 4928 + fn nsid() -> &'static str { 4929 + "tools.ozone.moderation.defs" 4930 + } 4931 + fn def_name() -> &'static str { 4932 + "accountStrike" 4933 + } 4934 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 4935 + lexicon_doc_tools_ozone_moderation_defs() 4936 + } 4937 + fn validate( 4938 + &self, 4939 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 4940 + Ok(()) 4941 + } 4942 + } 4943 + 4603 4944 /// Age assurance info coming directly from users. Only works on DID subjects. 4604 4945 #[jacquard_derive::lexicon] 4605 4946 #[derive( ··· 5839 6180 #[serde(skip_serializing_if = "std::option::Option::is_none")] 5840 6181 #[serde(borrow)] 5841 6182 pub content: std::option::Option<jacquard_common::CowStr<'a>>, 6183 + /// Names/Keywords of the policies that necessitated the email. 6184 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 6185 + #[serde(borrow)] 6186 + pub policies: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 6187 + /// Severity level of the violation. Normally 'sev-1' that adds strike on repeat offense 6188 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 6189 + #[serde(borrow)] 6190 + pub severity_level: std::option::Option<jacquard_common::CowStr<'a>>, 6191 + /// 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. 6192 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 6193 + pub strike_count: std::option::Option<i64>, 6194 + /// When the strike should expire. If not provided, the strike never expires. 6195 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 6196 + pub strike_expires_at: std::option::Option<jacquard_common::types::string::Datetime>, 5842 6197 /// The subject line of the email sent to the user. 5843 6198 #[serde(borrow)] 5844 6199 pub subject_line: jacquard_common::CowStr<'a>, ··· 5857 6212 fn validate( 5858 6213 &self, 5859 6214 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 6215 + if let Some(ref value) = self.policies { 6216 + #[allow(unused_comparisons)] 6217 + if value.len() > 5usize { 6218 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 6219 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 6220 + "policies", 6221 + ), 6222 + max: 5usize, 6223 + actual: value.len(), 6224 + }); 6225 + } 6226 + } 5860 6227 Ok(()) 5861 6228 } 5862 6229 } ··· 6735 7102 #[serde(skip_serializing_if = "std::option::Option::is_none")] 6736 7103 #[serde(borrow)] 6737 7104 pub comment: std::option::Option<jacquard_common::CowStr<'a>>, 7105 + /// Names/Keywords of the policy infraction for which takedown is being reversed. 7106 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 7107 + #[serde(borrow)] 7108 + pub policies: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 7109 + /// Severity level of the violation. Usually set from the last policy infraction's severity. 7110 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 7111 + #[serde(borrow)] 7112 + pub severity_level: std::option::Option<jacquard_common::CowStr<'a>>, 7113 + /// Number of strikes to subtract from the user's strike count. Usually set from the last policy infraction's severity. 7114 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 7115 + pub strike_count: std::option::Option<i64>, 6738 7116 } 6739 7117 6740 7118 impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventReverseTakedown<'a> { ··· 6750 7128 fn validate( 6751 7129 &self, 6752 7130 ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 7131 + if let Some(ref value) = self.policies { 7132 + #[allow(unused_comparisons)] 7133 + if value.len() > 5usize { 7134 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 7135 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 7136 + "policies", 7137 + ), 7138 + max: 5usize, 7139 + actual: value.len(), 7140 + }); 7141 + } 7142 + } 6753 7143 Ok(()) 6754 7144 } 6755 7145 } ··· 6982 7372 #[serde(skip_serializing_if = "std::option::Option::is_none")] 6983 7373 #[serde(borrow)] 6984 7374 pub policies: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 7375 + /// Severity level of the violation (e.g., 'sev-0', 'sev-1', 'sev-2', etc.). 7376 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 7377 + #[serde(borrow)] 7378 + pub severity_level: std::option::Option<jacquard_common::CowStr<'a>>, 7379 + /// Number of strikes to assign to the user for this violation. 7380 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 7381 + pub strike_count: std::option::Option<i64>, 7382 + /// When the strike should expire. If not provided, the strike never expires. 7383 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 7384 + pub strike_expires_at: std::option::Option<jacquard_common::types::string::Datetime>, 6985 7385 } 6986 7386 6987 7387 impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ModEventTakedown<'a> { ··· 11898 12298 #[serde(skip_serializing_if = "std::option::Option::is_none")] 11899 12299 #[serde(borrow)] 11900 12300 pub account_stats: Option<crate::tools_ozone::moderation::AccountStats<'a>>, 12301 + /// Strike information for the account (account-level only) 12302 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 12303 + #[serde(borrow)] 12304 + pub account_strike: Option<crate::tools_ozone::moderation::AccountStrike<'a>>, 11901 12305 /// Current age assurance state of the subject. 11902 12306 #[serde(skip_serializing_if = "std::option::Option::is_none")] 11903 12307 #[serde(borrow)] ··· 12058 12462 _phantom_state: ::core::marker::PhantomData<fn() -> S>, 12059 12463 __unsafe_private_named: ( 12060 12464 ::core::option::Option<crate::tools_ozone::moderation::AccountStats<'a>>, 12465 + ::core::option::Option<crate::tools_ozone::moderation::AccountStrike<'a>>, 12061 12466 ::core::option::Option<jacquard_common::CowStr<'a>>, 12062 12467 ::core::option::Option<jacquard_common::CowStr<'a>>, 12063 12468 ::core::option::Option<bool>, ··· 12122 12527 None, 12123 12528 None, 12124 12529 None, 12530 + None, 12125 12531 ), 12126 12532 _phantom: ::core::marker::PhantomData, 12127 12533 } ··· 12148 12554 } 12149 12555 12150 12556 impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { 12557 + /// Set the `accountStrike` field (optional) 12558 + pub fn account_strike( 12559 + mut self, 12560 + value: impl Into<Option<crate::tools_ozone::moderation::AccountStrike<'a>>>, 12561 + ) -> Self { 12562 + self.__unsafe_private_named.1 = value.into(); 12563 + self 12564 + } 12565 + /// Set the `accountStrike` field to an Option value (optional) 12566 + pub fn maybe_account_strike( 12567 + mut self, 12568 + value: Option<crate::tools_ozone::moderation::AccountStrike<'a>>, 12569 + ) -> Self { 12570 + self.__unsafe_private_named.1 = value; 12571 + self 12572 + } 12573 + } 12574 + 12575 + impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { 12151 12576 /// Set the `ageAssuranceState` field (optional) 12152 12577 pub fn age_assurance_state( 12153 12578 mut self, 12154 12579 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 12155 12580 ) -> Self { 12156 - self.__unsafe_private_named.1 = value.into(); 12581 + self.__unsafe_private_named.2 = value.into(); 12157 12582 self 12158 12583 } 12159 12584 /// Set the `ageAssuranceState` field to an Option value (optional) ··· 12161 12586 mut self, 12162 12587 value: Option<jacquard_common::CowStr<'a>>, 12163 12588 ) -> Self { 12164 - self.__unsafe_private_named.1 = value; 12589 + self.__unsafe_private_named.2 = value; 12165 12590 self 12166 12591 } 12167 12592 } ··· 12172 12597 mut self, 12173 12598 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 12174 12599 ) -> Self { 12175 - self.__unsafe_private_named.2 = value.into(); 12600 + self.__unsafe_private_named.3 = value.into(); 12176 12601 self 12177 12602 } 12178 12603 /// Set the `ageAssuranceUpdatedBy` field to an Option value (optional) ··· 12180 12605 mut self, 12181 12606 value: Option<jacquard_common::CowStr<'a>>, 12182 12607 ) -> Self { 12183 - self.__unsafe_private_named.2 = value; 12608 + self.__unsafe_private_named.3 = value; 12184 12609 self 12185 12610 } 12186 12611 } ··· 12188 12613 impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { 12189 12614 /// Set the `appealed` field (optional) 12190 12615 pub fn appealed(mut self, value: impl Into<Option<bool>>) -> Self { 12191 - self.__unsafe_private_named.3 = value.into(); 12616 + self.__unsafe_private_named.4 = value.into(); 12192 12617 self 12193 12618 } 12194 12619 /// Set the `appealed` field to an Option value (optional) 12195 12620 pub fn maybe_appealed(mut self, value: Option<bool>) -> Self { 12196 - self.__unsafe_private_named.3 = value; 12621 + self.__unsafe_private_named.4 = value; 12197 12622 self 12198 12623 } 12199 12624 } ··· 12204 12629 mut self, 12205 12630 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 12206 12631 ) -> Self { 12207 - self.__unsafe_private_named.4 = value.into(); 12632 + self.__unsafe_private_named.5 = value.into(); 12208 12633 self 12209 12634 } 12210 12635 /// Set the `comment` field to an Option value (optional) 12211 12636 pub fn maybe_comment(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 12212 - self.__unsafe_private_named.4 = value; 12637 + self.__unsafe_private_named.5 = value; 12213 12638 self 12214 12639 } 12215 12640 } ··· 12224 12649 mut self, 12225 12650 value: impl Into<jacquard_common::types::string::Datetime>, 12226 12651 ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetCreatedAt<S>> { 12227 - self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 12652 + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 12228 12653 SubjectStatusViewBuilder { 12229 12654 _phantom_state: ::core::marker::PhantomData, 12230 12655 __unsafe_private_named: self.__unsafe_private_named, ··· 12239 12664 mut self, 12240 12665 value: impl Into<Option<SubjectStatusViewHosting<'a>>>, 12241 12666 ) -> Self { 12242 - self.__unsafe_private_named.6 = value.into(); 12667 + self.__unsafe_private_named.7 = value.into(); 12243 12668 self 12244 12669 } 12245 12670 /// Set the `hosting` field to an Option value (optional) 12246 12671 pub fn maybe_hosting(mut self, value: Option<SubjectStatusViewHosting<'a>>) -> Self { 12247 - self.__unsafe_private_named.6 = value; 12672 + self.__unsafe_private_named.7 = value; 12248 12673 self 12249 12674 } 12250 12675 } ··· 12259 12684 mut self, 12260 12685 value: impl Into<i64>, 12261 12686 ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetId<S>> { 12262 - self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); 12687 + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); 12263 12688 SubjectStatusViewBuilder { 12264 12689 _phantom_state: ::core::marker::PhantomData, 12265 12690 __unsafe_private_named: self.__unsafe_private_named, ··· 12274 12699 mut self, 12275 12700 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 12276 12701 ) -> Self { 12277 - self.__unsafe_private_named.8 = value.into(); 12702 + self.__unsafe_private_named.9 = value.into(); 12278 12703 self 12279 12704 } 12280 12705 /// Set the `lastAppealedAt` field to an Option value (optional) ··· 12282 12707 mut self, 12283 12708 value: Option<jacquard_common::types::string::Datetime>, 12284 12709 ) -> Self { 12285 - self.__unsafe_private_named.8 = value; 12710 + self.__unsafe_private_named.9 = value; 12286 12711 self 12287 12712 } 12288 12713 } ··· 12293 12718 mut self, 12294 12719 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 12295 12720 ) -> Self { 12296 - self.__unsafe_private_named.9 = value.into(); 12721 + self.__unsafe_private_named.10 = value.into(); 12297 12722 self 12298 12723 } 12299 12724 /// Set the `lastReportedAt` field to an Option value (optional) ··· 12301 12726 mut self, 12302 12727 value: Option<jacquard_common::types::string::Datetime>, 12303 12728 ) -> Self { 12304 - self.__unsafe_private_named.9 = value; 12729 + self.__unsafe_private_named.10 = value; 12305 12730 self 12306 12731 } 12307 12732 } ··· 12312 12737 mut self, 12313 12738 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 12314 12739 ) -> Self { 12315 - self.__unsafe_private_named.10 = value.into(); 12740 + self.__unsafe_private_named.11 = value.into(); 12316 12741 self 12317 12742 } 12318 12743 /// Set the `lastReviewedAt` field to an Option value (optional) ··· 12320 12745 mut self, 12321 12746 value: Option<jacquard_common::types::string::Datetime>, 12322 12747 ) -> Self { 12323 - self.__unsafe_private_named.10 = value; 12748 + self.__unsafe_private_named.11 = value; 12324 12749 self 12325 12750 } 12326 12751 } ··· 12331 12756 mut self, 12332 12757 value: impl Into<Option<jacquard_common::types::string::Did<'a>>>, 12333 12758 ) -> Self { 12334 - self.__unsafe_private_named.11 = value.into(); 12759 + self.__unsafe_private_named.12 = value.into(); 12335 12760 self 12336 12761 } 12337 12762 /// Set the `lastReviewedBy` field to an Option value (optional) ··· 12339 12764 mut self, 12340 12765 value: Option<jacquard_common::types::string::Did<'a>>, 12341 12766 ) -> Self { 12342 - self.__unsafe_private_named.11 = value; 12767 + self.__unsafe_private_named.12 = value; 12343 12768 self 12344 12769 } 12345 12770 } ··· 12350 12775 mut self, 12351 12776 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 12352 12777 ) -> Self { 12353 - self.__unsafe_private_named.12 = value.into(); 12778 + self.__unsafe_private_named.13 = value.into(); 12354 12779 self 12355 12780 } 12356 12781 /// Set the `muteReportingUntil` field to an Option value (optional) ··· 12358 12783 mut self, 12359 12784 value: Option<jacquard_common::types::string::Datetime>, 12360 12785 ) -> Self { 12361 - self.__unsafe_private_named.12 = value; 12786 + self.__unsafe_private_named.13 = value; 12362 12787 self 12363 12788 } 12364 12789 } ··· 12369 12794 mut self, 12370 12795 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 12371 12796 ) -> Self { 12372 - self.__unsafe_private_named.13 = value.into(); 12797 + self.__unsafe_private_named.14 = value.into(); 12373 12798 self 12374 12799 } 12375 12800 /// Set the `muteUntil` field to an Option value (optional) ··· 12377 12802 mut self, 12378 12803 value: Option<jacquard_common::types::string::Datetime>, 12379 12804 ) -> Self { 12380 - self.__unsafe_private_named.13 = value; 12805 + self.__unsafe_private_named.14 = value; 12381 12806 self 12382 12807 } 12383 12808 } ··· 12385 12810 impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { 12386 12811 /// Set the `priorityScore` field (optional) 12387 12812 pub fn priority_score(mut self, value: impl Into<Option<i64>>) -> Self { 12388 - self.__unsafe_private_named.14 = value.into(); 12813 + self.__unsafe_private_named.15 = value.into(); 12389 12814 self 12390 12815 } 12391 12816 /// Set the `priorityScore` field to an Option value (optional) 12392 12817 pub fn maybe_priority_score(mut self, value: Option<i64>) -> Self { 12393 - self.__unsafe_private_named.14 = value; 12818 + self.__unsafe_private_named.15 = value; 12394 12819 self 12395 12820 } 12396 12821 } ··· 12401 12826 mut self, 12402 12827 value: impl Into<Option<crate::tools_ozone::moderation::RecordsStats<'a>>>, 12403 12828 ) -> Self { 12404 - self.__unsafe_private_named.15 = value.into(); 12829 + self.__unsafe_private_named.16 = value.into(); 12405 12830 self 12406 12831 } 12407 12832 /// Set the `recordsStats` field to an Option value (optional) ··· 12409 12834 mut self, 12410 12835 value: Option<crate::tools_ozone::moderation::RecordsStats<'a>>, 12411 12836 ) -> Self { 12412 - self.__unsafe_private_named.15 = value; 12837 + self.__unsafe_private_named.16 = value; 12413 12838 self 12414 12839 } 12415 12840 } ··· 12424 12849 mut self, 12425 12850 value: impl Into<crate::tools_ozone::moderation::SubjectReviewState<'a>>, 12426 12851 ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetReviewState<S>> { 12427 - self.__unsafe_private_named.16 = ::core::option::Option::Some(value.into()); 12852 + self.__unsafe_private_named.17 = ::core::option::Option::Some(value.into()); 12428 12853 SubjectStatusViewBuilder { 12429 12854 _phantom_state: ::core::marker::PhantomData, 12430 12855 __unsafe_private_named: self.__unsafe_private_named, ··· 12443 12868 mut self, 12444 12869 value: impl Into<SubjectStatusViewSubject<'a>>, 12445 12870 ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetSubject<S>> { 12446 - self.__unsafe_private_named.17 = ::core::option::Option::Some(value.into()); 12871 + self.__unsafe_private_named.18 = ::core::option::Option::Some(value.into()); 12447 12872 SubjectStatusViewBuilder { 12448 12873 _phantom_state: ::core::marker::PhantomData, 12449 12874 __unsafe_private_named: self.__unsafe_private_named, ··· 12458 12883 mut self, 12459 12884 value: impl Into<Option<Vec<jacquard_common::types::string::Cid<'a>>>>, 12460 12885 ) -> Self { 12461 - self.__unsafe_private_named.18 = value.into(); 12886 + self.__unsafe_private_named.19 = value.into(); 12462 12887 self 12463 12888 } 12464 12889 /// Set the `subjectBlobCids` field to an Option value (optional) ··· 12466 12891 mut self, 12467 12892 value: Option<Vec<jacquard_common::types::string::Cid<'a>>>, 12468 12893 ) -> Self { 12469 - self.__unsafe_private_named.18 = value; 12894 + self.__unsafe_private_named.19 = value; 12470 12895 self 12471 12896 } 12472 12897 } ··· 12477 12902 mut self, 12478 12903 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 12479 12904 ) -> Self { 12480 - self.__unsafe_private_named.19 = value.into(); 12905 + self.__unsafe_private_named.20 = value.into(); 12481 12906 self 12482 12907 } 12483 12908 /// Set the `subjectRepoHandle` field to an Option value (optional) ··· 12485 12910 mut self, 12486 12911 value: Option<jacquard_common::CowStr<'a>>, 12487 12912 ) -> Self { 12488 - self.__unsafe_private_named.19 = value; 12913 + self.__unsafe_private_named.20 = value; 12489 12914 self 12490 12915 } 12491 12916 } ··· 12496 12921 mut self, 12497 12922 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 12498 12923 ) -> Self { 12499 - self.__unsafe_private_named.20 = value.into(); 12924 + self.__unsafe_private_named.21 = value.into(); 12500 12925 self 12501 12926 } 12502 12927 /// Set the `suspendUntil` field to an Option value (optional) ··· 12504 12929 mut self, 12505 12930 value: Option<jacquard_common::types::string::Datetime>, 12506 12931 ) -> Self { 12507 - self.__unsafe_private_named.20 = value; 12932 + self.__unsafe_private_named.21 = value; 12508 12933 self 12509 12934 } 12510 12935 } ··· 12515 12940 mut self, 12516 12941 value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>, 12517 12942 ) -> Self { 12518 - self.__unsafe_private_named.21 = value.into(); 12943 + self.__unsafe_private_named.22 = value.into(); 12519 12944 self 12520 12945 } 12521 12946 /// Set the `tags` field to an Option value (optional) ··· 12523 12948 mut self, 12524 12949 value: Option<Vec<jacquard_common::CowStr<'a>>>, 12525 12950 ) -> Self { 12526 - self.__unsafe_private_named.21 = value; 12951 + self.__unsafe_private_named.22 = value; 12527 12952 self 12528 12953 } 12529 12954 } ··· 12531 12956 impl<'a, S: subject_status_view_state::State> SubjectStatusViewBuilder<'a, S> { 12532 12957 /// Set the `takendown` field (optional) 12533 12958 pub fn takendown(mut self, value: impl Into<Option<bool>>) -> Self { 12534 - self.__unsafe_private_named.22 = value.into(); 12959 + self.__unsafe_private_named.23 = value.into(); 12535 12960 self 12536 12961 } 12537 12962 /// Set the `takendown` field to an Option value (optional) 12538 12963 pub fn maybe_takendown(mut self, value: Option<bool>) -> Self { 12539 - self.__unsafe_private_named.22 = value; 12964 + self.__unsafe_private_named.23 = value; 12540 12965 self 12541 12966 } 12542 12967 } ··· 12551 12976 mut self, 12552 12977 value: impl Into<jacquard_common::types::string::Datetime>, 12553 12978 ) -> SubjectStatusViewBuilder<'a, subject_status_view_state::SetUpdatedAt<S>> { 12554 - self.__unsafe_private_named.23 = ::core::option::Option::Some(value.into()); 12979 + self.__unsafe_private_named.24 = ::core::option::Option::Some(value.into()); 12555 12980 SubjectStatusViewBuilder { 12556 12981 _phantom_state: ::core::marker::PhantomData, 12557 12982 __unsafe_private_named: self.__unsafe_private_named, ··· 12573 12998 pub fn build(self) -> SubjectStatusView<'a> { 12574 12999 SubjectStatusView { 12575 13000 account_stats: self.__unsafe_private_named.0, 12576 - age_assurance_state: self.__unsafe_private_named.1, 12577 - age_assurance_updated_by: self.__unsafe_private_named.2, 12578 - appealed: self.__unsafe_private_named.3, 12579 - comment: self.__unsafe_private_named.4, 12580 - created_at: self.__unsafe_private_named.5.unwrap(), 12581 - hosting: self.__unsafe_private_named.6, 12582 - id: self.__unsafe_private_named.7.unwrap(), 12583 - last_appealed_at: self.__unsafe_private_named.8, 12584 - last_reported_at: self.__unsafe_private_named.9, 12585 - last_reviewed_at: self.__unsafe_private_named.10, 12586 - last_reviewed_by: self.__unsafe_private_named.11, 12587 - mute_reporting_until: self.__unsafe_private_named.12, 12588 - mute_until: self.__unsafe_private_named.13, 12589 - priority_score: self.__unsafe_private_named.14, 12590 - records_stats: self.__unsafe_private_named.15, 12591 - review_state: self.__unsafe_private_named.16.unwrap(), 12592 - subject: self.__unsafe_private_named.17.unwrap(), 12593 - subject_blob_cids: self.__unsafe_private_named.18, 12594 - subject_repo_handle: self.__unsafe_private_named.19, 12595 - suspend_until: self.__unsafe_private_named.20, 12596 - tags: self.__unsafe_private_named.21, 12597 - takendown: self.__unsafe_private_named.22, 12598 - updated_at: self.__unsafe_private_named.23.unwrap(), 13001 + account_strike: self.__unsafe_private_named.1, 13002 + age_assurance_state: self.__unsafe_private_named.2, 13003 + age_assurance_updated_by: self.__unsafe_private_named.3, 13004 + appealed: self.__unsafe_private_named.4, 13005 + comment: self.__unsafe_private_named.5, 13006 + created_at: self.__unsafe_private_named.6.unwrap(), 13007 + hosting: self.__unsafe_private_named.7, 13008 + id: self.__unsafe_private_named.8.unwrap(), 13009 + last_appealed_at: self.__unsafe_private_named.9, 13010 + last_reported_at: self.__unsafe_private_named.10, 13011 + last_reviewed_at: self.__unsafe_private_named.11, 13012 + last_reviewed_by: self.__unsafe_private_named.12, 13013 + mute_reporting_until: self.__unsafe_private_named.13, 13014 + mute_until: self.__unsafe_private_named.14, 13015 + priority_score: self.__unsafe_private_named.15, 13016 + records_stats: self.__unsafe_private_named.16, 13017 + review_state: self.__unsafe_private_named.17.unwrap(), 13018 + subject: self.__unsafe_private_named.18.unwrap(), 13019 + subject_blob_cids: self.__unsafe_private_named.19, 13020 + subject_repo_handle: self.__unsafe_private_named.20, 13021 + suspend_until: self.__unsafe_private_named.21, 13022 + tags: self.__unsafe_private_named.22, 13023 + takendown: self.__unsafe_private_named.23, 13024 + updated_at: self.__unsafe_private_named.24.unwrap(), 12599 13025 extra_data: Default::default(), 12600 13026 } 12601 13027 } ··· 12609 13035 ) -> SubjectStatusView<'a> { 12610 13036 SubjectStatusView { 12611 13037 account_stats: self.__unsafe_private_named.0, 12612 - age_assurance_state: self.__unsafe_private_named.1, 12613 - age_assurance_updated_by: self.__unsafe_private_named.2, 12614 - appealed: self.__unsafe_private_named.3, 12615 - comment: self.__unsafe_private_named.4, 12616 - created_at: self.__unsafe_private_named.5.unwrap(), 12617 - hosting: self.__unsafe_private_named.6, 12618 - id: self.__unsafe_private_named.7.unwrap(), 12619 - last_appealed_at: self.__unsafe_private_named.8, 12620 - last_reported_at: self.__unsafe_private_named.9, 12621 - last_reviewed_at: self.__unsafe_private_named.10, 12622 - last_reviewed_by: self.__unsafe_private_named.11, 12623 - mute_reporting_until: self.__unsafe_private_named.12, 12624 - mute_until: self.__unsafe_private_named.13, 12625 - priority_score: self.__unsafe_private_named.14, 12626 - records_stats: self.__unsafe_private_named.15, 12627 - review_state: self.__unsafe_private_named.16.unwrap(), 12628 - subject: self.__unsafe_private_named.17.unwrap(), 12629 - subject_blob_cids: self.__unsafe_private_named.18, 12630 - subject_repo_handle: self.__unsafe_private_named.19, 12631 - suspend_until: self.__unsafe_private_named.20, 12632 - tags: self.__unsafe_private_named.21, 12633 - takendown: self.__unsafe_private_named.22, 12634 - updated_at: self.__unsafe_private_named.23.unwrap(), 13038 + account_strike: self.__unsafe_private_named.1, 13039 + age_assurance_state: self.__unsafe_private_named.2, 13040 + age_assurance_updated_by: self.__unsafe_private_named.3, 13041 + appealed: self.__unsafe_private_named.4, 13042 + comment: self.__unsafe_private_named.5, 13043 + created_at: self.__unsafe_private_named.6.unwrap(), 13044 + hosting: self.__unsafe_private_named.7, 13045 + id: self.__unsafe_private_named.8.unwrap(), 13046 + last_appealed_at: self.__unsafe_private_named.9, 13047 + last_reported_at: self.__unsafe_private_named.10, 13048 + last_reviewed_at: self.__unsafe_private_named.11, 13049 + last_reviewed_by: self.__unsafe_private_named.12, 13050 + mute_reporting_until: self.__unsafe_private_named.13, 13051 + mute_until: self.__unsafe_private_named.14, 13052 + priority_score: self.__unsafe_private_named.15, 13053 + records_stats: self.__unsafe_private_named.16, 13054 + review_state: self.__unsafe_private_named.17.unwrap(), 13055 + subject: self.__unsafe_private_named.18.unwrap(), 13056 + subject_blob_cids: self.__unsafe_private_named.19, 13057 + subject_repo_handle: self.__unsafe_private_named.20, 13058 + suspend_until: self.__unsafe_private_named.21, 13059 + tags: self.__unsafe_private_named.22, 13060 + takendown: self.__unsafe_private_named.23, 13061 + updated_at: self.__unsafe_private_named.24.unwrap(), 12635 13062 extra_data: Some(extra_data), 12636 13063 } 12637 13064 }
+18
crates/jacquard-api/src/tools_ozone/moderation/query_events.rs
··· 80 80 #[serde(skip_serializing_if = "std::option::Option::is_none")] 81 81 #[serde(borrow)] 82 82 pub types: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 83 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 84 + pub with_strike: std::option::Option<bool>, 83 85 } 84 86 85 87 pub mod query_events_state { ··· 127 129 ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 128 130 ::core::option::Option<jacquard_common::CowStr<'a>>, 129 131 ::core::option::Option<Vec<jacquard_common::CowStr<'a>>>, 132 + ::core::option::Option<bool>, 130 133 ), 131 134 _phantom: ::core::marker::PhantomData<&'a ()>, 132 135 } ··· 144 147 QueryEventsBuilder { 145 148 _phantom_state: ::core::marker::PhantomData, 146 149 __unsafe_private_named: ( 150 + None, 147 151 None, 148 152 None, 149 153 None, ··· 563 567 } 564 568 } 565 569 570 + impl<'a, S: query_events_state::State> QueryEventsBuilder<'a, S> { 571 + /// Set the `withStrike` field (optional) 572 + pub fn with_strike(mut self, value: impl Into<Option<bool>>) -> Self { 573 + self.__unsafe_private_named.22 = value.into(); 574 + self 575 + } 576 + /// Set the `withStrike` field to an Option value (optional) 577 + pub fn maybe_with_strike(mut self, value: Option<bool>) -> Self { 578 + self.__unsafe_private_named.22 = value; 579 + self 580 + } 581 + } 582 + 566 583 impl<'a, S> QueryEventsBuilder<'a, S> 567 584 where 568 585 S: query_events_state::State, ··· 592 609 subject: self.__unsafe_private_named.19, 593 610 subject_type: self.__unsafe_private_named.20, 594 611 types: self.__unsafe_private_named.21, 612 + with_strike: self.__unsafe_private_named.22, 595 613 } 596 614 } 597 615 }
+67 -48
crates/jacquard-api/src/tools_ozone/moderation/query_statuses.rs
··· 74 74 pub min_priority_score: std::option::Option<i64>, 75 75 #[serde(skip_serializing_if = "std::option::Option::is_none")] 76 76 pub min_reported_records_count: std::option::Option<i64>, 77 + ///(min: 1) 78 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 79 + pub min_strike_count: std::option::Option<i64>, 77 80 #[serde(skip_serializing_if = "std::option::Option::is_none")] 78 81 pub min_takendown_records_count: std::option::Option<i64>, 79 82 #[serde(skip_serializing_if = "std::option::Option::is_none")] ··· 160 163 ::core::option::Option<i64>, 161 164 ::core::option::Option<i64>, 162 165 ::core::option::Option<i64>, 166 + ::core::option::Option<i64>, 163 167 ::core::option::Option<bool>, 164 168 ::core::option::Option<i64>, 165 169 ::core::option::Option<i64>, ··· 192 196 QueryStatusesBuilder { 193 197 _phantom_state: ::core::marker::PhantomData, 194 198 __unsafe_private_named: ( 199 + None, 195 200 None, 196 201 None, 197 202 None, ··· 547 552 } 548 553 549 554 impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { 555 + /// Set the `minStrikeCount` field (optional) 556 + pub fn min_strike_count(mut self, value: impl Into<Option<i64>>) -> Self { 557 + self.__unsafe_private_named.19 = value.into(); 558 + self 559 + } 560 + /// Set the `minStrikeCount` field to an Option value (optional) 561 + pub fn maybe_min_strike_count(mut self, value: Option<i64>) -> Self { 562 + self.__unsafe_private_named.19 = value; 563 + self 564 + } 565 + } 566 + 567 + impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { 550 568 /// Set the `minTakendownRecordsCount` field (optional) 551 569 pub fn min_takendown_records_count(mut self, value: impl Into<Option<i64>>) -> Self { 552 - self.__unsafe_private_named.19 = value.into(); 570 + self.__unsafe_private_named.20 = value.into(); 553 571 self 554 572 } 555 573 /// Set the `minTakendownRecordsCount` field to an Option value (optional) 556 574 pub fn maybe_min_takendown_records_count(mut self, value: Option<i64>) -> Self { 557 - self.__unsafe_private_named.19 = value; 575 + self.__unsafe_private_named.20 = value; 558 576 self 559 577 } 560 578 } ··· 562 580 impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { 563 581 /// Set the `onlyMuted` field (optional) 564 582 pub fn only_muted(mut self, value: impl Into<Option<bool>>) -> Self { 565 - self.__unsafe_private_named.20 = value.into(); 583 + self.__unsafe_private_named.21 = value.into(); 566 584 self 567 585 } 568 586 /// Set the `onlyMuted` field to an Option value (optional) 569 587 pub fn maybe_only_muted(mut self, value: Option<bool>) -> Self { 570 - self.__unsafe_private_named.20 = value; 588 + self.__unsafe_private_named.21 = value; 571 589 self 572 590 } 573 591 } ··· 575 593 impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { 576 594 /// Set the `queueCount` field (optional) 577 595 pub fn queue_count(mut self, value: impl Into<Option<i64>>) -> Self { 578 - self.__unsafe_private_named.21 = value.into(); 596 + self.__unsafe_private_named.22 = value.into(); 579 597 self 580 598 } 581 599 /// Set the `queueCount` field to an Option value (optional) 582 600 pub fn maybe_queue_count(mut self, value: Option<i64>) -> Self { 583 - self.__unsafe_private_named.21 = value; 601 + self.__unsafe_private_named.22 = value; 584 602 self 585 603 } 586 604 } ··· 588 606 impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { 589 607 /// Set the `queueIndex` field (optional) 590 608 pub fn queue_index(mut self, value: impl Into<Option<i64>>) -> Self { 591 - self.__unsafe_private_named.22 = value.into(); 609 + self.__unsafe_private_named.23 = value.into(); 592 610 self 593 611 } 594 612 /// Set the `queueIndex` field to an Option value (optional) 595 613 pub fn maybe_queue_index(mut self, value: Option<i64>) -> Self { 596 - self.__unsafe_private_named.22 = value; 614 + self.__unsafe_private_named.23 = value; 597 615 self 598 616 } 599 617 } ··· 604 622 mut self, 605 623 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 606 624 ) -> Self { 607 - self.__unsafe_private_named.23 = value.into(); 625 + self.__unsafe_private_named.24 = value.into(); 608 626 self 609 627 } 610 628 /// Set the `queueSeed` field to an Option value (optional) ··· 612 630 mut self, 613 631 value: Option<jacquard_common::CowStr<'a>>, 614 632 ) -> Self { 615 - self.__unsafe_private_named.23 = value; 633 + self.__unsafe_private_named.24 = value; 616 634 self 617 635 } 618 636 } ··· 623 641 mut self, 624 642 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 625 643 ) -> Self { 626 - self.__unsafe_private_named.24 = value.into(); 644 + self.__unsafe_private_named.25 = value.into(); 627 645 self 628 646 } 629 647 /// Set the `reportedAfter` field to an Option value (optional) ··· 631 649 mut self, 632 650 value: Option<jacquard_common::types::string::Datetime>, 633 651 ) -> Self { 634 - self.__unsafe_private_named.24 = value; 652 + self.__unsafe_private_named.25 = value; 635 653 self 636 654 } 637 655 } ··· 642 660 mut self, 643 661 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 644 662 ) -> Self { 645 - self.__unsafe_private_named.25 = value.into(); 663 + self.__unsafe_private_named.26 = value.into(); 646 664 self 647 665 } 648 666 /// Set the `reportedBefore` field to an Option value (optional) ··· 650 668 mut self, 651 669 value: Option<jacquard_common::types::string::Datetime>, 652 670 ) -> Self { 653 - self.__unsafe_private_named.25 = value; 671 + self.__unsafe_private_named.26 = value; 654 672 self 655 673 } 656 674 } ··· 661 679 mut self, 662 680 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 663 681 ) -> Self { 664 - self.__unsafe_private_named.26 = value.into(); 682 + self.__unsafe_private_named.27 = value.into(); 665 683 self 666 684 } 667 685 /// Set the `reviewState` field to an Option value (optional) ··· 669 687 mut self, 670 688 value: Option<jacquard_common::CowStr<'a>>, 671 689 ) -> Self { 672 - self.__unsafe_private_named.26 = value; 690 + self.__unsafe_private_named.27 = value; 673 691 self 674 692 } 675 693 } ··· 680 698 mut self, 681 699 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 682 700 ) -> Self { 683 - self.__unsafe_private_named.27 = value.into(); 701 + self.__unsafe_private_named.28 = value.into(); 684 702 self 685 703 } 686 704 /// Set the `reviewedAfter` field to an Option value (optional) ··· 688 706 mut self, 689 707 value: Option<jacquard_common::types::string::Datetime>, 690 708 ) -> Self { 691 - self.__unsafe_private_named.27 = value; 709 + self.__unsafe_private_named.28 = value; 692 710 self 693 711 } 694 712 } ··· 699 717 mut self, 700 718 value: impl Into<Option<jacquard_common::types::string::Datetime>>, 701 719 ) -> Self { 702 - self.__unsafe_private_named.28 = value.into(); 720 + self.__unsafe_private_named.29 = value.into(); 703 721 self 704 722 } 705 723 /// Set the `reviewedBefore` field to an Option value (optional) ··· 707 725 mut self, 708 726 value: Option<jacquard_common::types::string::Datetime>, 709 727 ) -> Self { 710 - self.__unsafe_private_named.28 = value; 728 + self.__unsafe_private_named.29 = value; 711 729 self 712 730 } 713 731 } ··· 718 736 mut self, 719 737 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 720 738 ) -> Self { 721 - self.__unsafe_private_named.29 = value.into(); 739 + self.__unsafe_private_named.30 = value.into(); 722 740 self 723 741 } 724 742 /// Set the `sortDirection` field to an Option value (optional) ··· 726 744 mut self, 727 745 value: Option<jacquard_common::CowStr<'a>>, 728 746 ) -> Self { 729 - self.__unsafe_private_named.29 = value; 747 + self.__unsafe_private_named.30 = value; 730 748 self 731 749 } 732 750 } ··· 737 755 mut self, 738 756 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 739 757 ) -> Self { 740 - self.__unsafe_private_named.30 = value.into(); 758 + self.__unsafe_private_named.31 = value.into(); 741 759 self 742 760 } 743 761 /// Set the `sortField` field to an Option value (optional) ··· 745 763 mut self, 746 764 value: Option<jacquard_common::CowStr<'a>>, 747 765 ) -> Self { 748 - self.__unsafe_private_named.30 = value; 766 + self.__unsafe_private_named.31 = value; 749 767 self 750 768 } 751 769 } ··· 756 774 mut self, 757 775 value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 758 776 ) -> Self { 759 - self.__unsafe_private_named.31 = value.into(); 777 + self.__unsafe_private_named.32 = value.into(); 760 778 self 761 779 } 762 780 /// Set the `subject` field to an Option value (optional) ··· 764 782 mut self, 765 783 value: Option<jacquard_common::types::string::Uri<'a>>, 766 784 ) -> Self { 767 - self.__unsafe_private_named.31 = value; 785 + self.__unsafe_private_named.32 = value; 768 786 self 769 787 } 770 788 } ··· 775 793 mut self, 776 794 value: impl Into<Option<jacquard_common::CowStr<'a>>>, 777 795 ) -> Self { 778 - self.__unsafe_private_named.32 = value.into(); 796 + self.__unsafe_private_named.33 = value.into(); 779 797 self 780 798 } 781 799 /// Set the `subjectType` field to an Option value (optional) ··· 783 801 mut self, 784 802 value: Option<jacquard_common::CowStr<'a>>, 785 803 ) -> Self { 786 - self.__unsafe_private_named.32 = value; 804 + self.__unsafe_private_named.33 = value; 787 805 self 788 806 } 789 807 } ··· 794 812 mut self, 795 813 value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>, 796 814 ) -> Self { 797 - self.__unsafe_private_named.33 = value.into(); 815 + self.__unsafe_private_named.34 = value.into(); 798 816 self 799 817 } 800 818 /// Set the `tags` field to an Option value (optional) ··· 802 820 mut self, 803 821 value: Option<Vec<jacquard_common::CowStr<'a>>>, 804 822 ) -> Self { 805 - self.__unsafe_private_named.33 = value; 823 + self.__unsafe_private_named.34 = value; 806 824 self 807 825 } 808 826 } ··· 810 828 impl<'a, S: query_statuses_state::State> QueryStatusesBuilder<'a, S> { 811 829 /// Set the `takendown` field (optional) 812 830 pub fn takendown(mut self, value: impl Into<Option<bool>>) -> Self { 813 - self.__unsafe_private_named.34 = value.into(); 831 + self.__unsafe_private_named.35 = value.into(); 814 832 self 815 833 } 816 834 /// Set the `takendown` field to an Option value (optional) 817 835 pub fn maybe_takendown(mut self, value: Option<bool>) -> Self { 818 - self.__unsafe_private_named.34 = value; 836 + self.__unsafe_private_named.35 = value; 819 837 self 820 838 } 821 839 } ··· 846 864 min_account_suspend_count: self.__unsafe_private_named.16, 847 865 min_priority_score: self.__unsafe_private_named.17, 848 866 min_reported_records_count: self.__unsafe_private_named.18, 849 - min_takendown_records_count: self.__unsafe_private_named.19, 850 - only_muted: self.__unsafe_private_named.20, 851 - queue_count: self.__unsafe_private_named.21, 852 - queue_index: self.__unsafe_private_named.22, 853 - queue_seed: self.__unsafe_private_named.23, 854 - reported_after: self.__unsafe_private_named.24, 855 - reported_before: self.__unsafe_private_named.25, 856 - review_state: self.__unsafe_private_named.26, 857 - reviewed_after: self.__unsafe_private_named.27, 858 - reviewed_before: self.__unsafe_private_named.28, 859 - sort_direction: self.__unsafe_private_named.29, 860 - sort_field: self.__unsafe_private_named.30, 861 - subject: self.__unsafe_private_named.31, 862 - subject_type: self.__unsafe_private_named.32, 863 - tags: self.__unsafe_private_named.33, 864 - takendown: self.__unsafe_private_named.34, 867 + min_strike_count: self.__unsafe_private_named.19, 868 + min_takendown_records_count: self.__unsafe_private_named.20, 869 + only_muted: self.__unsafe_private_named.21, 870 + queue_count: self.__unsafe_private_named.22, 871 + queue_index: self.__unsafe_private_named.23, 872 + queue_seed: self.__unsafe_private_named.24, 873 + reported_after: self.__unsafe_private_named.25, 874 + reported_before: self.__unsafe_private_named.26, 875 + review_state: self.__unsafe_private_named.27, 876 + reviewed_after: self.__unsafe_private_named.28, 877 + reviewed_before: self.__unsafe_private_named.29, 878 + sort_direction: self.__unsafe_private_named.30, 879 + sort_field: self.__unsafe_private_named.31, 880 + subject: self.__unsafe_private_named.32, 881 + subject_type: self.__unsafe_private_named.33, 882 + tags: self.__unsafe_private_named.34, 883 + takendown: self.__unsafe_private_named.35, 865 884 } 866 885 } 867 886 }
+4 -4
crates/jacquard-lexgen/src/fetch/sources.rs
··· 89 89 let doc = doc.into_static(); 90 90 Ok((nsid, doc)) 91 91 } 92 - Err(_) => { 92 + Err(e) => { 93 93 // Not a lexicon, skip 94 - Err(miette::miette!("Invalid lexicon file")) 94 + Err(miette::miette!("Invalid lexicon file: {e}")) 95 95 } 96 96 } 97 97 } else { ··· 104 104 let doc = doc.into_static(); 105 105 Ok((nsid, doc)) 106 106 } 107 - Err(_) => { 107 + Err(e) => { 108 108 // Not a lexicon, skip 109 - Err(miette::miette!("Invalid lexicon file")) 109 + Err(miette::miette!("Invalid lexicon file: {e}")) 110 110 } 111 111 } 112 112 } else {
+4 -1
crates/jacquard-lexgen/src/fetch/sources/git.rs
··· 56 56 let doc = doc.into_static(); 57 57 lexicons.insert(nsid, doc); 58 58 } 59 - Err(_) => { 59 + Err(e) => { 60 + if self.repo.contains("weaver") { 61 + println!("Failed to parse lexicon file: {}\n{}", content, e); 62 + } 60 63 // Not a lexicon, skip 61 64 continue; 62 65 }