A better Rust ATProto crate

api codegen updates

Orual f4529f01 26f9c9e1

+9331
+133
crates/jacquard-api/lexicons/blog_pckt_richtext_facet.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "blog.pckt.richtext.facet", 4 + "description": "Annotation of a sub-string within rich text.", 5 + "defs": { 6 + "atMention": { 7 + "type": "object", 8 + "description": "Facet feature for mentioning an AT URI", 9 + "required": [ 10 + "atURI" 11 + ], 12 + "properties": { 13 + "atURI": { 14 + "type": "string", 15 + "format": "uri" 16 + } 17 + } 18 + }, 19 + "bold": { 20 + "type": "object", 21 + "description": "Facet feature for bold text", 22 + "properties": {} 23 + }, 24 + "byteSlice": { 25 + "type": "object", 26 + "description": "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text.", 27 + "required": [ 28 + "byteStart", 29 + "byteEnd" 30 + ], 31 + "properties": { 32 + "byteEnd": { 33 + "type": "integer", 34 + "minimum": 0 35 + }, 36 + "byteStart": { 37 + "type": "integer", 38 + "minimum": 0 39 + } 40 + } 41 + }, 42 + "code": { 43 + "type": "object", 44 + "description": "Facet feature for inline code", 45 + "properties": {} 46 + }, 47 + "didMention": { 48 + "type": "object", 49 + "description": "Facet feature for mentioning a DID", 50 + "required": [ 51 + "did" 52 + ], 53 + "properties": { 54 + "did": { 55 + "type": "string", 56 + "format": "did" 57 + } 58 + } 59 + }, 60 + "highlight": { 61 + "type": "object", 62 + "description": "Facet feature for highlighted text", 63 + "properties": {} 64 + }, 65 + "id": { 66 + "type": "object", 67 + "description": "Facet feature for an identifier. Used for linking to a segment", 68 + "properties": { 69 + "id": { 70 + "type": "string" 71 + } 72 + } 73 + }, 74 + "italic": { 75 + "type": "object", 76 + "description": "Facet feature for italic text", 77 + "properties": {} 78 + }, 79 + "link": { 80 + "type": "object", 81 + "description": "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.", 82 + "required": [ 83 + "uri" 84 + ], 85 + "properties": { 86 + "uri": { 87 + "type": "string" 88 + } 89 + } 90 + }, 91 + "main": { 92 + "type": "object", 93 + "required": [ 94 + "index", 95 + "features" 96 + ], 97 + "properties": { 98 + "features": { 99 + "type": "array", 100 + "items": { 101 + "type": "union", 102 + "refs": [ 103 + "#link", 104 + "#didMention", 105 + "#atMention", 106 + "#code", 107 + "#highlight", 108 + "#underline", 109 + "#strikethrough", 110 + "#id", 111 + "#bold", 112 + "#italic" 113 + ] 114 + } 115 + }, 116 + "index": { 117 + "type": "ref", 118 + "ref": "#byteSlice" 119 + } 120 + } 121 + }, 122 + "strikethrough": { 123 + "type": "object", 124 + "description": "Facet feature for strikethrough markup", 125 + "properties": {} 126 + }, 127 + "underline": { 128 + "type": "object", 129 + "description": "Facet feature for underline markup", 130 + "properties": {} 131 + } 132 + } 133 + }
+18
crates/jacquard-api/lexicons/com_5jiji_test_listVideos.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.5jiji.test.listVideos", 4 + "defs": { 5 + "main": { 6 + "type": "query", 7 + "description": "Lists videos from given creator", 8 + "parameters": { 9 + "type": "params", 10 + "properties": {} 11 + }, 12 + "output": { 13 + "description": "The list of videos", 14 + "encoding": "application/json" 15 + } 16 + } 17 + } 18 + }
+33
crates/jacquard-api/lexicons/com_yuna0x0_guestbook_sign.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "com.yuna0x0.guestbook.sign", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "a sign in the guestbook", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "subject", 13 + "createdAt", 14 + "message" 15 + ], 16 + "properties": { 17 + "createdAt": { 18 + "type": "string", 19 + "format": "datetime" 20 + }, 21 + "message": { 22 + "type": "string", 23 + "maxLength": 100 24 + }, 25 + "subject": { 26 + "type": "string", 27 + "format": "at-identifier" 28 + } 29 + } 30 + } 31 + } 32 + } 33 + }
+25
crates/jacquard-api/lexicons/fyi_questionable_actor_profile.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "fyi.questionable.actor.profile", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A declaration of a Questionable account profile.", 8 + "key": "literal:self", 9 + "record": { 10 + "type": "object", 11 + "properties": { 12 + "createdAt": { 13 + "type": "string", 14 + "format": "datetime" 15 + }, 16 + "displayName": { 17 + "type": "string", 18 + "maxLength": 640, 19 + "maxGraphemes": 64 20 + } 21 + } 22 + } 23 + } 24 + } 25 + }
+62
crates/jacquard-api/lexicons/games_firehose_barklesheep_placeSheeps.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "games.firehose.barklesheep.placeSheeps", 4 + "defs": { 5 + "main": { 6 + "type": "procedure", 7 + "description": "Place sheeps on the barkleboard", 8 + "input": { 9 + "encoding": "application/json", 10 + "schema": { 11 + "type": "object", 12 + "required": [ 13 + "gameId", 14 + "sheeps" 15 + ], 16 + "properties": { 17 + "gameId": { 18 + "type": "string" 19 + }, 20 + "sheeps": { 21 + "type": "array", 22 + "items": { 23 + "type": "ref", 24 + "ref": "#sheepPlacement" 25 + } 26 + } 27 + } 28 + } 29 + }, 30 + "output": { 31 + "encoding": "application/json", 32 + "schema": { 33 + "type": "object", 34 + "properties": { 35 + "success": { 36 + "type": "boolean" 37 + } 38 + } 39 + } 40 + } 41 + }, 42 + "sheepPlacement": { 43 + "type": "object", 44 + "required": [ 45 + "type", 46 + "start", 47 + "horizontal" 48 + ], 49 + "properties": { 50 + "horizontal": { 51 + "type": "boolean" 52 + }, 53 + "start": { 54 + "type": "integer" 55 + }, 56 + "type": { 57 + "type": "string" 58 + } 59 + } 60 + } 61 + } 62 + }
+32
crates/jacquard-api/lexicons/games_firehose_barklesheep_reaction.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "games.firehose.barklesheep.reaction", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A reaction in a Barklesheep game", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "gameId", 13 + "emoji", 14 + "createdAt" 15 + ], 16 + "properties": { 17 + "createdAt": { 18 + "type": "string", 19 + "format": "datetime" 20 + }, 21 + "emoji": { 22 + "type": "string", 23 + "maxLength": 4 24 + }, 25 + "gameId": { 26 + "type": "string" 27 + } 28 + } 29 + } 30 + } 31 + } 32 + }
+53
crates/jacquard-api/lexicons/io_atcr_hold_captain.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.atcr.hold.captain", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Represents the hold's ownership and metadata. Stored as a singleton record at rkey 'self' in the hold's embedded PDS.", 8 + "key": "literal:self", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "owner", 13 + "public", 14 + "allowAllCrew", 15 + "enableBlueskyPosts", 16 + "deployedAt" 17 + ], 18 + "properties": { 19 + "allowAllCrew": { 20 + "type": "boolean", 21 + "description": "Allow any authenticated user to register as crew" 22 + }, 23 + "deployedAt": { 24 + "type": "string", 25 + "description": "RFC3339 timestamp of when the hold was deployed", 26 + "format": "datetime" 27 + }, 28 + "enableBlueskyPosts": { 29 + "type": "boolean", 30 + "description": "Enable Bluesky posts when manifests are pushed" 31 + }, 32 + "owner": { 33 + "type": "string", 34 + "description": "DID of the hold owner", 35 + "format": "did" 36 + }, 37 + "provider": { 38 + "type": "string", 39 + "description": "Deployment provider (e.g., fly.io, aws, etc.)" 40 + }, 41 + "public": { 42 + "type": "boolean", 43 + "description": "Whether this hold allows public blob reads (pulls) without authentication" 44 + }, 45 + "region": { 46 + "type": "string", 47 + "description": "S3 region where blobs are stored" 48 + } 49 + } 50 + } 51 + } 52 + } 53 + }
+49
crates/jacquard-api/lexicons/io_atcr_hold_crew.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.atcr.hold.crew", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Crew member in a hold's embedded PDS. Grants access permissions to push blobs to the hold. Stored in the hold's embedded PDS (one record per member).", 8 + "key": "any", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "member", 13 + "role", 14 + "permissions", 15 + "addedAt" 16 + ], 17 + "properties": { 18 + "addedAt": { 19 + "type": "string", 20 + "description": "RFC3339 timestamp of when the member was added", 21 + "format": "datetime" 22 + }, 23 + "member": { 24 + "type": "string", 25 + "description": "DID of the crew member", 26 + "format": "did" 27 + }, 28 + "permissions": { 29 + "type": "array", 30 + "description": "Specific permissions granted to this member", 31 + "items": { 32 + "type": "string" 33 + } 34 + }, 35 + "role": { 36 + "type": "string", 37 + "description": "Member's role in the hold", 38 + "knownValues": [ 39 + "owner", 40 + "admin", 41 + "write", 42 + "read" 43 + ] 44 + } 45 + } 46 + } 47 + } 48 + } 49 + }
+56
crates/jacquard-api/lexicons/io_atcr_hold_layer.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.atcr.hold.layer", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Represents metadata about a container layer stored in the hold. Stored in the hold's embedded PDS for tracking and analytics.", 8 + "key": "tid", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "digest", 13 + "size", 14 + "mediaType", 15 + "repository", 16 + "userDid", 17 + "userHandle", 18 + "createdAt" 19 + ], 20 + "properties": { 21 + "createdAt": { 22 + "type": "string", 23 + "description": "RFC3339 timestamp of when the layer was uploaded", 24 + "format": "datetime" 25 + }, 26 + "digest": { 27 + "type": "string", 28 + "description": "Layer digest (e.g., sha256:abc123...)" 29 + }, 30 + "mediaType": { 31 + "type": "string", 32 + "description": "Media type (e.g., application/vnd.oci.image.layer.v1.tar+gzip)" 33 + }, 34 + "repository": { 35 + "type": "string", 36 + "description": "Repository this layer belongs to" 37 + }, 38 + "size": { 39 + "type": "integer", 40 + "description": "Size in bytes" 41 + }, 42 + "userDid": { 43 + "type": "string", 44 + "description": "DID of user who uploaded this layer", 45 + "format": "did" 46 + }, 47 + "userHandle": { 48 + "type": "string", 49 + "description": "Handle of user (for display purposes)", 50 + "format": "handle" 51 + } 52 + } 53 + } 54 + } 55 + } 56 + }
+195
crates/jacquard-api/lexicons/io_atcr_manifest.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.atcr.manifest", 4 + "defs": { 5 + "blobReference": { 6 + "type": "object", 7 + "description": "Reference to a blob stored in S3 or external storage", 8 + "required": [ 9 + "mediaType", 10 + "size", 11 + "digest" 12 + ], 13 + "properties": { 14 + "annotations": { 15 + "type": "unknown", 16 + "description": "Optional OCI annotation metadata. Map of string keys to string values." 17 + }, 18 + "digest": { 19 + "type": "string", 20 + "description": "Content digest (e.g., 'sha256:...')" 21 + }, 22 + "mediaType": { 23 + "type": "string", 24 + "description": "MIME type of the blob" 25 + }, 26 + "size": { 27 + "type": "integer", 28 + "description": "Size in bytes" 29 + }, 30 + "urls": { 31 + "type": "array", 32 + "description": "Optional direct URLs to blob (for BYOS)", 33 + "items": { 34 + "type": "string", 35 + "format": "uri" 36 + } 37 + } 38 + } 39 + }, 40 + "main": { 41 + "type": "record", 42 + "description": "A container image manifest following OCI specification, stored in ATProto", 43 + "key": "tid", 44 + "record": { 45 + "type": "object", 46 + "required": [ 47 + "repository", 48 + "digest", 49 + "mediaType", 50 + "schemaVersion", 51 + "createdAt" 52 + ], 53 + "properties": { 54 + "annotations": { 55 + "type": "unknown", 56 + "description": "Optional OCI annotation metadata. Map of string keys to string values (e.g., org.opencontainers.image.title → 'My App')." 57 + }, 58 + "config": { 59 + "type": "ref", 60 + "description": "Reference to image configuration blob", 61 + "ref": "#blobReference" 62 + }, 63 + "createdAt": { 64 + "type": "string", 65 + "description": "Record creation timestamp", 66 + "format": "datetime" 67 + }, 68 + "digest": { 69 + "type": "string", 70 + "description": "Content digest (e.g., 'sha256:abc123...')" 71 + }, 72 + "holdDid": { 73 + "type": "string", 74 + "description": "DID of the hold service where blobs are stored (e.g., 'did:web:hold01.atcr.io'). Primary reference for hold resolution.", 75 + "format": "did" 76 + }, 77 + "holdEndpoint": { 78 + "type": "string", 79 + "description": "Hold service endpoint URL where blobs are stored. DEPRECATED: Use holdDid instead. Kept for backward compatibility.", 80 + "format": "uri" 81 + }, 82 + "layers": { 83 + "type": "array", 84 + "description": "Filesystem layers (for image manifests)", 85 + "items": { 86 + "type": "ref", 87 + "ref": "#blobReference" 88 + } 89 + }, 90 + "manifestBlob": { 91 + "type": "blob", 92 + "description": "The full OCI manifest stored as a blob in ATProto." 93 + }, 94 + "manifests": { 95 + "type": "array", 96 + "description": "Referenced manifests (for manifest lists/indexes)", 97 + "items": { 98 + "type": "ref", 99 + "ref": "#manifestReference" 100 + } 101 + }, 102 + "mediaType": { 103 + "type": "string", 104 + "description": "OCI media type", 105 + "knownValues": [ 106 + "application/vnd.oci.image.manifest.v1+json", 107 + "application/vnd.docker.distribution.manifest.v2+json", 108 + "application/vnd.oci.image.index.v1+json", 109 + "application/vnd.docker.distribution.manifest.list.v2+json" 110 + ] 111 + }, 112 + "repository": { 113 + "type": "string", 114 + "description": "Repository name (e.g., 'myapp'). Scoped to user's DID.", 115 + "maxLength": 255 116 + }, 117 + "schemaVersion": { 118 + "type": "integer", 119 + "description": "OCI schema version (typically 2)" 120 + }, 121 + "subject": { 122 + "type": "ref", 123 + "description": "Optional reference to another manifest (for attestations, signatures)", 124 + "ref": "#blobReference" 125 + } 126 + } 127 + } 128 + }, 129 + "manifestReference": { 130 + "type": "object", 131 + "description": "Reference to a manifest in a manifest list/index", 132 + "required": [ 133 + "mediaType", 134 + "size", 135 + "digest" 136 + ], 137 + "properties": { 138 + "annotations": { 139 + "type": "unknown", 140 + "description": "Optional OCI annotation metadata. Map of string keys to string values." 141 + }, 142 + "digest": { 143 + "type": "string", 144 + "description": "Content digest (e.g., 'sha256:...')" 145 + }, 146 + "mediaType": { 147 + "type": "string", 148 + "description": "Media type of the referenced manifest" 149 + }, 150 + "platform": { 151 + "type": "ref", 152 + "description": "Platform information for this manifest", 153 + "ref": "#platform" 154 + }, 155 + "size": { 156 + "type": "integer", 157 + "description": "Size in bytes" 158 + } 159 + } 160 + }, 161 + "platform": { 162 + "type": "object", 163 + "description": "Platform information describing OS and architecture", 164 + "required": [ 165 + "architecture", 166 + "os" 167 + ], 168 + "properties": { 169 + "architecture": { 170 + "type": "string", 171 + "description": "CPU architecture (e.g., 'amd64', 'arm64', 'arm')" 172 + }, 173 + "os": { 174 + "type": "string", 175 + "description": "Operating system (e.g., 'linux', 'windows', 'darwin')" 176 + }, 177 + "osFeatures": { 178 + "type": "array", 179 + "description": "Optional OS features", 180 + "items": { 181 + "type": "string" 182 + } 183 + }, 184 + "osVersion": { 185 + "type": "string", 186 + "description": "Optional OS version" 187 + }, 188 + "variant": { 189 + "type": "string", 190 + "description": "Optional CPU variant (e.g., 'v7' for ARM)" 191 + } 192 + } 193 + } 194 + } 195 + }
+34
crates/jacquard-api/lexicons/io_atcr_sailor_profile.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.atcr.sailor.profile", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "User profile for ATCR registry. Stores preferences like default hold for blob storage.", 8 + "key": "literal:self", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "createdAt" 13 + ], 14 + "properties": { 15 + "createdAt": { 16 + "type": "string", 17 + "description": "Profile creation timestamp", 18 + "format": "datetime" 19 + }, 20 + "defaultHold": { 21 + "type": "string", 22 + "description": "Default hold endpoint for blob storage. If null, user has opted out of defaults.", 23 + "format": "uri" 24 + }, 25 + "updatedAt": { 26 + "type": "string", 27 + "description": "Profile last updated timestamp", 28 + "format": "datetime" 29 + } 30 + } 31 + } 32 + } 33 + } 34 + }
+50
crates/jacquard-api/lexicons/io_atcr_sailor_star.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.atcr.sailor.star", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A star (like) on a container image repository. Stored in the starrer's PDS, similar to Bluesky likes.", 8 + "key": "any", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "subject", 13 + "createdAt" 14 + ], 15 + "properties": { 16 + "createdAt": { 17 + "type": "string", 18 + "description": "Star creation timestamp", 19 + "format": "datetime" 20 + }, 21 + "subject": { 22 + "type": "ref", 23 + "description": "The repository being starred", 24 + "ref": "#subject" 25 + } 26 + } 27 + } 28 + }, 29 + "subject": { 30 + "type": "object", 31 + "description": "Reference to a repository owned by a user", 32 + "required": [ 33 + "did", 34 + "repository" 35 + ], 36 + "properties": { 37 + "did": { 38 + "type": "string", 39 + "description": "DID of the repository owner", 40 + "format": "did" 41 + }, 42 + "repository": { 43 + "type": "string", 44 + "description": "Repository name (e.g., 'myapp')", 45 + "maxLength": 255 46 + } 47 + } 48 + } 49 + } 50 + }
+45
crates/jacquard-api/lexicons/io_atcr_tag.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.atcr.tag", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A named tag pointing to a specific manifest digest", 8 + "key": "any", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "repository", 13 + "tag", 14 + "createdAt" 15 + ], 16 + "properties": { 17 + "createdAt": { 18 + "type": "string", 19 + "description": "Tag creation timestamp", 20 + "format": "datetime" 21 + }, 22 + "manifest": { 23 + "type": "string", 24 + "description": "AT-URI of the manifest this tag points to (e.g., 'at://did:plc:xyz/io.atcr.manifest/abc123'). Preferred over manifestDigest for new records.", 25 + "format": "at-uri" 26 + }, 27 + "manifestDigest": { 28 + "type": "string", 29 + "description": "DEPRECATED: Digest of the manifest (e.g., 'sha256:...'). Kept for backward compatibility with old records. New records should use 'manifest' field instead." 30 + }, 31 + "repository": { 32 + "type": "string", 33 + "description": "Repository name (e.g., 'myapp'). Scoped to user's DID.", 34 + "maxLength": 255 35 + }, 36 + "tag": { 37 + "type": "string", 38 + "description": "Tag name (e.g., 'latest', 'v1.0.0', '12-slim')", 39 + "maxLength": 128 40 + } 41 + } 42 + } 43 + } 44 + } 45 + }
+33
crates/jacquard-api/lexicons/io_whiteside_linkedAccount.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.whiteside.linkedAccount", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "A linked account record containing external account information", 8 + "record": { 9 + "type": "object", 10 + "required": [ 11 + "icon", 12 + "name", 13 + "link" 14 + ], 15 + "properties": { 16 + "icon": { 17 + "type": "string", 18 + "description": "Icon identifier or URL for the linked account" 19 + }, 20 + "link": { 21 + "type": "string", 22 + "description": "URL to the linked account", 23 + "format": "uri" 24 + }, 25 + "name": { 26 + "type": "string", 27 + "description": "Display name of the linked account" 28 + } 29 + } 30 + } 31 + } 32 + } 33 + }
+36
crates/jacquard-api/lexicons/io_whiteside_profile.json
··· 1 + { 2 + "lexicon": 1, 3 + "id": "io.whiteside.profile", 4 + "defs": { 5 + "main": { 6 + "type": "record", 7 + "description": "Profile information (bio, skills, etc.)", 8 + "key": "literal:bio", 9 + "record": { 10 + "type": "object", 11 + "required": [ 12 + "heading", 13 + "content", 14 + "updatedAt" 15 + ], 16 + "properties": { 17 + "content": { 18 + "type": "string", 19 + "description": "Profile content in plain text or markdown format", 20 + "maxLength": 5000 21 + }, 22 + "heading": { 23 + "type": "string", 24 + "description": "Profile section heading (e.g. 'Hey, I'm John')", 25 + "maxLength": 200 26 + }, 27 + "updatedAt": { 28 + "type": "string", 29 + "description": "Last update timestamp in ISO 8601 format", 30 + "format": "datetime" 31 + } 32 + } 33 + } 34 + } 35 + } 36 + }
+6
crates/jacquard-api/src/blog_pckt/richtext.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 facet;
+1280
crates/jacquard-api/src/blog_pckt/richtext/facet.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: blog.pckt.richtext.facet 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// Facet feature for mentioning an AT URI 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct AtMention<'a> { 15 + #[serde(borrow)] 16 + pub at_uri: jacquard_common::types::string::Uri<'a>, 17 + } 18 + 19 + pub mod at_mention_state { 20 + 21 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 22 + #[allow(unused)] 23 + use ::core::marker::PhantomData; 24 + mod sealed { 25 + pub trait Sealed {} 26 + } 27 + /// State trait tracking which required fields have been set 28 + pub trait State: sealed::Sealed { 29 + type AtUri; 30 + } 31 + /// Empty state - all required fields are unset 32 + pub struct Empty(()); 33 + impl sealed::Sealed for Empty {} 34 + impl State for Empty { 35 + type AtUri = Unset; 36 + } 37 + ///State transition - sets the `at_uri` field to Set 38 + pub struct SetAtUri<S: State = Empty>(PhantomData<fn() -> S>); 39 + impl<S: State> sealed::Sealed for SetAtUri<S> {} 40 + impl<S: State> State for SetAtUri<S> { 41 + type AtUri = Set<members::at_uri>; 42 + } 43 + /// Marker types for field names 44 + #[allow(non_camel_case_types)] 45 + pub mod members { 46 + ///Marker type for the `at_uri` field 47 + pub struct at_uri(()); 48 + } 49 + } 50 + 51 + /// Builder for constructing an instance of this type 52 + pub struct AtMentionBuilder<'a, S: at_mention_state::State> { 53 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 54 + __unsafe_private_named: (::core::option::Option<jacquard_common::types::string::Uri<'a>>,), 55 + _phantom: ::core::marker::PhantomData<&'a ()>, 56 + } 57 + 58 + impl<'a> AtMention<'a> { 59 + /// Create a new builder for this type 60 + pub fn new() -> AtMentionBuilder<'a, at_mention_state::Empty> { 61 + AtMentionBuilder::new() 62 + } 63 + } 64 + 65 + impl<'a> AtMentionBuilder<'a, at_mention_state::Empty> { 66 + /// Create a new builder with all fields unset 67 + pub fn new() -> Self { 68 + AtMentionBuilder { 69 + _phantom_state: ::core::marker::PhantomData, 70 + __unsafe_private_named: (None,), 71 + _phantom: ::core::marker::PhantomData, 72 + } 73 + } 74 + } 75 + 76 + impl<'a, S> AtMentionBuilder<'a, S> 77 + where 78 + S: at_mention_state::State, 79 + S::AtUri: at_mention_state::IsUnset, 80 + { 81 + /// Set the `atURI` field (required) 82 + pub fn at_uri( 83 + mut self, 84 + value: impl Into<jacquard_common::types::string::Uri<'a>>, 85 + ) -> AtMentionBuilder<'a, at_mention_state::SetAtUri<S>> { 86 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 87 + AtMentionBuilder { 88 + _phantom_state: ::core::marker::PhantomData, 89 + __unsafe_private_named: self.__unsafe_private_named, 90 + _phantom: ::core::marker::PhantomData, 91 + } 92 + } 93 + } 94 + 95 + impl<'a, S> AtMentionBuilder<'a, S> 96 + where 97 + S: at_mention_state::State, 98 + S::AtUri: at_mention_state::IsSet, 99 + { 100 + /// Build the final struct 101 + pub fn build(self) -> AtMention<'a> { 102 + AtMention { 103 + at_uri: self.__unsafe_private_named.0.unwrap(), 104 + extra_data: Default::default(), 105 + } 106 + } 107 + /// Build the final struct with custom extra_data 108 + pub fn build_with_data( 109 + self, 110 + extra_data: std::collections::BTreeMap< 111 + jacquard_common::smol_str::SmolStr, 112 + jacquard_common::types::value::Data<'a>, 113 + >, 114 + ) -> AtMention<'a> { 115 + AtMention { 116 + at_uri: self.__unsafe_private_named.0.unwrap(), 117 + extra_data: Some(extra_data), 118 + } 119 + } 120 + } 121 + 122 + fn lexicon_doc_blog_pckt_richtext_facet() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 123 + ::jacquard_lexicon::lexicon::LexiconDoc { 124 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 125 + id: ::jacquard_common::CowStr::new_static("blog.pckt.richtext.facet"), 126 + revision: None, 127 + description: None, 128 + defs: { 129 + let mut map = ::std::collections::BTreeMap::new(); 130 + map.insert( 131 + ::jacquard_common::smol_str::SmolStr::new_static("atMention"), 132 + ::jacquard_lexicon::lexicon::LexUserType::Object( 133 + ::jacquard_lexicon::lexicon::LexObject { 134 + description: Some(::jacquard_common::CowStr::new_static( 135 + "Facet feature for mentioning an AT URI", 136 + )), 137 + required: Some(vec![::jacquard_common::smol_str::SmolStr::new_static( 138 + "atURI", 139 + )]), 140 + nullable: None, 141 + properties: { 142 + #[allow(unused_mut)] 143 + let mut map = ::std::collections::BTreeMap::new(); 144 + map.insert( 145 + ::jacquard_common::smol_str::SmolStr::new_static("atURI"), 146 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 147 + ::jacquard_lexicon::lexicon::LexString { 148 + description: None, 149 + format: Some( 150 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 151 + ), 152 + default: None, 153 + min_length: None, 154 + max_length: None, 155 + min_graphemes: None, 156 + max_graphemes: None, 157 + r#enum: None, 158 + r#const: None, 159 + known_values: None, 160 + }, 161 + ), 162 + ); 163 + map 164 + }, 165 + }, 166 + ), 167 + ); 168 + map.insert( 169 + ::jacquard_common::smol_str::SmolStr::new_static("bold"), 170 + ::jacquard_lexicon::lexicon::LexUserType::Object( 171 + ::jacquard_lexicon::lexicon::LexObject { 172 + description: Some(::jacquard_common::CowStr::new_static( 173 + "Facet feature for bold text", 174 + )), 175 + required: None, 176 + nullable: None, 177 + properties: { 178 + #[allow(unused_mut)] 179 + let mut map = ::std::collections::BTreeMap::new(); 180 + map 181 + }, 182 + }, 183 + ), 184 + ); 185 + map.insert( 186 + ::jacquard_common::smol_str::SmolStr::new_static("byteSlice"), 187 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 188 + description: Some( 189 + ::jacquard_common::CowStr::new_static( 190 + "Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text.", 191 + ), 192 + ), 193 + required: Some( 194 + vec![ 195 + ::jacquard_common::smol_str::SmolStr::new_static("byteStart"), 196 + ::jacquard_common::smol_str::SmolStr::new_static("byteEnd") 197 + ], 198 + ), 199 + nullable: None, 200 + properties: { 201 + #[allow(unused_mut)] 202 + let mut map = ::std::collections::BTreeMap::new(); 203 + map.insert( 204 + ::jacquard_common::smol_str::SmolStr::new_static("byteEnd"), 205 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 206 + description: None, 207 + default: None, 208 + minimum: Some(0i64), 209 + maximum: None, 210 + r#enum: None, 211 + r#const: None, 212 + }), 213 + ); 214 + map.insert( 215 + ::jacquard_common::smol_str::SmolStr::new_static( 216 + "byteStart", 217 + ), 218 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 219 + description: None, 220 + default: None, 221 + minimum: Some(0i64), 222 + maximum: None, 223 + r#enum: None, 224 + r#const: None, 225 + }), 226 + ); 227 + map 228 + }, 229 + }), 230 + ); 231 + map.insert( 232 + ::jacquard_common::smol_str::SmolStr::new_static("code"), 233 + ::jacquard_lexicon::lexicon::LexUserType::Object( 234 + ::jacquard_lexicon::lexicon::LexObject { 235 + description: Some(::jacquard_common::CowStr::new_static( 236 + "Facet feature for inline code", 237 + )), 238 + required: None, 239 + nullable: None, 240 + properties: { 241 + #[allow(unused_mut)] 242 + let mut map = ::std::collections::BTreeMap::new(); 243 + map 244 + }, 245 + }, 246 + ), 247 + ); 248 + map.insert( 249 + ::jacquard_common::smol_str::SmolStr::new_static("didMention"), 250 + ::jacquard_lexicon::lexicon::LexUserType::Object( 251 + ::jacquard_lexicon::lexicon::LexObject { 252 + description: Some(::jacquard_common::CowStr::new_static( 253 + "Facet feature for mentioning a DID", 254 + )), 255 + required: Some(vec![::jacquard_common::smol_str::SmolStr::new_static( 256 + "did", 257 + )]), 258 + nullable: None, 259 + properties: { 260 + #[allow(unused_mut)] 261 + let mut map = ::std::collections::BTreeMap::new(); 262 + map.insert( 263 + ::jacquard_common::smol_str::SmolStr::new_static("did"), 264 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 265 + ::jacquard_lexicon::lexicon::LexString { 266 + description: None, 267 + format: Some( 268 + ::jacquard_lexicon::lexicon::LexStringFormat::Did, 269 + ), 270 + default: None, 271 + min_length: None, 272 + max_length: None, 273 + min_graphemes: None, 274 + max_graphemes: None, 275 + r#enum: None, 276 + r#const: None, 277 + known_values: None, 278 + }, 279 + ), 280 + ); 281 + map 282 + }, 283 + }, 284 + ), 285 + ); 286 + map.insert( 287 + ::jacquard_common::smol_str::SmolStr::new_static("highlight"), 288 + ::jacquard_lexicon::lexicon::LexUserType::Object( 289 + ::jacquard_lexicon::lexicon::LexObject { 290 + description: Some(::jacquard_common::CowStr::new_static( 291 + "Facet feature for highlighted text", 292 + )), 293 + required: None, 294 + nullable: None, 295 + properties: { 296 + #[allow(unused_mut)] 297 + let mut map = ::std::collections::BTreeMap::new(); 298 + map 299 + }, 300 + }, 301 + ), 302 + ); 303 + map.insert( 304 + ::jacquard_common::smol_str::SmolStr::new_static("id"), 305 + ::jacquard_lexicon::lexicon::LexUserType::Object( 306 + ::jacquard_lexicon::lexicon::LexObject { 307 + description: Some(::jacquard_common::CowStr::new_static( 308 + "Facet feature for an identifier. Used for linking to a segment", 309 + )), 310 + required: None, 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("id"), 317 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 318 + ::jacquard_lexicon::lexicon::LexString { 319 + description: None, 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, 329 + }, 330 + ), 331 + ); 332 + map 333 + }, 334 + }, 335 + ), 336 + ); 337 + map.insert( 338 + ::jacquard_common::smol_str::SmolStr::new_static("italic"), 339 + ::jacquard_lexicon::lexicon::LexUserType::Object( 340 + ::jacquard_lexicon::lexicon::LexObject { 341 + description: Some(::jacquard_common::CowStr::new_static( 342 + "Facet feature for italic text", 343 + )), 344 + required: None, 345 + nullable: None, 346 + properties: { 347 + #[allow(unused_mut)] 348 + let mut map = ::std::collections::BTreeMap::new(); 349 + map 350 + }, 351 + }, 352 + ), 353 + ); 354 + map.insert( 355 + ::jacquard_common::smol_str::SmolStr::new_static("link"), 356 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 357 + description: Some( 358 + ::jacquard_common::CowStr::new_static( 359 + "Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL.", 360 + ), 361 + ), 362 + required: Some( 363 + vec![::jacquard_common::smol_str::SmolStr::new_static("uri")], 364 + ), 365 + nullable: None, 366 + properties: { 367 + #[allow(unused_mut)] 368 + let mut map = ::std::collections::BTreeMap::new(); 369 + map.insert( 370 + ::jacquard_common::smol_str::SmolStr::new_static("uri"), 371 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 372 + description: None, 373 + format: None, 374 + default: None, 375 + min_length: None, 376 + max_length: None, 377 + min_graphemes: None, 378 + max_graphemes: None, 379 + r#enum: None, 380 + r#const: None, 381 + known_values: None, 382 + }), 383 + ); 384 + map 385 + }, 386 + }), 387 + ); 388 + map.insert( 389 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 390 + ::jacquard_lexicon::lexicon::LexUserType::Object( 391 + ::jacquard_lexicon::lexicon::LexObject { 392 + description: None, 393 + required: Some(vec![ 394 + ::jacquard_common::smol_str::SmolStr::new_static("index"), 395 + ::jacquard_common::smol_str::SmolStr::new_static("features"), 396 + ]), 397 + nullable: None, 398 + properties: { 399 + #[allow(unused_mut)] 400 + let mut map = ::std::collections::BTreeMap::new(); 401 + map.insert( 402 + ::jacquard_common::smol_str::SmolStr::new_static("features"), 403 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array( 404 + ::jacquard_lexicon::lexicon::LexArray { 405 + description: None, 406 + items: ::jacquard_lexicon::lexicon::LexArrayItem::Union( 407 + ::jacquard_lexicon::lexicon::LexRefUnion { 408 + description: None, 409 + refs: vec![ 410 + ::jacquard_common::CowStr::new_static("#link"), 411 + ::jacquard_common::CowStr::new_static( 412 + "#didMention", 413 + ), 414 + ::jacquard_common::CowStr::new_static( 415 + "#atMention", 416 + ), 417 + ::jacquard_common::CowStr::new_static("#code"), 418 + ::jacquard_common::CowStr::new_static( 419 + "#highlight", 420 + ), 421 + ::jacquard_common::CowStr::new_static( 422 + "#underline", 423 + ), 424 + ::jacquard_common::CowStr::new_static( 425 + "#strikethrough", 426 + ), 427 + ::jacquard_common::CowStr::new_static("#id"), 428 + ::jacquard_common::CowStr::new_static("#bold"), 429 + ::jacquard_common::CowStr::new_static( 430 + "#italic", 431 + ), 432 + ], 433 + closed: None, 434 + }, 435 + ), 436 + min_length: None, 437 + max_length: None, 438 + }, 439 + ), 440 + ); 441 + map.insert( 442 + ::jacquard_common::smol_str::SmolStr::new_static("index"), 443 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( 444 + ::jacquard_lexicon::lexicon::LexRef { 445 + description: None, 446 + r#ref: ::jacquard_common::CowStr::new_static("#byteSlice"), 447 + }, 448 + ), 449 + ); 450 + map 451 + }, 452 + }, 453 + ), 454 + ); 455 + map.insert( 456 + ::jacquard_common::smol_str::SmolStr::new_static("strikethrough"), 457 + ::jacquard_lexicon::lexicon::LexUserType::Object( 458 + ::jacquard_lexicon::lexicon::LexObject { 459 + description: Some(::jacquard_common::CowStr::new_static( 460 + "Facet feature for strikethrough markup", 461 + )), 462 + required: None, 463 + nullable: None, 464 + properties: { 465 + #[allow(unused_mut)] 466 + let mut map = ::std::collections::BTreeMap::new(); 467 + map 468 + }, 469 + }, 470 + ), 471 + ); 472 + map.insert( 473 + ::jacquard_common::smol_str::SmolStr::new_static("underline"), 474 + ::jacquard_lexicon::lexicon::LexUserType::Object( 475 + ::jacquard_lexicon::lexicon::LexObject { 476 + description: Some(::jacquard_common::CowStr::new_static( 477 + "Facet feature for underline markup", 478 + )), 479 + required: None, 480 + nullable: None, 481 + properties: { 482 + #[allow(unused_mut)] 483 + let mut map = ::std::collections::BTreeMap::new(); 484 + map 485 + }, 486 + }, 487 + ), 488 + ); 489 + map 490 + }, 491 + } 492 + } 493 + 494 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AtMention<'a> { 495 + fn nsid() -> &'static str { 496 + "blog.pckt.richtext.facet" 497 + } 498 + fn def_name() -> &'static str { 499 + "atMention" 500 + } 501 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 502 + lexicon_doc_blog_pckt_richtext_facet() 503 + } 504 + fn validate( 505 + &self, 506 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 507 + Ok(()) 508 + } 509 + } 510 + 511 + /// Facet feature for bold text 512 + #[jacquard_derive::lexicon] 513 + #[derive( 514 + serde::Serialize, 515 + serde::Deserialize, 516 + Debug, 517 + Clone, 518 + PartialEq, 519 + Eq, 520 + jacquard_derive::IntoStatic, 521 + Default, 522 + )] 523 + #[serde(rename_all = "camelCase")] 524 + pub struct Bold<'a> {} 525 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Bold<'a> { 526 + fn nsid() -> &'static str { 527 + "blog.pckt.richtext.facet" 528 + } 529 + fn def_name() -> &'static str { 530 + "bold" 531 + } 532 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 533 + lexicon_doc_blog_pckt_richtext_facet() 534 + } 535 + fn validate( 536 + &self, 537 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 538 + Ok(()) 539 + } 540 + } 541 + 542 + /// Specifies the sub-string range a facet feature applies to. Start index is inclusive, end index is exclusive. Indices are zero-indexed, counting bytes of the UTF-8 encoded text. 543 + #[jacquard_derive::lexicon] 544 + #[derive( 545 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 546 + )] 547 + #[serde(rename_all = "camelCase")] 548 + pub struct ByteSlice<'a> { 549 + pub byte_end: i64, 550 + pub byte_start: i64, 551 + } 552 + 553 + pub mod byte_slice_state { 554 + 555 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 556 + #[allow(unused)] 557 + use ::core::marker::PhantomData; 558 + mod sealed { 559 + pub trait Sealed {} 560 + } 561 + /// State trait tracking which required fields have been set 562 + pub trait State: sealed::Sealed { 563 + type ByteStart; 564 + type ByteEnd; 565 + } 566 + /// Empty state - all required fields are unset 567 + pub struct Empty(()); 568 + impl sealed::Sealed for Empty {} 569 + impl State for Empty { 570 + type ByteStart = Unset; 571 + type ByteEnd = Unset; 572 + } 573 + ///State transition - sets the `byte_start` field to Set 574 + pub struct SetByteStart<S: State = Empty>(PhantomData<fn() -> S>); 575 + impl<S: State> sealed::Sealed for SetByteStart<S> {} 576 + impl<S: State> State for SetByteStart<S> { 577 + type ByteStart = Set<members::byte_start>; 578 + type ByteEnd = S::ByteEnd; 579 + } 580 + ///State transition - sets the `byte_end` field to Set 581 + pub struct SetByteEnd<S: State = Empty>(PhantomData<fn() -> S>); 582 + impl<S: State> sealed::Sealed for SetByteEnd<S> {} 583 + impl<S: State> State for SetByteEnd<S> { 584 + type ByteStart = S::ByteStart; 585 + type ByteEnd = Set<members::byte_end>; 586 + } 587 + /// Marker types for field names 588 + #[allow(non_camel_case_types)] 589 + pub mod members { 590 + ///Marker type for the `byte_start` field 591 + pub struct byte_start(()); 592 + ///Marker type for the `byte_end` field 593 + pub struct byte_end(()); 594 + } 595 + } 596 + 597 + /// Builder for constructing an instance of this type 598 + pub struct ByteSliceBuilder<'a, S: byte_slice_state::State> { 599 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 600 + __unsafe_private_named: (::core::option::Option<i64>, ::core::option::Option<i64>), 601 + _phantom: ::core::marker::PhantomData<&'a ()>, 602 + } 603 + 604 + impl<'a> ByteSlice<'a> { 605 + /// Create a new builder for this type 606 + pub fn new() -> ByteSliceBuilder<'a, byte_slice_state::Empty> { 607 + ByteSliceBuilder::new() 608 + } 609 + } 610 + 611 + impl<'a> ByteSliceBuilder<'a, byte_slice_state::Empty> { 612 + /// Create a new builder with all fields unset 613 + pub fn new() -> Self { 614 + ByteSliceBuilder { 615 + _phantom_state: ::core::marker::PhantomData, 616 + __unsafe_private_named: (None, None), 617 + _phantom: ::core::marker::PhantomData, 618 + } 619 + } 620 + } 621 + 622 + impl<'a, S> ByteSliceBuilder<'a, S> 623 + where 624 + S: byte_slice_state::State, 625 + S::ByteEnd: byte_slice_state::IsUnset, 626 + { 627 + /// Set the `byteEnd` field (required) 628 + pub fn byte_end( 629 + mut self, 630 + value: impl Into<i64>, 631 + ) -> ByteSliceBuilder<'a, byte_slice_state::SetByteEnd<S>> { 632 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 633 + ByteSliceBuilder { 634 + _phantom_state: ::core::marker::PhantomData, 635 + __unsafe_private_named: self.__unsafe_private_named, 636 + _phantom: ::core::marker::PhantomData, 637 + } 638 + } 639 + } 640 + 641 + impl<'a, S> ByteSliceBuilder<'a, S> 642 + where 643 + S: byte_slice_state::State, 644 + S::ByteStart: byte_slice_state::IsUnset, 645 + { 646 + /// Set the `byteStart` field (required) 647 + pub fn byte_start( 648 + mut self, 649 + value: impl Into<i64>, 650 + ) -> ByteSliceBuilder<'a, byte_slice_state::SetByteStart<S>> { 651 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 652 + ByteSliceBuilder { 653 + _phantom_state: ::core::marker::PhantomData, 654 + __unsafe_private_named: self.__unsafe_private_named, 655 + _phantom: ::core::marker::PhantomData, 656 + } 657 + } 658 + } 659 + 660 + impl<'a, S> ByteSliceBuilder<'a, S> 661 + where 662 + S: byte_slice_state::State, 663 + S::ByteStart: byte_slice_state::IsSet, 664 + S::ByteEnd: byte_slice_state::IsSet, 665 + { 666 + /// Build the final struct 667 + pub fn build(self) -> ByteSlice<'a> { 668 + ByteSlice { 669 + byte_end: self.__unsafe_private_named.0.unwrap(), 670 + byte_start: self.__unsafe_private_named.1.unwrap(), 671 + extra_data: Default::default(), 672 + } 673 + } 674 + /// Build the final struct with custom extra_data 675 + pub fn build_with_data( 676 + self, 677 + extra_data: std::collections::BTreeMap< 678 + jacquard_common::smol_str::SmolStr, 679 + jacquard_common::types::value::Data<'a>, 680 + >, 681 + ) -> ByteSlice<'a> { 682 + ByteSlice { 683 + byte_end: self.__unsafe_private_named.0.unwrap(), 684 + byte_start: self.__unsafe_private_named.1.unwrap(), 685 + extra_data: Some(extra_data), 686 + } 687 + } 688 + } 689 + 690 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ByteSlice<'a> { 691 + fn nsid() -> &'static str { 692 + "blog.pckt.richtext.facet" 693 + } 694 + fn def_name() -> &'static str { 695 + "byteSlice" 696 + } 697 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 698 + lexicon_doc_blog_pckt_richtext_facet() 699 + } 700 + fn validate( 701 + &self, 702 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 703 + { 704 + let value = &self.byte_end; 705 + if *value < 0i64 { 706 + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { 707 + path: ::jacquard_lexicon::validation::ValidationPath::from_field("byte_end"), 708 + min: 0i64, 709 + actual: *value, 710 + }); 711 + } 712 + } 713 + { 714 + let value = &self.byte_start; 715 + if *value < 0i64 { 716 + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { 717 + path: ::jacquard_lexicon::validation::ValidationPath::from_field("byte_start"), 718 + min: 0i64, 719 + actual: *value, 720 + }); 721 + } 722 + } 723 + Ok(()) 724 + } 725 + } 726 + 727 + /// Facet feature for inline code 728 + #[jacquard_derive::lexicon] 729 + #[derive( 730 + serde::Serialize, 731 + serde::Deserialize, 732 + Debug, 733 + Clone, 734 + PartialEq, 735 + Eq, 736 + jacquard_derive::IntoStatic, 737 + Default, 738 + )] 739 + #[serde(rename_all = "camelCase")] 740 + pub struct Code<'a> {} 741 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Code<'a> { 742 + fn nsid() -> &'static str { 743 + "blog.pckt.richtext.facet" 744 + } 745 + fn def_name() -> &'static str { 746 + "code" 747 + } 748 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 749 + lexicon_doc_blog_pckt_richtext_facet() 750 + } 751 + fn validate( 752 + &self, 753 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 754 + Ok(()) 755 + } 756 + } 757 + 758 + /// Facet feature for mentioning a DID 759 + #[jacquard_derive::lexicon] 760 + #[derive( 761 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 762 + )] 763 + #[serde(rename_all = "camelCase")] 764 + pub struct DidMention<'a> { 765 + #[serde(borrow)] 766 + pub did: jacquard_common::types::string::Did<'a>, 767 + } 768 + 769 + pub mod did_mention_state { 770 + 771 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 772 + #[allow(unused)] 773 + use ::core::marker::PhantomData; 774 + mod sealed { 775 + pub trait Sealed {} 776 + } 777 + /// State trait tracking which required fields have been set 778 + pub trait State: sealed::Sealed { 779 + type Did; 780 + } 781 + /// Empty state - all required fields are unset 782 + pub struct Empty(()); 783 + impl sealed::Sealed for Empty {} 784 + impl State for Empty { 785 + type Did = Unset; 786 + } 787 + ///State transition - sets the `did` field to Set 788 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 789 + impl<S: State> sealed::Sealed for SetDid<S> {} 790 + impl<S: State> State for SetDid<S> { 791 + type Did = Set<members::did>; 792 + } 793 + /// Marker types for field names 794 + #[allow(non_camel_case_types)] 795 + pub mod members { 796 + ///Marker type for the `did` field 797 + pub struct did(()); 798 + } 799 + } 800 + 801 + /// Builder for constructing an instance of this type 802 + pub struct DidMentionBuilder<'a, S: did_mention_state::State> { 803 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 804 + __unsafe_private_named: (::core::option::Option<jacquard_common::types::string::Did<'a>>,), 805 + _phantom: ::core::marker::PhantomData<&'a ()>, 806 + } 807 + 808 + impl<'a> DidMention<'a> { 809 + /// Create a new builder for this type 810 + pub fn new() -> DidMentionBuilder<'a, did_mention_state::Empty> { 811 + DidMentionBuilder::new() 812 + } 813 + } 814 + 815 + impl<'a> DidMentionBuilder<'a, did_mention_state::Empty> { 816 + /// Create a new builder with all fields unset 817 + pub fn new() -> Self { 818 + DidMentionBuilder { 819 + _phantom_state: ::core::marker::PhantomData, 820 + __unsafe_private_named: (None,), 821 + _phantom: ::core::marker::PhantomData, 822 + } 823 + } 824 + } 825 + 826 + impl<'a, S> DidMentionBuilder<'a, S> 827 + where 828 + S: did_mention_state::State, 829 + S::Did: did_mention_state::IsUnset, 830 + { 831 + /// Set the `did` field (required) 832 + pub fn did( 833 + mut self, 834 + value: impl Into<jacquard_common::types::string::Did<'a>>, 835 + ) -> DidMentionBuilder<'a, did_mention_state::SetDid<S>> { 836 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 837 + DidMentionBuilder { 838 + _phantom_state: ::core::marker::PhantomData, 839 + __unsafe_private_named: self.__unsafe_private_named, 840 + _phantom: ::core::marker::PhantomData, 841 + } 842 + } 843 + } 844 + 845 + impl<'a, S> DidMentionBuilder<'a, S> 846 + where 847 + S: did_mention_state::State, 848 + S::Did: did_mention_state::IsSet, 849 + { 850 + /// Build the final struct 851 + pub fn build(self) -> DidMention<'a> { 852 + DidMention { 853 + did: self.__unsafe_private_named.0.unwrap(), 854 + extra_data: Default::default(), 855 + } 856 + } 857 + /// Build the final struct with custom extra_data 858 + pub fn build_with_data( 859 + self, 860 + extra_data: std::collections::BTreeMap< 861 + jacquard_common::smol_str::SmolStr, 862 + jacquard_common::types::value::Data<'a>, 863 + >, 864 + ) -> DidMention<'a> { 865 + DidMention { 866 + did: self.__unsafe_private_named.0.unwrap(), 867 + extra_data: Some(extra_data), 868 + } 869 + } 870 + } 871 + 872 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DidMention<'a> { 873 + fn nsid() -> &'static str { 874 + "blog.pckt.richtext.facet" 875 + } 876 + fn def_name() -> &'static str { 877 + "didMention" 878 + } 879 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 880 + lexicon_doc_blog_pckt_richtext_facet() 881 + } 882 + fn validate( 883 + &self, 884 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 885 + Ok(()) 886 + } 887 + } 888 + 889 + /// Facet feature for highlighted text 890 + #[jacquard_derive::lexicon] 891 + #[derive( 892 + serde::Serialize, 893 + serde::Deserialize, 894 + Debug, 895 + Clone, 896 + PartialEq, 897 + Eq, 898 + jacquard_derive::IntoStatic, 899 + Default, 900 + )] 901 + #[serde(rename_all = "camelCase")] 902 + pub struct Highlight<'a> {} 903 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Highlight<'a> { 904 + fn nsid() -> &'static str { 905 + "blog.pckt.richtext.facet" 906 + } 907 + fn def_name() -> &'static str { 908 + "highlight" 909 + } 910 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 911 + lexicon_doc_blog_pckt_richtext_facet() 912 + } 913 + fn validate( 914 + &self, 915 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 916 + Ok(()) 917 + } 918 + } 919 + 920 + /// Facet feature for an identifier. Used for linking to a segment 921 + #[jacquard_derive::lexicon] 922 + #[derive( 923 + serde::Serialize, 924 + serde::Deserialize, 925 + Debug, 926 + Clone, 927 + PartialEq, 928 + Eq, 929 + jacquard_derive::IntoStatic, 930 + Default, 931 + )] 932 + #[serde(rename_all = "camelCase")] 933 + pub struct Id<'a> { 934 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 935 + #[serde(borrow)] 936 + pub id: std::option::Option<jacquard_common::CowStr<'a>>, 937 + } 938 + 939 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Id<'a> { 940 + fn nsid() -> &'static str { 941 + "blog.pckt.richtext.facet" 942 + } 943 + fn def_name() -> &'static str { 944 + "id" 945 + } 946 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 947 + lexicon_doc_blog_pckt_richtext_facet() 948 + } 949 + fn validate( 950 + &self, 951 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 952 + Ok(()) 953 + } 954 + } 955 + 956 + /// Facet feature for italic text 957 + #[jacquard_derive::lexicon] 958 + #[derive( 959 + serde::Serialize, 960 + serde::Deserialize, 961 + Debug, 962 + Clone, 963 + PartialEq, 964 + Eq, 965 + jacquard_derive::IntoStatic, 966 + Default, 967 + )] 968 + #[serde(rename_all = "camelCase")] 969 + pub struct Italic<'a> {} 970 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Italic<'a> { 971 + fn nsid() -> &'static str { 972 + "blog.pckt.richtext.facet" 973 + } 974 + fn def_name() -> &'static str { 975 + "italic" 976 + } 977 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 978 + lexicon_doc_blog_pckt_richtext_facet() 979 + } 980 + fn validate( 981 + &self, 982 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 983 + Ok(()) 984 + } 985 + } 986 + 987 + /// Facet feature for a URL. The text URL may have been simplified or truncated, but the facet reference should be a complete URL. 988 + #[jacquard_derive::lexicon] 989 + #[derive( 990 + serde::Serialize, 991 + serde::Deserialize, 992 + Debug, 993 + Clone, 994 + PartialEq, 995 + Eq, 996 + jacquard_derive::IntoStatic, 997 + Default, 998 + )] 999 + #[serde(rename_all = "camelCase")] 1000 + pub struct Link<'a> { 1001 + #[serde(borrow)] 1002 + pub uri: jacquard_common::CowStr<'a>, 1003 + } 1004 + 1005 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Link<'a> { 1006 + fn nsid() -> &'static str { 1007 + "blog.pckt.richtext.facet" 1008 + } 1009 + fn def_name() -> &'static str { 1010 + "link" 1011 + } 1012 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1013 + lexicon_doc_blog_pckt_richtext_facet() 1014 + } 1015 + fn validate( 1016 + &self, 1017 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1018 + Ok(()) 1019 + } 1020 + } 1021 + 1022 + #[jacquard_derive::lexicon] 1023 + #[derive( 1024 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 1025 + )] 1026 + #[serde(rename_all = "camelCase")] 1027 + pub struct Facet<'a> { 1028 + #[serde(borrow)] 1029 + pub features: Vec<FacetFeaturesItem<'a>>, 1030 + #[serde(borrow)] 1031 + pub index: crate::blog_pckt::richtext::facet::ByteSlice<'a>, 1032 + } 1033 + 1034 + pub mod facet_state { 1035 + 1036 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 1037 + #[allow(unused)] 1038 + use ::core::marker::PhantomData; 1039 + mod sealed { 1040 + pub trait Sealed {} 1041 + } 1042 + /// State trait tracking which required fields have been set 1043 + pub trait State: sealed::Sealed { 1044 + type Index; 1045 + type Features; 1046 + } 1047 + /// Empty state - all required fields are unset 1048 + pub struct Empty(()); 1049 + impl sealed::Sealed for Empty {} 1050 + impl State for Empty { 1051 + type Index = Unset; 1052 + type Features = Unset; 1053 + } 1054 + ///State transition - sets the `index` field to Set 1055 + pub struct SetIndex<S: State = Empty>(PhantomData<fn() -> S>); 1056 + impl<S: State> sealed::Sealed for SetIndex<S> {} 1057 + impl<S: State> State for SetIndex<S> { 1058 + type Index = Set<members::index>; 1059 + type Features = S::Features; 1060 + } 1061 + ///State transition - sets the `features` field to Set 1062 + pub struct SetFeatures<S: State = Empty>(PhantomData<fn() -> S>); 1063 + impl<S: State> sealed::Sealed for SetFeatures<S> {} 1064 + impl<S: State> State for SetFeatures<S> { 1065 + type Index = S::Index; 1066 + type Features = Set<members::features>; 1067 + } 1068 + /// Marker types for field names 1069 + #[allow(non_camel_case_types)] 1070 + pub mod members { 1071 + ///Marker type for the `index` field 1072 + pub struct index(()); 1073 + ///Marker type for the `features` field 1074 + pub struct features(()); 1075 + } 1076 + } 1077 + 1078 + /// Builder for constructing an instance of this type 1079 + pub struct FacetBuilder<'a, S: facet_state::State> { 1080 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 1081 + __unsafe_private_named: ( 1082 + ::core::option::Option<Vec<FacetFeaturesItem<'a>>>, 1083 + ::core::option::Option<crate::blog_pckt::richtext::facet::ByteSlice<'a>>, 1084 + ), 1085 + _phantom: ::core::marker::PhantomData<&'a ()>, 1086 + } 1087 + 1088 + impl<'a> Facet<'a> { 1089 + /// Create a new builder for this type 1090 + pub fn new() -> FacetBuilder<'a, facet_state::Empty> { 1091 + FacetBuilder::new() 1092 + } 1093 + } 1094 + 1095 + impl<'a> FacetBuilder<'a, facet_state::Empty> { 1096 + /// Create a new builder with all fields unset 1097 + pub fn new() -> Self { 1098 + FacetBuilder { 1099 + _phantom_state: ::core::marker::PhantomData, 1100 + __unsafe_private_named: (None, None), 1101 + _phantom: ::core::marker::PhantomData, 1102 + } 1103 + } 1104 + } 1105 + 1106 + impl<'a, S> FacetBuilder<'a, S> 1107 + where 1108 + S: facet_state::State, 1109 + S::Features: facet_state::IsUnset, 1110 + { 1111 + /// Set the `features` field (required) 1112 + pub fn features( 1113 + mut self, 1114 + value: impl Into<Vec<FacetFeaturesItem<'a>>>, 1115 + ) -> FacetBuilder<'a, facet_state::SetFeatures<S>> { 1116 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 1117 + FacetBuilder { 1118 + _phantom_state: ::core::marker::PhantomData, 1119 + __unsafe_private_named: self.__unsafe_private_named, 1120 + _phantom: ::core::marker::PhantomData, 1121 + } 1122 + } 1123 + } 1124 + 1125 + impl<'a, S> FacetBuilder<'a, S> 1126 + where 1127 + S: facet_state::State, 1128 + S::Index: facet_state::IsUnset, 1129 + { 1130 + /// Set the `index` field (required) 1131 + pub fn index( 1132 + mut self, 1133 + value: impl Into<crate::blog_pckt::richtext::facet::ByteSlice<'a>>, 1134 + ) -> FacetBuilder<'a, facet_state::SetIndex<S>> { 1135 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 1136 + FacetBuilder { 1137 + _phantom_state: ::core::marker::PhantomData, 1138 + __unsafe_private_named: self.__unsafe_private_named, 1139 + _phantom: ::core::marker::PhantomData, 1140 + } 1141 + } 1142 + } 1143 + 1144 + impl<'a, S> FacetBuilder<'a, S> 1145 + where 1146 + S: facet_state::State, 1147 + S::Index: facet_state::IsSet, 1148 + S::Features: facet_state::IsSet, 1149 + { 1150 + /// Build the final struct 1151 + pub fn build(self) -> Facet<'a> { 1152 + Facet { 1153 + features: self.__unsafe_private_named.0.unwrap(), 1154 + index: self.__unsafe_private_named.1.unwrap(), 1155 + extra_data: Default::default(), 1156 + } 1157 + } 1158 + /// Build the final struct with custom extra_data 1159 + pub fn build_with_data( 1160 + self, 1161 + extra_data: std::collections::BTreeMap< 1162 + jacquard_common::smol_str::SmolStr, 1163 + jacquard_common::types::value::Data<'a>, 1164 + >, 1165 + ) -> Facet<'a> { 1166 + Facet { 1167 + features: self.__unsafe_private_named.0.unwrap(), 1168 + index: self.__unsafe_private_named.1.unwrap(), 1169 + extra_data: Some(extra_data), 1170 + } 1171 + } 1172 + } 1173 + 1174 + #[jacquard_derive::open_union] 1175 + #[derive( 1176 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 1177 + )] 1178 + #[serde(tag = "$type")] 1179 + #[serde(bound(deserialize = "'de: 'a"))] 1180 + pub enum FacetFeaturesItem<'a> { 1181 + #[serde(rename = "blog.pckt.richtext.facet#link")] 1182 + Link(Box<crate::blog_pckt::richtext::facet::Link<'a>>), 1183 + #[serde(rename = "blog.pckt.richtext.facet#didMention")] 1184 + DidMention(Box<crate::blog_pckt::richtext::facet::DidMention<'a>>), 1185 + #[serde(rename = "blog.pckt.richtext.facet#atMention")] 1186 + AtMention(Box<crate::blog_pckt::richtext::facet::AtMention<'a>>), 1187 + #[serde(rename = "blog.pckt.richtext.facet#code")] 1188 + Code(Box<crate::blog_pckt::richtext::facet::Code<'a>>), 1189 + #[serde(rename = "blog.pckt.richtext.facet#highlight")] 1190 + Highlight(Box<crate::blog_pckt::richtext::facet::Highlight<'a>>), 1191 + #[serde(rename = "blog.pckt.richtext.facet#underline")] 1192 + Underline(Box<crate::blog_pckt::richtext::facet::Underline<'a>>), 1193 + #[serde(rename = "blog.pckt.richtext.facet#strikethrough")] 1194 + Strikethrough(Box<crate::blog_pckt::richtext::facet::Strikethrough<'a>>), 1195 + #[serde(rename = "blog.pckt.richtext.facet#id")] 1196 + Id(Box<crate::blog_pckt::richtext::facet::Id<'a>>), 1197 + #[serde(rename = "blog.pckt.richtext.facet#bold")] 1198 + Bold(Box<crate::blog_pckt::richtext::facet::Bold<'a>>), 1199 + #[serde(rename = "blog.pckt.richtext.facet#italic")] 1200 + Italic(Box<crate::blog_pckt::richtext::facet::Italic<'a>>), 1201 + } 1202 + 1203 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Facet<'a> { 1204 + fn nsid() -> &'static str { 1205 + "blog.pckt.richtext.facet" 1206 + } 1207 + fn def_name() -> &'static str { 1208 + "main" 1209 + } 1210 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1211 + lexicon_doc_blog_pckt_richtext_facet() 1212 + } 1213 + fn validate( 1214 + &self, 1215 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1216 + Ok(()) 1217 + } 1218 + } 1219 + 1220 + /// Facet feature for strikethrough markup 1221 + #[jacquard_derive::lexicon] 1222 + #[derive( 1223 + serde::Serialize, 1224 + serde::Deserialize, 1225 + Debug, 1226 + Clone, 1227 + PartialEq, 1228 + Eq, 1229 + jacquard_derive::IntoStatic, 1230 + Default, 1231 + )] 1232 + #[serde(rename_all = "camelCase")] 1233 + pub struct Strikethrough<'a> {} 1234 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Strikethrough<'a> { 1235 + fn nsid() -> &'static str { 1236 + "blog.pckt.richtext.facet" 1237 + } 1238 + fn def_name() -> &'static str { 1239 + "strikethrough" 1240 + } 1241 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1242 + lexicon_doc_blog_pckt_richtext_facet() 1243 + } 1244 + fn validate( 1245 + &self, 1246 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1247 + Ok(()) 1248 + } 1249 + } 1250 + 1251 + /// Facet feature for underline markup 1252 + #[jacquard_derive::lexicon] 1253 + #[derive( 1254 + serde::Serialize, 1255 + serde::Deserialize, 1256 + Debug, 1257 + Clone, 1258 + PartialEq, 1259 + Eq, 1260 + jacquard_derive::IntoStatic, 1261 + Default, 1262 + )] 1263 + #[serde(rename_all = "camelCase")] 1264 + pub struct Underline<'a> {} 1265 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Underline<'a> { 1266 + fn nsid() -> &'static str { 1267 + "blog.pckt.richtext.facet" 1268 + } 1269 + fn def_name() -> &'static str { 1270 + "underline" 1271 + } 1272 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1273 + lexicon_doc_blog_pckt_richtext_facet() 1274 + } 1275 + fn validate( 1276 + &self, 1277 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1278 + Ok(()) 1279 + } 1280 + }
+46
crates/jacquard-api/src/com__5jiji/test/list_videos.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: com.5jiji.test.listVideos 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, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 10 + )] 11 + #[serde(rename_all = "camelCase")] 12 + pub struct ListVideos; 13 + /// The list of videos 14 + #[derive( 15 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 16 + )] 17 + #[serde(rename_all = "camelCase")] 18 + pub struct ListVideosOutput { 19 + pub body: bytes::Bytes, 20 + } 21 + 22 + /// Response type for 23 + ///com.5jiji.test.listVideos 24 + pub struct ListVideosResponse; 25 + impl jacquard_common::xrpc::XrpcResp for ListVideosResponse { 26 + const NSID: &'static str = "com.5jiji.test.listVideos"; 27 + const ENCODING: &'static str = "application/json"; 28 + type Output<'de> = ListVideosOutput; 29 + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 30 + } 31 + 32 + impl jacquard_common::xrpc::XrpcRequest for ListVideos { 33 + const NSID: &'static str = "com.5jiji.test.listVideos"; 34 + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 35 + type Response = ListVideosResponse; 36 + } 37 + 38 + /// Endpoint type for 39 + ///com.5jiji.test.listVideos 40 + pub struct ListVideosRequest; 41 + impl jacquard_common::xrpc::XrpcEndpoint for ListVideosRequest { 42 + const PATH: &'static str = "/xrpc/com.5jiji.test.listVideos"; 43 + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 44 + type Request<'de> = ListVideos; 45 + type Response = ListVideosResponse; 46 + }
+6
crates/jacquard-api/src/com_yuna0x0.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 guestbook;
+6
crates/jacquard-api/src/com_yuna0x0/guestbook.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 sign;
+369
crates/jacquard-api/src/com_yuna0x0/guestbook/sign.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: com.yuna0x0.guestbook.sign 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// a sign in the guestbook 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct Sign<'a> { 15 + pub created_at: jacquard_common::types::string::Datetime, 16 + #[serde(borrow)] 17 + pub message: jacquard_common::CowStr<'a>, 18 + #[serde(borrow)] 19 + pub subject: jacquard_common::types::ident::AtIdentifier<'a>, 20 + } 21 + 22 + pub mod sign_state { 23 + 24 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 25 + #[allow(unused)] 26 + use ::core::marker::PhantomData; 27 + mod sealed { 28 + pub trait Sealed {} 29 + } 30 + /// State trait tracking which required fields have been set 31 + pub trait State: sealed::Sealed { 32 + type CreatedAt; 33 + type Subject; 34 + type Message; 35 + } 36 + /// Empty state - all required fields are unset 37 + pub struct Empty(()); 38 + impl sealed::Sealed for Empty {} 39 + impl State for Empty { 40 + type CreatedAt = Unset; 41 + type Subject = Unset; 42 + type Message = Unset; 43 + } 44 + ///State transition - sets the `created_at` field to Set 45 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 46 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 47 + impl<S: State> State for SetCreatedAt<S> { 48 + type CreatedAt = Set<members::created_at>; 49 + type Subject = S::Subject; 50 + type Message = S::Message; 51 + } 52 + ///State transition - sets the `subject` field to Set 53 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetSubject<S> {} 55 + impl<S: State> State for SetSubject<S> { 56 + type CreatedAt = S::CreatedAt; 57 + type Subject = Set<members::subject>; 58 + type Message = S::Message; 59 + } 60 + ///State transition - sets the `message` field to Set 61 + pub struct SetMessage<S: State = Empty>(PhantomData<fn() -> S>); 62 + impl<S: State> sealed::Sealed for SetMessage<S> {} 63 + impl<S: State> State for SetMessage<S> { 64 + type CreatedAt = S::CreatedAt; 65 + type Subject = S::Subject; 66 + type Message = Set<members::message>; 67 + } 68 + /// Marker types for field names 69 + #[allow(non_camel_case_types)] 70 + pub mod members { 71 + ///Marker type for the `created_at` field 72 + pub struct created_at(()); 73 + ///Marker type for the `subject` field 74 + pub struct subject(()); 75 + ///Marker type for the `message` field 76 + pub struct message(()); 77 + } 78 + } 79 + 80 + /// Builder for constructing an instance of this type 81 + pub struct SignBuilder<'a, S: sign_state::State> { 82 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 83 + __unsafe_private_named: ( 84 + ::core::option::Option<jacquard_common::types::string::Datetime>, 85 + ::core::option::Option<jacquard_common::CowStr<'a>>, 86 + ::core::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>, 87 + ), 88 + _phantom: ::core::marker::PhantomData<&'a ()>, 89 + } 90 + 91 + impl<'a> Sign<'a> { 92 + /// Create a new builder for this type 93 + pub fn new() -> SignBuilder<'a, sign_state::Empty> { 94 + SignBuilder::new() 95 + } 96 + } 97 + 98 + impl<'a> SignBuilder<'a, sign_state::Empty> { 99 + /// Create a new builder with all fields unset 100 + pub fn new() -> Self { 101 + SignBuilder { 102 + _phantom_state: ::core::marker::PhantomData, 103 + __unsafe_private_named: (None, None, None), 104 + _phantom: ::core::marker::PhantomData, 105 + } 106 + } 107 + } 108 + 109 + impl<'a, S> SignBuilder<'a, S> 110 + where 111 + S: sign_state::State, 112 + S::CreatedAt: sign_state::IsUnset, 113 + { 114 + /// Set the `createdAt` field (required) 115 + pub fn created_at( 116 + mut self, 117 + value: impl Into<jacquard_common::types::string::Datetime>, 118 + ) -> SignBuilder<'a, sign_state::SetCreatedAt<S>> { 119 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 120 + SignBuilder { 121 + _phantom_state: ::core::marker::PhantomData, 122 + __unsafe_private_named: self.__unsafe_private_named, 123 + _phantom: ::core::marker::PhantomData, 124 + } 125 + } 126 + } 127 + 128 + impl<'a, S> SignBuilder<'a, S> 129 + where 130 + S: sign_state::State, 131 + S::Message: sign_state::IsUnset, 132 + { 133 + /// Set the `message` field (required) 134 + pub fn message( 135 + mut self, 136 + value: impl Into<jacquard_common::CowStr<'a>>, 137 + ) -> SignBuilder<'a, sign_state::SetMessage<S>> { 138 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 139 + SignBuilder { 140 + _phantom_state: ::core::marker::PhantomData, 141 + __unsafe_private_named: self.__unsafe_private_named, 142 + _phantom: ::core::marker::PhantomData, 143 + } 144 + } 145 + } 146 + 147 + impl<'a, S> SignBuilder<'a, S> 148 + where 149 + S: sign_state::State, 150 + S::Subject: sign_state::IsUnset, 151 + { 152 + /// Set the `subject` field (required) 153 + pub fn subject( 154 + mut self, 155 + value: impl Into<jacquard_common::types::ident::AtIdentifier<'a>>, 156 + ) -> SignBuilder<'a, sign_state::SetSubject<S>> { 157 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 158 + SignBuilder { 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> SignBuilder<'a, S> 167 + where 168 + S: sign_state::State, 169 + S::CreatedAt: sign_state::IsSet, 170 + S::Subject: sign_state::IsSet, 171 + S::Message: sign_state::IsSet, 172 + { 173 + /// Build the final struct 174 + pub fn build(self) -> Sign<'a> { 175 + Sign { 176 + created_at: self.__unsafe_private_named.0.unwrap(), 177 + message: self.__unsafe_private_named.1.unwrap(), 178 + subject: self.__unsafe_private_named.2.unwrap(), 179 + extra_data: Default::default(), 180 + } 181 + } 182 + /// Build the final struct with custom extra_data 183 + pub fn build_with_data( 184 + self, 185 + extra_data: std::collections::BTreeMap< 186 + jacquard_common::smol_str::SmolStr, 187 + jacquard_common::types::value::Data<'a>, 188 + >, 189 + ) -> Sign<'a> { 190 + Sign { 191 + created_at: self.__unsafe_private_named.0.unwrap(), 192 + message: self.__unsafe_private_named.1.unwrap(), 193 + subject: self.__unsafe_private_named.2.unwrap(), 194 + extra_data: Some(extra_data), 195 + } 196 + } 197 + } 198 + 199 + impl<'a> Sign<'a> { 200 + pub fn uri( 201 + uri: impl Into<jacquard_common::CowStr<'a>>, 202 + ) -> Result< 203 + jacquard_common::types::uri::RecordUri<'a, SignRecord>, 204 + jacquard_common::types::uri::UriError, 205 + > { 206 + jacquard_common::types::uri::RecordUri::try_from_uri( 207 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 208 + ) 209 + } 210 + } 211 + 212 + /// Typed wrapper for GetRecord response with this collection's record type. 213 + #[derive( 214 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 215 + )] 216 + #[serde(rename_all = "camelCase")] 217 + pub struct SignGetRecordOutput<'a> { 218 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 219 + #[serde(borrow)] 220 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 221 + #[serde(borrow)] 222 + pub uri: jacquard_common::types::string::AtUri<'a>, 223 + #[serde(borrow)] 224 + pub value: Sign<'a>, 225 + } 226 + 227 + impl From<SignGetRecordOutput<'_>> for Sign<'_> { 228 + fn from(output: SignGetRecordOutput<'_>) -> Self { 229 + use jacquard_common::IntoStatic; 230 + output.value.into_static() 231 + } 232 + } 233 + 234 + impl jacquard_common::types::collection::Collection for Sign<'_> { 235 + const NSID: &'static str = "com.yuna0x0.guestbook.sign"; 236 + type Record = SignRecord; 237 + } 238 + 239 + /// Marker type for deserializing records from this collection. 240 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 241 + pub struct SignRecord; 242 + impl jacquard_common::xrpc::XrpcResp for SignRecord { 243 + const NSID: &'static str = "com.yuna0x0.guestbook.sign"; 244 + const ENCODING: &'static str = "application/json"; 245 + type Output<'de> = SignGetRecordOutput<'de>; 246 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 247 + } 248 + 249 + impl jacquard_common::types::collection::Collection for SignRecord { 250 + const NSID: &'static str = "com.yuna0x0.guestbook.sign"; 251 + type Record = SignRecord; 252 + } 253 + 254 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Sign<'a> { 255 + fn nsid() -> &'static str { 256 + "com.yuna0x0.guestbook.sign" 257 + } 258 + fn def_name() -> &'static str { 259 + "main" 260 + } 261 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 262 + lexicon_doc_com_yuna0x0_guestbook_sign() 263 + } 264 + fn validate( 265 + &self, 266 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 267 + { 268 + let value = &self.message; 269 + #[allow(unused_comparisons)] 270 + if <str>::len(value.as_ref()) > 100usize { 271 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 272 + path: ::jacquard_lexicon::validation::ValidationPath::from_field("message"), 273 + max: 100usize, 274 + actual: <str>::len(value.as_ref()), 275 + }); 276 + } 277 + } 278 + Ok(()) 279 + } 280 + } 281 + 282 + fn lexicon_doc_com_yuna0x0_guestbook_sign() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 283 + ::jacquard_lexicon::lexicon::LexiconDoc { 284 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 285 + id: ::jacquard_common::CowStr::new_static("com.yuna0x0.guestbook.sign"), 286 + revision: None, 287 + description: None, 288 + defs: { 289 + let mut map = ::std::collections::BTreeMap::new(); 290 + map.insert( 291 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 292 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 293 + description: Some( 294 + ::jacquard_common::CowStr::new_static("a sign in the guestbook"), 295 + ), 296 + key: Some(::jacquard_common::CowStr::new_static("tid")), 297 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 298 + description: None, 299 + required: Some( 300 + vec![ 301 + ::jacquard_common::smol_str::SmolStr::new_static("subject"), 302 + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), 303 + ::jacquard_common::smol_str::SmolStr::new_static("message") 304 + ], 305 + ), 306 + nullable: None, 307 + properties: { 308 + #[allow(unused_mut)] 309 + let mut map = ::std::collections::BTreeMap::new(); 310 + map.insert( 311 + ::jacquard_common::smol_str::SmolStr::new_static( 312 + "createdAt", 313 + ), 314 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 315 + description: None, 316 + format: Some( 317 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 318 + ), 319 + default: None, 320 + min_length: None, 321 + max_length: None, 322 + min_graphemes: None, 323 + max_graphemes: None, 324 + r#enum: None, 325 + r#const: None, 326 + known_values: None, 327 + }), 328 + ); 329 + map.insert( 330 + ::jacquard_common::smol_str::SmolStr::new_static("message"), 331 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 332 + description: None, 333 + format: None, 334 + default: None, 335 + min_length: None, 336 + max_length: Some(100usize), 337 + min_graphemes: None, 338 + max_graphemes: None, 339 + r#enum: None, 340 + r#const: None, 341 + known_values: None, 342 + }), 343 + ); 344 + map.insert( 345 + ::jacquard_common::smol_str::SmolStr::new_static("subject"), 346 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 347 + description: None, 348 + format: Some( 349 + ::jacquard_lexicon::lexicon::LexStringFormat::AtIdentifier, 350 + ), 351 + default: None, 352 + min_length: None, 353 + max_length: None, 354 + min_graphemes: None, 355 + max_graphemes: None, 356 + r#enum: None, 357 + r#const: None, 358 + known_values: None, 359 + }), 360 + ); 361 + map 362 + }, 363 + }), 364 + }), 365 + ); 366 + map 367 + }, 368 + } 369 + }
+6
crates/jacquard-api/src/fyi_questionable/actor.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 profile;
+300
crates/jacquard-api/src/fyi_questionable/actor/profile.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: fyi.questionable.actor.profile 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// A declaration of a Questionable account profile. 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct Profile<'a> { 15 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 16 + pub created_at: std::option::Option<jacquard_common::types::string::Datetime>, 17 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 18 + #[serde(borrow)] 19 + pub display_name: std::option::Option<jacquard_common::CowStr<'a>>, 20 + } 21 + 22 + pub mod profile_state { 23 + 24 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 25 + #[allow(unused)] 26 + use ::core::marker::PhantomData; 27 + mod sealed { 28 + pub trait Sealed {} 29 + } 30 + /// State trait tracking which required fields have been set 31 + pub trait State: sealed::Sealed {} 32 + /// Empty state - all required fields are unset 33 + pub struct Empty(()); 34 + impl sealed::Sealed for Empty {} 35 + impl State for Empty {} 36 + /// Marker types for field names 37 + #[allow(non_camel_case_types)] 38 + pub mod members {} 39 + } 40 + 41 + /// Builder for constructing an instance of this type 42 + pub struct ProfileBuilder<'a, S: profile_state::State> { 43 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 44 + __unsafe_private_named: ( 45 + ::core::option::Option<jacquard_common::types::string::Datetime>, 46 + ::core::option::Option<jacquard_common::CowStr<'a>>, 47 + ), 48 + _phantom: ::core::marker::PhantomData<&'a ()>, 49 + } 50 + 51 + impl<'a> Profile<'a> { 52 + /// Create a new builder for this type 53 + pub fn new() -> ProfileBuilder<'a, profile_state::Empty> { 54 + ProfileBuilder::new() 55 + } 56 + } 57 + 58 + impl<'a> ProfileBuilder<'a, profile_state::Empty> { 59 + /// Create a new builder with all fields unset 60 + pub fn new() -> Self { 61 + ProfileBuilder { 62 + _phantom_state: ::core::marker::PhantomData, 63 + __unsafe_private_named: (None, None), 64 + _phantom: ::core::marker::PhantomData, 65 + } 66 + } 67 + } 68 + 69 + impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 70 + /// Set the `createdAt` field (optional) 71 + pub fn created_at( 72 + mut self, 73 + value: impl Into<Option<jacquard_common::types::string::Datetime>>, 74 + ) -> Self { 75 + self.__unsafe_private_named.0 = value.into(); 76 + self 77 + } 78 + /// Set the `createdAt` field to an Option value (optional) 79 + pub fn maybe_created_at( 80 + mut self, 81 + value: Option<jacquard_common::types::string::Datetime>, 82 + ) -> Self { 83 + self.__unsafe_private_named.0 = value; 84 + self 85 + } 86 + } 87 + 88 + impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 89 + /// Set the `displayName` field (optional) 90 + pub fn display_name(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 91 + self.__unsafe_private_named.1 = value.into(); 92 + self 93 + } 94 + /// Set the `displayName` field to an Option value (optional) 95 + pub fn maybe_display_name(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 96 + self.__unsafe_private_named.1 = value; 97 + self 98 + } 99 + } 100 + 101 + impl<'a, S> ProfileBuilder<'a, S> 102 + where 103 + S: profile_state::State, 104 + { 105 + /// Build the final struct 106 + pub fn build(self) -> Profile<'a> { 107 + Profile { 108 + created_at: self.__unsafe_private_named.0, 109 + display_name: self.__unsafe_private_named.1, 110 + extra_data: Default::default(), 111 + } 112 + } 113 + /// Build the final struct with custom extra_data 114 + pub fn build_with_data( 115 + self, 116 + extra_data: std::collections::BTreeMap< 117 + jacquard_common::smol_str::SmolStr, 118 + jacquard_common::types::value::Data<'a>, 119 + >, 120 + ) -> Profile<'a> { 121 + Profile { 122 + created_at: self.__unsafe_private_named.0, 123 + display_name: self.__unsafe_private_named.1, 124 + extra_data: Some(extra_data), 125 + } 126 + } 127 + } 128 + 129 + impl<'a> Profile<'a> { 130 + pub fn uri( 131 + uri: impl Into<jacquard_common::CowStr<'a>>, 132 + ) -> Result< 133 + jacquard_common::types::uri::RecordUri<'a, ProfileRecord>, 134 + jacquard_common::types::uri::UriError, 135 + > { 136 + jacquard_common::types::uri::RecordUri::try_from_uri( 137 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 138 + ) 139 + } 140 + } 141 + 142 + /// Typed wrapper for GetRecord response with this collection's record type. 143 + #[derive( 144 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 145 + )] 146 + #[serde(rename_all = "camelCase")] 147 + pub struct ProfileGetRecordOutput<'a> { 148 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 149 + #[serde(borrow)] 150 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 151 + #[serde(borrow)] 152 + pub uri: jacquard_common::types::string::AtUri<'a>, 153 + #[serde(borrow)] 154 + pub value: Profile<'a>, 155 + } 156 + 157 + impl From<ProfileGetRecordOutput<'_>> for Profile<'_> { 158 + fn from(output: ProfileGetRecordOutput<'_>) -> Self { 159 + use jacquard_common::IntoStatic; 160 + output.value.into_static() 161 + } 162 + } 163 + 164 + impl jacquard_common::types::collection::Collection for Profile<'_> { 165 + const NSID: &'static str = "fyi.questionable.actor.profile"; 166 + type Record = ProfileRecord; 167 + } 168 + 169 + /// Marker type for deserializing records from this collection. 170 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 171 + pub struct ProfileRecord; 172 + impl jacquard_common::xrpc::XrpcResp for ProfileRecord { 173 + const NSID: &'static str = "fyi.questionable.actor.profile"; 174 + const ENCODING: &'static str = "application/json"; 175 + type Output<'de> = ProfileGetRecordOutput<'de>; 176 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 177 + } 178 + 179 + impl jacquard_common::types::collection::Collection for ProfileRecord { 180 + const NSID: &'static str = "fyi.questionable.actor.profile"; 181 + type Record = ProfileRecord; 182 + } 183 + 184 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Profile<'a> { 185 + fn nsid() -> &'static str { 186 + "fyi.questionable.actor.profile" 187 + } 188 + fn def_name() -> &'static str { 189 + "main" 190 + } 191 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 192 + lexicon_doc_fyi_questionable_actor_profile() 193 + } 194 + fn validate( 195 + &self, 196 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 197 + if let Some(ref value) = self.display_name { 198 + #[allow(unused_comparisons)] 199 + if <str>::len(value.as_ref()) > 640usize { 200 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 201 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 202 + "display_name", 203 + ), 204 + max: 640usize, 205 + actual: <str>::len(value.as_ref()), 206 + }); 207 + } 208 + } 209 + if let Some(ref value) = self.display_name { 210 + { 211 + let count = 212 + ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 213 + .count(); 214 + if count > 64usize { 215 + return Err( 216 + ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 217 + path: ::jacquard_lexicon::validation::ValidationPath::from_field( 218 + "display_name", 219 + ), 220 + max: 64usize, 221 + actual: count, 222 + }, 223 + ); 224 + } 225 + } 226 + } 227 + Ok(()) 228 + } 229 + } 230 + 231 + fn lexicon_doc_fyi_questionable_actor_profile() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> 232 + { 233 + ::jacquard_lexicon::lexicon::LexiconDoc { 234 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 235 + id: ::jacquard_common::CowStr::new_static("fyi.questionable.actor.profile"), 236 + revision: None, 237 + description: None, 238 + defs: { 239 + let mut map = ::std::collections::BTreeMap::new(); 240 + map.insert( 241 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 242 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 243 + description: Some( 244 + ::jacquard_common::CowStr::new_static( 245 + "A declaration of a Questionable account profile.", 246 + ), 247 + ), 248 + key: Some(::jacquard_common::CowStr::new_static("literal:self")), 249 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 250 + description: None, 251 + required: None, 252 + nullable: None, 253 + properties: { 254 + #[allow(unused_mut)] 255 + let mut map = ::std::collections::BTreeMap::new(); 256 + map.insert( 257 + ::jacquard_common::smol_str::SmolStr::new_static( 258 + "createdAt", 259 + ), 260 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 261 + description: None, 262 + format: Some( 263 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 264 + ), 265 + default: None, 266 + min_length: None, 267 + max_length: None, 268 + min_graphemes: None, 269 + max_graphemes: None, 270 + r#enum: None, 271 + r#const: None, 272 + known_values: None, 273 + }), 274 + ); 275 + map.insert( 276 + ::jacquard_common::smol_str::SmolStr::new_static( 277 + "displayName", 278 + ), 279 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 280 + description: None, 281 + format: None, 282 + default: None, 283 + min_length: None, 284 + max_length: Some(640usize), 285 + min_graphemes: None, 286 + max_graphemes: Some(64usize), 287 + r#enum: None, 288 + r#const: None, 289 + known_values: None, 290 + }), 291 + ); 292 + map 293 + }, 294 + }), 295 + }), 296 + ); 297 + map 298 + }, 299 + } 300 + }
+6
crates/jacquard-api/src/games_firehose.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 barklesheep;
+7
crates/jacquard-api/src/games_firehose/barklesheep.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 place_sheeps; 7 + pub mod reaction;
+545
crates/jacquard-api/src/games_firehose/barklesheep/place_sheeps.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: games.firehose.barklesheep.placeSheeps 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, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 11 + )] 12 + #[serde(rename_all = "camelCase")] 13 + pub struct PlaceSheeps<'a> { 14 + #[serde(borrow)] 15 + pub game_id: jacquard_common::CowStr<'a>, 16 + #[serde(borrow)] 17 + pub sheeps: Vec<crate::games_firehose::barklesheep::place_sheeps::SheepPlacement<'a>>, 18 + } 19 + 20 + pub mod place_sheeps_state { 21 + 22 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 23 + #[allow(unused)] 24 + use ::core::marker::PhantomData; 25 + mod sealed { 26 + pub trait Sealed {} 27 + } 28 + /// State trait tracking which required fields have been set 29 + pub trait State: sealed::Sealed { 30 + type Sheeps; 31 + type GameId; 32 + } 33 + /// Empty state - all required fields are unset 34 + pub struct Empty(()); 35 + impl sealed::Sealed for Empty {} 36 + impl State for Empty { 37 + type Sheeps = Unset; 38 + type GameId = Unset; 39 + } 40 + ///State transition - sets the `sheeps` field to Set 41 + pub struct SetSheeps<S: State = Empty>(PhantomData<fn() -> S>); 42 + impl<S: State> sealed::Sealed for SetSheeps<S> {} 43 + impl<S: State> State for SetSheeps<S> { 44 + type Sheeps = Set<members::sheeps>; 45 + type GameId = S::GameId; 46 + } 47 + ///State transition - sets the `game_id` field to Set 48 + pub struct SetGameId<S: State = Empty>(PhantomData<fn() -> S>); 49 + impl<S: State> sealed::Sealed for SetGameId<S> {} 50 + impl<S: State> State for SetGameId<S> { 51 + type Sheeps = S::Sheeps; 52 + type GameId = Set<members::game_id>; 53 + } 54 + /// Marker types for field names 55 + #[allow(non_camel_case_types)] 56 + pub mod members { 57 + ///Marker type for the `sheeps` field 58 + pub struct sheeps(()); 59 + ///Marker type for the `game_id` field 60 + pub struct game_id(()); 61 + } 62 + } 63 + 64 + /// Builder for constructing an instance of this type 65 + pub struct PlaceSheepsBuilder<'a, S: place_sheeps_state::State> { 66 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 67 + __unsafe_private_named: ( 68 + ::core::option::Option<jacquard_common::CowStr<'a>>, 69 + ::core::option::Option< 70 + Vec<crate::games_firehose::barklesheep::place_sheeps::SheepPlacement<'a>>, 71 + >, 72 + ), 73 + _phantom: ::core::marker::PhantomData<&'a ()>, 74 + } 75 + 76 + impl<'a> PlaceSheeps<'a> { 77 + /// Create a new builder for this type 78 + pub fn new() -> PlaceSheepsBuilder<'a, place_sheeps_state::Empty> { 79 + PlaceSheepsBuilder::new() 80 + } 81 + } 82 + 83 + impl<'a> PlaceSheepsBuilder<'a, place_sheeps_state::Empty> { 84 + /// Create a new builder with all fields unset 85 + pub fn new() -> Self { 86 + PlaceSheepsBuilder { 87 + _phantom_state: ::core::marker::PhantomData, 88 + __unsafe_private_named: (None, None), 89 + _phantom: ::core::marker::PhantomData, 90 + } 91 + } 92 + } 93 + 94 + impl<'a, S> PlaceSheepsBuilder<'a, S> 95 + where 96 + S: place_sheeps_state::State, 97 + S::GameId: place_sheeps_state::IsUnset, 98 + { 99 + /// Set the `gameId` field (required) 100 + pub fn game_id( 101 + mut self, 102 + value: impl Into<jacquard_common::CowStr<'a>>, 103 + ) -> PlaceSheepsBuilder<'a, place_sheeps_state::SetGameId<S>> { 104 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 105 + PlaceSheepsBuilder { 106 + _phantom_state: ::core::marker::PhantomData, 107 + __unsafe_private_named: self.__unsafe_private_named, 108 + _phantom: ::core::marker::PhantomData, 109 + } 110 + } 111 + } 112 + 113 + impl<'a, S> PlaceSheepsBuilder<'a, S> 114 + where 115 + S: place_sheeps_state::State, 116 + S::Sheeps: place_sheeps_state::IsUnset, 117 + { 118 + /// Set the `sheeps` field (required) 119 + pub fn sheeps( 120 + mut self, 121 + value: impl Into<Vec<crate::games_firehose::barklesheep::place_sheeps::SheepPlacement<'a>>>, 122 + ) -> PlaceSheepsBuilder<'a, place_sheeps_state::SetSheeps<S>> { 123 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 124 + PlaceSheepsBuilder { 125 + _phantom_state: ::core::marker::PhantomData, 126 + __unsafe_private_named: self.__unsafe_private_named, 127 + _phantom: ::core::marker::PhantomData, 128 + } 129 + } 130 + } 131 + 132 + impl<'a, S> PlaceSheepsBuilder<'a, S> 133 + where 134 + S: place_sheeps_state::State, 135 + S::Sheeps: place_sheeps_state::IsSet, 136 + S::GameId: place_sheeps_state::IsSet, 137 + { 138 + /// Build the final struct 139 + pub fn build(self) -> PlaceSheeps<'a> { 140 + PlaceSheeps { 141 + game_id: self.__unsafe_private_named.0.unwrap(), 142 + sheeps: self.__unsafe_private_named.1.unwrap(), 143 + extra_data: Default::default(), 144 + } 145 + } 146 + /// Build the final struct with custom extra_data 147 + pub fn build_with_data( 148 + self, 149 + extra_data: std::collections::BTreeMap< 150 + jacquard_common::smol_str::SmolStr, 151 + jacquard_common::types::value::Data<'a>, 152 + >, 153 + ) -> PlaceSheeps<'a> { 154 + PlaceSheeps { 155 + game_id: self.__unsafe_private_named.0.unwrap(), 156 + sheeps: self.__unsafe_private_named.1.unwrap(), 157 + extra_data: Some(extra_data), 158 + } 159 + } 160 + } 161 + 162 + #[jacquard_derive::lexicon] 163 + #[derive( 164 + serde::Serialize, 165 + serde::Deserialize, 166 + Debug, 167 + Clone, 168 + PartialEq, 169 + Eq, 170 + jacquard_derive::IntoStatic, 171 + Default, 172 + )] 173 + #[serde(rename_all = "camelCase")] 174 + pub struct PlaceSheepsOutput<'a> { 175 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 176 + pub success: std::option::Option<bool>, 177 + } 178 + 179 + /// Response type for 180 + ///games.firehose.barklesheep.placeSheeps 181 + pub struct PlaceSheepsResponse; 182 + impl jacquard_common::xrpc::XrpcResp for PlaceSheepsResponse { 183 + const NSID: &'static str = "games.firehose.barklesheep.placeSheeps"; 184 + const ENCODING: &'static str = "application/json"; 185 + type Output<'de> = PlaceSheepsOutput<'de>; 186 + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 187 + } 188 + 189 + impl<'a> jacquard_common::xrpc::XrpcRequest for PlaceSheeps<'a> { 190 + const NSID: &'static str = "games.firehose.barklesheep.placeSheeps"; 191 + const METHOD: jacquard_common::xrpc::XrpcMethod = 192 + jacquard_common::xrpc::XrpcMethod::Procedure("application/json"); 193 + type Response = PlaceSheepsResponse; 194 + } 195 + 196 + /// Endpoint type for 197 + ///games.firehose.barklesheep.placeSheeps 198 + pub struct PlaceSheepsRequest; 199 + impl jacquard_common::xrpc::XrpcEndpoint for PlaceSheepsRequest { 200 + const PATH: &'static str = "/xrpc/games.firehose.barklesheep.placeSheeps"; 201 + const METHOD: jacquard_common::xrpc::XrpcMethod = 202 + jacquard_common::xrpc::XrpcMethod::Procedure("application/json"); 203 + type Request<'de> = PlaceSheeps<'de>; 204 + type Response = PlaceSheepsResponse; 205 + } 206 + 207 + #[jacquard_derive::lexicon] 208 + #[derive( 209 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 210 + )] 211 + #[serde(rename_all = "camelCase")] 212 + pub struct SheepPlacement<'a> { 213 + pub horizontal: bool, 214 + pub start: i64, 215 + #[serde(borrow)] 216 + pub r#type: jacquard_common::CowStr<'a>, 217 + } 218 + 219 + pub mod sheep_placement_state { 220 + 221 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 222 + #[allow(unused)] 223 + use ::core::marker::PhantomData; 224 + mod sealed { 225 + pub trait Sealed {} 226 + } 227 + /// State trait tracking which required fields have been set 228 + pub trait State: sealed::Sealed { 229 + type Horizontal; 230 + type Start; 231 + type Type; 232 + } 233 + /// Empty state - all required fields are unset 234 + pub struct Empty(()); 235 + impl sealed::Sealed for Empty {} 236 + impl State for Empty { 237 + type Horizontal = Unset; 238 + type Start = Unset; 239 + type Type = Unset; 240 + } 241 + ///State transition - sets the `horizontal` field to Set 242 + pub struct SetHorizontal<S: State = Empty>(PhantomData<fn() -> S>); 243 + impl<S: State> sealed::Sealed for SetHorizontal<S> {} 244 + impl<S: State> State for SetHorizontal<S> { 245 + type Horizontal = Set<members::horizontal>; 246 + type Start = S::Start; 247 + type Type = S::Type; 248 + } 249 + ///State transition - sets the `start` field to Set 250 + pub struct SetStart<S: State = Empty>(PhantomData<fn() -> S>); 251 + impl<S: State> sealed::Sealed for SetStart<S> {} 252 + impl<S: State> State for SetStart<S> { 253 + type Horizontal = S::Horizontal; 254 + type Start = Set<members::start>; 255 + type Type = S::Type; 256 + } 257 + ///State transition - sets the `type` field to Set 258 + pub struct SetType<S: State = Empty>(PhantomData<fn() -> S>); 259 + impl<S: State> sealed::Sealed for SetType<S> {} 260 + impl<S: State> State for SetType<S> { 261 + type Horizontal = S::Horizontal; 262 + type Start = S::Start; 263 + type Type = Set<members::r#type>; 264 + } 265 + /// Marker types for field names 266 + #[allow(non_camel_case_types)] 267 + pub mod members { 268 + ///Marker type for the `horizontal` field 269 + pub struct horizontal(()); 270 + ///Marker type for the `start` field 271 + pub struct start(()); 272 + ///Marker type for the `type` field 273 + pub struct r#type(()); 274 + } 275 + } 276 + 277 + /// Builder for constructing an instance of this type 278 + pub struct SheepPlacementBuilder<'a, S: sheep_placement_state::State> { 279 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 280 + __unsafe_private_named: ( 281 + ::core::option::Option<bool>, 282 + ::core::option::Option<i64>, 283 + ::core::option::Option<jacquard_common::CowStr<'a>>, 284 + ), 285 + _phantom: ::core::marker::PhantomData<&'a ()>, 286 + } 287 + 288 + impl<'a> SheepPlacement<'a> { 289 + /// Create a new builder for this type 290 + pub fn new() -> SheepPlacementBuilder<'a, sheep_placement_state::Empty> { 291 + SheepPlacementBuilder::new() 292 + } 293 + } 294 + 295 + impl<'a> SheepPlacementBuilder<'a, sheep_placement_state::Empty> { 296 + /// Create a new builder with all fields unset 297 + pub fn new() -> Self { 298 + SheepPlacementBuilder { 299 + _phantom_state: ::core::marker::PhantomData, 300 + __unsafe_private_named: (None, None, None), 301 + _phantom: ::core::marker::PhantomData, 302 + } 303 + } 304 + } 305 + 306 + impl<'a, S> SheepPlacementBuilder<'a, S> 307 + where 308 + S: sheep_placement_state::State, 309 + S::Horizontal: sheep_placement_state::IsUnset, 310 + { 311 + /// Set the `horizontal` field (required) 312 + pub fn horizontal( 313 + mut self, 314 + value: impl Into<bool>, 315 + ) -> SheepPlacementBuilder<'a, sheep_placement_state::SetHorizontal<S>> { 316 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 317 + SheepPlacementBuilder { 318 + _phantom_state: ::core::marker::PhantomData, 319 + __unsafe_private_named: self.__unsafe_private_named, 320 + _phantom: ::core::marker::PhantomData, 321 + } 322 + } 323 + } 324 + 325 + impl<'a, S> SheepPlacementBuilder<'a, S> 326 + where 327 + S: sheep_placement_state::State, 328 + S::Start: sheep_placement_state::IsUnset, 329 + { 330 + /// Set the `start` field (required) 331 + pub fn start( 332 + mut self, 333 + value: impl Into<i64>, 334 + ) -> SheepPlacementBuilder<'a, sheep_placement_state::SetStart<S>> { 335 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 336 + SheepPlacementBuilder { 337 + _phantom_state: ::core::marker::PhantomData, 338 + __unsafe_private_named: self.__unsafe_private_named, 339 + _phantom: ::core::marker::PhantomData, 340 + } 341 + } 342 + } 343 + 344 + impl<'a, S> SheepPlacementBuilder<'a, S> 345 + where 346 + S: sheep_placement_state::State, 347 + S::Type: sheep_placement_state::IsUnset, 348 + { 349 + /// Set the `type` field (required) 350 + pub fn r#type( 351 + mut self, 352 + value: impl Into<jacquard_common::CowStr<'a>>, 353 + ) -> SheepPlacementBuilder<'a, sheep_placement_state::SetType<S>> { 354 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 355 + SheepPlacementBuilder { 356 + _phantom_state: ::core::marker::PhantomData, 357 + __unsafe_private_named: self.__unsafe_private_named, 358 + _phantom: ::core::marker::PhantomData, 359 + } 360 + } 361 + } 362 + 363 + impl<'a, S> SheepPlacementBuilder<'a, S> 364 + where 365 + S: sheep_placement_state::State, 366 + S::Horizontal: sheep_placement_state::IsSet, 367 + S::Start: sheep_placement_state::IsSet, 368 + S::Type: sheep_placement_state::IsSet, 369 + { 370 + /// Build the final struct 371 + pub fn build(self) -> SheepPlacement<'a> { 372 + SheepPlacement { 373 + horizontal: self.__unsafe_private_named.0.unwrap(), 374 + start: self.__unsafe_private_named.1.unwrap(), 375 + r#type: self.__unsafe_private_named.2.unwrap(), 376 + extra_data: Default::default(), 377 + } 378 + } 379 + /// Build the final struct with custom extra_data 380 + pub fn build_with_data( 381 + self, 382 + extra_data: std::collections::BTreeMap< 383 + jacquard_common::smol_str::SmolStr, 384 + jacquard_common::types::value::Data<'a>, 385 + >, 386 + ) -> SheepPlacement<'a> { 387 + SheepPlacement { 388 + horizontal: self.__unsafe_private_named.0.unwrap(), 389 + start: self.__unsafe_private_named.1.unwrap(), 390 + r#type: self.__unsafe_private_named.2.unwrap(), 391 + extra_data: Some(extra_data), 392 + } 393 + } 394 + } 395 + 396 + fn lexicon_doc_games_firehose_barklesheep_placeSheeps() 397 + -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 398 + ::jacquard_lexicon::lexicon::LexiconDoc { 399 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 400 + id: ::jacquard_common::CowStr::new_static("games.firehose.barklesheep.placeSheeps"), 401 + revision: None, 402 + description: None, 403 + defs: { 404 + let mut map = ::std::collections::BTreeMap::new(); 405 + map.insert( 406 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 407 + ::jacquard_lexicon::lexicon::LexUserType::XrpcProcedure(::jacquard_lexicon::lexicon::LexXrpcProcedure { 408 + description: None, 409 + parameters: None, 410 + input: Some(::jacquard_lexicon::lexicon::LexXrpcBody { 411 + description: None, 412 + encoding: ::jacquard_common::CowStr::new_static( 413 + "application/json", 414 + ), 415 + schema: Some( 416 + ::jacquard_lexicon::lexicon::LexXrpcBodySchema::Object(::jacquard_lexicon::lexicon::LexObject { 417 + description: None, 418 + required: Some( 419 + vec![ 420 + ::jacquard_common::smol_str::SmolStr::new_static("gameId"), 421 + ::jacquard_common::smol_str::SmolStr::new_static("sheeps") 422 + ], 423 + ), 424 + nullable: None, 425 + properties: { 426 + #[allow(unused_mut)] 427 + let mut map = ::std::collections::BTreeMap::new(); 428 + map.insert( 429 + ::jacquard_common::smol_str::SmolStr::new_static("gameId"), 430 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 431 + description: None, 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("sheeps"), 445 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 446 + description: None, 447 + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 448 + description: None, 449 + r#ref: ::jacquard_common::CowStr::new_static( 450 + "#sheepPlacement", 451 + ), 452 + }), 453 + min_length: None, 454 + max_length: None, 455 + }), 456 + ); 457 + map 458 + }, 459 + }), 460 + ), 461 + }), 462 + output: None, 463 + errors: None, 464 + }), 465 + ); 466 + map.insert( 467 + ::jacquard_common::smol_str::SmolStr::new_static("sheepPlacement"), 468 + ::jacquard_lexicon::lexicon::LexUserType::Object( 469 + ::jacquard_lexicon::lexicon::LexObject { 470 + description: None, 471 + required: Some(vec![ 472 + ::jacquard_common::smol_str::SmolStr::new_static("type"), 473 + ::jacquard_common::smol_str::SmolStr::new_static("start"), 474 + ::jacquard_common::smol_str::SmolStr::new_static("horizontal"), 475 + ]), 476 + nullable: None, 477 + properties: { 478 + #[allow(unused_mut)] 479 + let mut map = ::std::collections::BTreeMap::new(); 480 + map.insert( 481 + ::jacquard_common::smol_str::SmolStr::new_static("horizontal"), 482 + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean( 483 + ::jacquard_lexicon::lexicon::LexBoolean { 484 + description: None, 485 + default: None, 486 + r#const: None, 487 + }, 488 + ), 489 + ); 490 + map.insert( 491 + ::jacquard_common::smol_str::SmolStr::new_static("start"), 492 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( 493 + ::jacquard_lexicon::lexicon::LexInteger { 494 + description: None, 495 + default: None, 496 + minimum: None, 497 + maximum: None, 498 + r#enum: None, 499 + r#const: None, 500 + }, 501 + ), 502 + ); 503 + map.insert( 504 + ::jacquard_common::smol_str::SmolStr::new_static("type"), 505 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 506 + ::jacquard_lexicon::lexicon::LexString { 507 + description: None, 508 + format: None, 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 + ); 520 + map 521 + }, 522 + }, 523 + ), 524 + ); 525 + map 526 + }, 527 + } 528 + } 529 + 530 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SheepPlacement<'a> { 531 + fn nsid() -> &'static str { 532 + "games.firehose.barklesheep.placeSheeps" 533 + } 534 + fn def_name() -> &'static str { 535 + "sheepPlacement" 536 + } 537 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 538 + lexicon_doc_games_firehose_barklesheep_placeSheeps() 539 + } 540 + fn validate( 541 + &self, 542 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 543 + Ok(()) 544 + } 545 + }
+370
crates/jacquard-api/src/games_firehose/barklesheep/reaction.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: games.firehose.barklesheep.reaction 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// A reaction in a Barklesheep game 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct Reaction<'a> { 15 + pub created_at: jacquard_common::types::string::Datetime, 16 + #[serde(borrow)] 17 + pub emoji: jacquard_common::CowStr<'a>, 18 + #[serde(borrow)] 19 + pub game_id: jacquard_common::CowStr<'a>, 20 + } 21 + 22 + pub mod reaction_state { 23 + 24 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 25 + #[allow(unused)] 26 + use ::core::marker::PhantomData; 27 + mod sealed { 28 + pub trait Sealed {} 29 + } 30 + /// State trait tracking which required fields have been set 31 + pub trait State: sealed::Sealed { 32 + type Emoji; 33 + type GameId; 34 + type CreatedAt; 35 + } 36 + /// Empty state - all required fields are unset 37 + pub struct Empty(()); 38 + impl sealed::Sealed for Empty {} 39 + impl State for Empty { 40 + type Emoji = Unset; 41 + type GameId = Unset; 42 + type CreatedAt = Unset; 43 + } 44 + ///State transition - sets the `emoji` field to Set 45 + pub struct SetEmoji<S: State = Empty>(PhantomData<fn() -> S>); 46 + impl<S: State> sealed::Sealed for SetEmoji<S> {} 47 + impl<S: State> State for SetEmoji<S> { 48 + type Emoji = Set<members::emoji>; 49 + type GameId = S::GameId; 50 + type CreatedAt = S::CreatedAt; 51 + } 52 + ///State transition - sets the `game_id` field to Set 53 + pub struct SetGameId<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetGameId<S> {} 55 + impl<S: State> State for SetGameId<S> { 56 + type Emoji = S::Emoji; 57 + type GameId = Set<members::game_id>; 58 + type CreatedAt = S::CreatedAt; 59 + } 60 + ///State transition - sets the `created_at` field to Set 61 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 62 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 63 + impl<S: State> State for SetCreatedAt<S> { 64 + type Emoji = S::Emoji; 65 + type GameId = S::GameId; 66 + type CreatedAt = Set<members::created_at>; 67 + } 68 + /// Marker types for field names 69 + #[allow(non_camel_case_types)] 70 + pub mod members { 71 + ///Marker type for the `emoji` field 72 + pub struct emoji(()); 73 + ///Marker type for the `game_id` field 74 + pub struct game_id(()); 75 + ///Marker type for the `created_at` field 76 + pub struct created_at(()); 77 + } 78 + } 79 + 80 + /// Builder for constructing an instance of this type 81 + pub struct ReactionBuilder<'a, S: reaction_state::State> { 82 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 83 + __unsafe_private_named: ( 84 + ::core::option::Option<jacquard_common::types::string::Datetime>, 85 + ::core::option::Option<jacquard_common::CowStr<'a>>, 86 + ::core::option::Option<jacquard_common::CowStr<'a>>, 87 + ), 88 + _phantom: ::core::marker::PhantomData<&'a ()>, 89 + } 90 + 91 + impl<'a> Reaction<'a> { 92 + /// Create a new builder for this type 93 + pub fn new() -> ReactionBuilder<'a, reaction_state::Empty> { 94 + ReactionBuilder::new() 95 + } 96 + } 97 + 98 + impl<'a> ReactionBuilder<'a, reaction_state::Empty> { 99 + /// Create a new builder with all fields unset 100 + pub fn new() -> Self { 101 + ReactionBuilder { 102 + _phantom_state: ::core::marker::PhantomData, 103 + __unsafe_private_named: (None, None, None), 104 + _phantom: ::core::marker::PhantomData, 105 + } 106 + } 107 + } 108 + 109 + impl<'a, S> ReactionBuilder<'a, S> 110 + where 111 + S: reaction_state::State, 112 + S::CreatedAt: reaction_state::IsUnset, 113 + { 114 + /// Set the `createdAt` field (required) 115 + pub fn created_at( 116 + mut self, 117 + value: impl Into<jacquard_common::types::string::Datetime>, 118 + ) -> ReactionBuilder<'a, reaction_state::SetCreatedAt<S>> { 119 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 120 + ReactionBuilder { 121 + _phantom_state: ::core::marker::PhantomData, 122 + __unsafe_private_named: self.__unsafe_private_named, 123 + _phantom: ::core::marker::PhantomData, 124 + } 125 + } 126 + } 127 + 128 + impl<'a, S> ReactionBuilder<'a, S> 129 + where 130 + S: reaction_state::State, 131 + S::Emoji: reaction_state::IsUnset, 132 + { 133 + /// Set the `emoji` field (required) 134 + pub fn emoji( 135 + mut self, 136 + value: impl Into<jacquard_common::CowStr<'a>>, 137 + ) -> ReactionBuilder<'a, reaction_state::SetEmoji<S>> { 138 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 139 + ReactionBuilder { 140 + _phantom_state: ::core::marker::PhantomData, 141 + __unsafe_private_named: self.__unsafe_private_named, 142 + _phantom: ::core::marker::PhantomData, 143 + } 144 + } 145 + } 146 + 147 + impl<'a, S> ReactionBuilder<'a, S> 148 + where 149 + S: reaction_state::State, 150 + S::GameId: reaction_state::IsUnset, 151 + { 152 + /// Set the `gameId` field (required) 153 + pub fn game_id( 154 + mut self, 155 + value: impl Into<jacquard_common::CowStr<'a>>, 156 + ) -> ReactionBuilder<'a, reaction_state::SetGameId<S>> { 157 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 158 + ReactionBuilder { 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> ReactionBuilder<'a, S> 167 + where 168 + S: reaction_state::State, 169 + S::Emoji: reaction_state::IsSet, 170 + S::GameId: reaction_state::IsSet, 171 + S::CreatedAt: reaction_state::IsSet, 172 + { 173 + /// Build the final struct 174 + pub fn build(self) -> Reaction<'a> { 175 + Reaction { 176 + created_at: self.__unsafe_private_named.0.unwrap(), 177 + emoji: self.__unsafe_private_named.1.unwrap(), 178 + game_id: self.__unsafe_private_named.2.unwrap(), 179 + extra_data: Default::default(), 180 + } 181 + } 182 + /// Build the final struct with custom extra_data 183 + pub fn build_with_data( 184 + self, 185 + extra_data: std::collections::BTreeMap< 186 + jacquard_common::smol_str::SmolStr, 187 + jacquard_common::types::value::Data<'a>, 188 + >, 189 + ) -> Reaction<'a> { 190 + Reaction { 191 + created_at: self.__unsafe_private_named.0.unwrap(), 192 + emoji: self.__unsafe_private_named.1.unwrap(), 193 + game_id: self.__unsafe_private_named.2.unwrap(), 194 + extra_data: Some(extra_data), 195 + } 196 + } 197 + } 198 + 199 + impl<'a> Reaction<'a> { 200 + pub fn uri( 201 + uri: impl Into<jacquard_common::CowStr<'a>>, 202 + ) -> Result< 203 + jacquard_common::types::uri::RecordUri<'a, ReactionRecord>, 204 + jacquard_common::types::uri::UriError, 205 + > { 206 + jacquard_common::types::uri::RecordUri::try_from_uri( 207 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 208 + ) 209 + } 210 + } 211 + 212 + /// Typed wrapper for GetRecord response with this collection's record type. 213 + #[derive( 214 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 215 + )] 216 + #[serde(rename_all = "camelCase")] 217 + pub struct ReactionGetRecordOutput<'a> { 218 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 219 + #[serde(borrow)] 220 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 221 + #[serde(borrow)] 222 + pub uri: jacquard_common::types::string::AtUri<'a>, 223 + #[serde(borrow)] 224 + pub value: Reaction<'a>, 225 + } 226 + 227 + impl From<ReactionGetRecordOutput<'_>> for Reaction<'_> { 228 + fn from(output: ReactionGetRecordOutput<'_>) -> Self { 229 + use jacquard_common::IntoStatic; 230 + output.value.into_static() 231 + } 232 + } 233 + 234 + impl jacquard_common::types::collection::Collection for Reaction<'_> { 235 + const NSID: &'static str = "games.firehose.barklesheep.reaction"; 236 + type Record = ReactionRecord; 237 + } 238 + 239 + /// Marker type for deserializing records from this collection. 240 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 241 + pub struct ReactionRecord; 242 + impl jacquard_common::xrpc::XrpcResp for ReactionRecord { 243 + const NSID: &'static str = "games.firehose.barklesheep.reaction"; 244 + const ENCODING: &'static str = "application/json"; 245 + type Output<'de> = ReactionGetRecordOutput<'de>; 246 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 247 + } 248 + 249 + impl jacquard_common::types::collection::Collection for ReactionRecord { 250 + const NSID: &'static str = "games.firehose.barklesheep.reaction"; 251 + type Record = ReactionRecord; 252 + } 253 + 254 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Reaction<'a> { 255 + fn nsid() -> &'static str { 256 + "games.firehose.barklesheep.reaction" 257 + } 258 + fn def_name() -> &'static str { 259 + "main" 260 + } 261 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 262 + lexicon_doc_games_firehose_barklesheep_reaction() 263 + } 264 + fn validate( 265 + &self, 266 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 267 + { 268 + let value = &self.emoji; 269 + #[allow(unused_comparisons)] 270 + if <str>::len(value.as_ref()) > 4usize { 271 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 272 + path: ::jacquard_lexicon::validation::ValidationPath::from_field("emoji"), 273 + max: 4usize, 274 + actual: <str>::len(value.as_ref()), 275 + }); 276 + } 277 + } 278 + Ok(()) 279 + } 280 + } 281 + 282 + fn lexicon_doc_games_firehose_barklesheep_reaction() 283 + -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 284 + ::jacquard_lexicon::lexicon::LexiconDoc { 285 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 286 + id: ::jacquard_common::CowStr::new_static("games.firehose.barklesheep.reaction"), 287 + revision: None, 288 + description: None, 289 + defs: { 290 + let mut map = ::std::collections::BTreeMap::new(); 291 + map.insert( 292 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 293 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 294 + description: Some( 295 + ::jacquard_common::CowStr::new_static( 296 + "A reaction in a Barklesheep game", 297 + ), 298 + ), 299 + key: Some(::jacquard_common::CowStr::new_static("tid")), 300 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 301 + description: None, 302 + required: Some( 303 + vec![ 304 + ::jacquard_common::smol_str::SmolStr::new_static("gameId"), 305 + ::jacquard_common::smol_str::SmolStr::new_static("emoji"), 306 + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") 307 + ], 308 + ), 309 + nullable: None, 310 + properties: { 311 + #[allow(unused_mut)] 312 + let mut map = ::std::collections::BTreeMap::new(); 313 + map.insert( 314 + ::jacquard_common::smol_str::SmolStr::new_static( 315 + "createdAt", 316 + ), 317 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 318 + description: None, 319 + format: Some( 320 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 321 + ), 322 + default: None, 323 + min_length: None, 324 + max_length: None, 325 + min_graphemes: None, 326 + max_graphemes: None, 327 + r#enum: None, 328 + r#const: None, 329 + known_values: None, 330 + }), 331 + ); 332 + map.insert( 333 + ::jacquard_common::smol_str::SmolStr::new_static("emoji"), 334 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 335 + description: None, 336 + format: None, 337 + default: None, 338 + min_length: None, 339 + max_length: Some(4usize), 340 + min_graphemes: None, 341 + max_graphemes: None, 342 + r#enum: None, 343 + r#const: None, 344 + known_values: None, 345 + }), 346 + ); 347 + map.insert( 348 + ::jacquard_common::smol_str::SmolStr::new_static("gameId"), 349 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 350 + description: None, 351 + format: None, 352 + default: None, 353 + min_length: None, 354 + max_length: None, 355 + min_graphemes: None, 356 + max_graphemes: None, 357 + r#enum: None, 358 + r#const: None, 359 + known_values: None, 360 + }), 361 + ); 362 + map 363 + }, 364 + }), 365 + }), 366 + ); 367 + map 368 + }, 369 + } 370 + }
+9
crates/jacquard-api/src/io_atcr.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 hold; 7 + pub mod manifest; 8 + pub mod sailor; 9 + pub mod tag;
+8
crates/jacquard-api/src/io_atcr/hold.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 captain; 7 + pub mod crew; 8 + pub mod layer;
+549
crates/jacquard-api/src/io_atcr/hold/captain.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: io.atcr.hold.captain 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// Represents the hold's ownership and metadata. Stored as a singleton record at rkey 'self' in the hold's embedded PDS. 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct Captain<'a> { 15 + /// Allow any authenticated user to register as crew 16 + pub allow_all_crew: bool, 17 + /// RFC3339 timestamp of when the hold was deployed 18 + pub deployed_at: jacquard_common::types::string::Datetime, 19 + /// Enable Bluesky posts when manifests are pushed 20 + pub enable_bluesky_posts: bool, 21 + /// DID of the hold owner 22 + #[serde(borrow)] 23 + pub owner: jacquard_common::types::string::Did<'a>, 24 + /// Deployment provider (e.g., fly.io, aws, etc.) 25 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 26 + #[serde(borrow)] 27 + pub provider: std::option::Option<jacquard_common::CowStr<'a>>, 28 + /// Whether this hold allows public blob reads (pulls) without authentication 29 + pub public: bool, 30 + /// S3 region where blobs are stored 31 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 32 + #[serde(borrow)] 33 + pub region: std::option::Option<jacquard_common::CowStr<'a>>, 34 + } 35 + 36 + pub mod captain_state { 37 + 38 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 39 + #[allow(unused)] 40 + use ::core::marker::PhantomData; 41 + mod sealed { 42 + pub trait Sealed {} 43 + } 44 + /// State trait tracking which required fields have been set 45 + pub trait State: sealed::Sealed { 46 + type Public; 47 + type Owner; 48 + type EnableBlueskyPosts; 49 + type DeployedAt; 50 + type AllowAllCrew; 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 Public = Unset; 57 + type Owner = Unset; 58 + type EnableBlueskyPosts = Unset; 59 + type DeployedAt = Unset; 60 + type AllowAllCrew = Unset; 61 + } 62 + ///State transition - sets the `public` field to Set 63 + pub struct SetPublic<S: State = Empty>(PhantomData<fn() -> S>); 64 + impl<S: State> sealed::Sealed for SetPublic<S> {} 65 + impl<S: State> State for SetPublic<S> { 66 + type Public = Set<members::public>; 67 + type Owner = S::Owner; 68 + type EnableBlueskyPosts = S::EnableBlueskyPosts; 69 + type DeployedAt = S::DeployedAt; 70 + type AllowAllCrew = S::AllowAllCrew; 71 + } 72 + ///State transition - sets the `owner` field to Set 73 + pub struct SetOwner<S: State = Empty>(PhantomData<fn() -> S>); 74 + impl<S: State> sealed::Sealed for SetOwner<S> {} 75 + impl<S: State> State for SetOwner<S> { 76 + type Public = S::Public; 77 + type Owner = Set<members::owner>; 78 + type EnableBlueskyPosts = S::EnableBlueskyPosts; 79 + type DeployedAt = S::DeployedAt; 80 + type AllowAllCrew = S::AllowAllCrew; 81 + } 82 + ///State transition - sets the `enable_bluesky_posts` field to Set 83 + pub struct SetEnableBlueskyPosts<S: State = Empty>(PhantomData<fn() -> S>); 84 + impl<S: State> sealed::Sealed for SetEnableBlueskyPosts<S> {} 85 + impl<S: State> State for SetEnableBlueskyPosts<S> { 86 + type Public = S::Public; 87 + type Owner = S::Owner; 88 + type EnableBlueskyPosts = Set<members::enable_bluesky_posts>; 89 + type DeployedAt = S::DeployedAt; 90 + type AllowAllCrew = S::AllowAllCrew; 91 + } 92 + ///State transition - sets the `deployed_at` field to Set 93 + pub struct SetDeployedAt<S: State = Empty>(PhantomData<fn() -> S>); 94 + impl<S: State> sealed::Sealed for SetDeployedAt<S> {} 95 + impl<S: State> State for SetDeployedAt<S> { 96 + type Public = S::Public; 97 + type Owner = S::Owner; 98 + type EnableBlueskyPosts = S::EnableBlueskyPosts; 99 + type DeployedAt = Set<members::deployed_at>; 100 + type AllowAllCrew = S::AllowAllCrew; 101 + } 102 + ///State transition - sets the `allow_all_crew` field to Set 103 + pub struct SetAllowAllCrew<S: State = Empty>(PhantomData<fn() -> S>); 104 + impl<S: State> sealed::Sealed for SetAllowAllCrew<S> {} 105 + impl<S: State> State for SetAllowAllCrew<S> { 106 + type Public = S::Public; 107 + type Owner = S::Owner; 108 + type EnableBlueskyPosts = S::EnableBlueskyPosts; 109 + type DeployedAt = S::DeployedAt; 110 + type AllowAllCrew = Set<members::allow_all_crew>; 111 + } 112 + /// Marker types for field names 113 + #[allow(non_camel_case_types)] 114 + pub mod members { 115 + ///Marker type for the `public` field 116 + pub struct public(()); 117 + ///Marker type for the `owner` field 118 + pub struct owner(()); 119 + ///Marker type for the `enable_bluesky_posts` field 120 + pub struct enable_bluesky_posts(()); 121 + ///Marker type for the `deployed_at` field 122 + pub struct deployed_at(()); 123 + ///Marker type for the `allow_all_crew` field 124 + pub struct allow_all_crew(()); 125 + } 126 + } 127 + 128 + /// Builder for constructing an instance of this type 129 + pub struct CaptainBuilder<'a, S: captain_state::State> { 130 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 131 + __unsafe_private_named: ( 132 + ::core::option::Option<bool>, 133 + ::core::option::Option<jacquard_common::types::string::Datetime>, 134 + ::core::option::Option<bool>, 135 + ::core::option::Option<jacquard_common::types::string::Did<'a>>, 136 + ::core::option::Option<jacquard_common::CowStr<'a>>, 137 + ::core::option::Option<bool>, 138 + ::core::option::Option<jacquard_common::CowStr<'a>>, 139 + ), 140 + _phantom: ::core::marker::PhantomData<&'a ()>, 141 + } 142 + 143 + impl<'a> Captain<'a> { 144 + /// Create a new builder for this type 145 + pub fn new() -> CaptainBuilder<'a, captain_state::Empty> { 146 + CaptainBuilder::new() 147 + } 148 + } 149 + 150 + impl<'a> CaptainBuilder<'a, captain_state::Empty> { 151 + /// Create a new builder with all fields unset 152 + pub fn new() -> Self { 153 + CaptainBuilder { 154 + _phantom_state: ::core::marker::PhantomData, 155 + __unsafe_private_named: (None, None, None, None, None, None, None), 156 + _phantom: ::core::marker::PhantomData, 157 + } 158 + } 159 + } 160 + 161 + impl<'a, S> CaptainBuilder<'a, S> 162 + where 163 + S: captain_state::State, 164 + S::AllowAllCrew: captain_state::IsUnset, 165 + { 166 + /// Set the `allowAllCrew` field (required) 167 + pub fn allow_all_crew( 168 + mut self, 169 + value: impl Into<bool>, 170 + ) -> CaptainBuilder<'a, captain_state::SetAllowAllCrew<S>> { 171 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 172 + CaptainBuilder { 173 + _phantom_state: ::core::marker::PhantomData, 174 + __unsafe_private_named: self.__unsafe_private_named, 175 + _phantom: ::core::marker::PhantomData, 176 + } 177 + } 178 + } 179 + 180 + impl<'a, S> CaptainBuilder<'a, S> 181 + where 182 + S: captain_state::State, 183 + S::DeployedAt: captain_state::IsUnset, 184 + { 185 + /// Set the `deployedAt` field (required) 186 + pub fn deployed_at( 187 + mut self, 188 + value: impl Into<jacquard_common::types::string::Datetime>, 189 + ) -> CaptainBuilder<'a, captain_state::SetDeployedAt<S>> { 190 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 191 + CaptainBuilder { 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> CaptainBuilder<'a, S> 200 + where 201 + S: captain_state::State, 202 + S::EnableBlueskyPosts: captain_state::IsUnset, 203 + { 204 + /// Set the `enableBlueskyPosts` field (required) 205 + pub fn enable_bluesky_posts( 206 + mut self, 207 + value: impl Into<bool>, 208 + ) -> CaptainBuilder<'a, captain_state::SetEnableBlueskyPosts<S>> { 209 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 210 + CaptainBuilder { 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> CaptainBuilder<'a, S> 219 + where 220 + S: captain_state::State, 221 + S::Owner: captain_state::IsUnset, 222 + { 223 + /// Set the `owner` field (required) 224 + pub fn owner( 225 + mut self, 226 + value: impl Into<jacquard_common::types::string::Did<'a>>, 227 + ) -> CaptainBuilder<'a, captain_state::SetOwner<S>> { 228 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 229 + CaptainBuilder { 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: captain_state::State> CaptainBuilder<'a, S> { 238 + /// Set the `provider` field (optional) 239 + pub fn provider(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 240 + self.__unsafe_private_named.4 = value.into(); 241 + self 242 + } 243 + /// Set the `provider` field to an Option value (optional) 244 + pub fn maybe_provider(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 245 + self.__unsafe_private_named.4 = value; 246 + self 247 + } 248 + } 249 + 250 + impl<'a, S> CaptainBuilder<'a, S> 251 + where 252 + S: captain_state::State, 253 + S::Public: captain_state::IsUnset, 254 + { 255 + /// Set the `public` field (required) 256 + pub fn public( 257 + mut self, 258 + value: impl Into<bool>, 259 + ) -> CaptainBuilder<'a, captain_state::SetPublic<S>> { 260 + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 261 + CaptainBuilder { 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: captain_state::State> CaptainBuilder<'a, S> { 270 + /// Set the `region` field (optional) 271 + pub fn region(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 272 + self.__unsafe_private_named.6 = value.into(); 273 + self 274 + } 275 + /// Set the `region` field to an Option value (optional) 276 + pub fn maybe_region(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 277 + self.__unsafe_private_named.6 = value; 278 + self 279 + } 280 + } 281 + 282 + impl<'a, S> CaptainBuilder<'a, S> 283 + where 284 + S: captain_state::State, 285 + S::Public: captain_state::IsSet, 286 + S::Owner: captain_state::IsSet, 287 + S::EnableBlueskyPosts: captain_state::IsSet, 288 + S::DeployedAt: captain_state::IsSet, 289 + S::AllowAllCrew: captain_state::IsSet, 290 + { 291 + /// Build the final struct 292 + pub fn build(self) -> Captain<'a> { 293 + Captain { 294 + allow_all_crew: self.__unsafe_private_named.0.unwrap(), 295 + deployed_at: self.__unsafe_private_named.1.unwrap(), 296 + enable_bluesky_posts: self.__unsafe_private_named.2.unwrap(), 297 + owner: self.__unsafe_private_named.3.unwrap(), 298 + provider: self.__unsafe_private_named.4, 299 + public: self.__unsafe_private_named.5.unwrap(), 300 + region: self.__unsafe_private_named.6, 301 + extra_data: Default::default(), 302 + } 303 + } 304 + /// Build the final struct with custom extra_data 305 + pub fn build_with_data( 306 + self, 307 + extra_data: std::collections::BTreeMap< 308 + jacquard_common::smol_str::SmolStr, 309 + jacquard_common::types::value::Data<'a>, 310 + >, 311 + ) -> Captain<'a> { 312 + Captain { 313 + allow_all_crew: self.__unsafe_private_named.0.unwrap(), 314 + deployed_at: self.__unsafe_private_named.1.unwrap(), 315 + enable_bluesky_posts: self.__unsafe_private_named.2.unwrap(), 316 + owner: self.__unsafe_private_named.3.unwrap(), 317 + provider: self.__unsafe_private_named.4, 318 + public: self.__unsafe_private_named.5.unwrap(), 319 + region: self.__unsafe_private_named.6, 320 + extra_data: Some(extra_data), 321 + } 322 + } 323 + } 324 + 325 + impl<'a> Captain<'a> { 326 + pub fn uri( 327 + uri: impl Into<jacquard_common::CowStr<'a>>, 328 + ) -> Result< 329 + jacquard_common::types::uri::RecordUri<'a, CaptainRecord>, 330 + jacquard_common::types::uri::UriError, 331 + > { 332 + jacquard_common::types::uri::RecordUri::try_from_uri( 333 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 334 + ) 335 + } 336 + } 337 + 338 + /// Typed wrapper for GetRecord response with this collection's record type. 339 + #[derive( 340 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 341 + )] 342 + #[serde(rename_all = "camelCase")] 343 + pub struct CaptainGetRecordOutput<'a> { 344 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 345 + #[serde(borrow)] 346 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 347 + #[serde(borrow)] 348 + pub uri: jacquard_common::types::string::AtUri<'a>, 349 + #[serde(borrow)] 350 + pub value: Captain<'a>, 351 + } 352 + 353 + impl From<CaptainGetRecordOutput<'_>> for Captain<'_> { 354 + fn from(output: CaptainGetRecordOutput<'_>) -> Self { 355 + use jacquard_common::IntoStatic; 356 + output.value.into_static() 357 + } 358 + } 359 + 360 + impl jacquard_common::types::collection::Collection for Captain<'_> { 361 + const NSID: &'static str = "io.atcr.hold.captain"; 362 + type Record = CaptainRecord; 363 + } 364 + 365 + /// Marker type for deserializing records from this collection. 366 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 367 + pub struct CaptainRecord; 368 + impl jacquard_common::xrpc::XrpcResp for CaptainRecord { 369 + const NSID: &'static str = "io.atcr.hold.captain"; 370 + const ENCODING: &'static str = "application/json"; 371 + type Output<'de> = CaptainGetRecordOutput<'de>; 372 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 373 + } 374 + 375 + impl jacquard_common::types::collection::Collection for CaptainRecord { 376 + const NSID: &'static str = "io.atcr.hold.captain"; 377 + type Record = CaptainRecord; 378 + } 379 + 380 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Captain<'a> { 381 + fn nsid() -> &'static str { 382 + "io.atcr.hold.captain" 383 + } 384 + fn def_name() -> &'static str { 385 + "main" 386 + } 387 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 388 + lexicon_doc_io_atcr_hold_captain() 389 + } 390 + fn validate( 391 + &self, 392 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 393 + Ok(()) 394 + } 395 + } 396 + 397 + fn lexicon_doc_io_atcr_hold_captain() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 398 + ::jacquard_lexicon::lexicon::LexiconDoc { 399 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 400 + id: ::jacquard_common::CowStr::new_static("io.atcr.hold.captain"), 401 + revision: None, 402 + description: None, 403 + defs: { 404 + let mut map = ::std::collections::BTreeMap::new(); 405 + map.insert( 406 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 407 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 408 + description: Some( 409 + ::jacquard_common::CowStr::new_static( 410 + "Represents the hold's ownership and metadata. Stored as a singleton record at rkey 'self' in the hold's embedded PDS.", 411 + ), 412 + ), 413 + key: Some(::jacquard_common::CowStr::new_static("literal:self")), 414 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 415 + description: None, 416 + required: Some( 417 + vec![ 418 + ::jacquard_common::smol_str::SmolStr::new_static("owner"), 419 + ::jacquard_common::smol_str::SmolStr::new_static("public"), 420 + ::jacquard_common::smol_str::SmolStr::new_static("allowAllCrew"), 421 + ::jacquard_common::smol_str::SmolStr::new_static("enableBlueskyPosts"), 422 + ::jacquard_common::smol_str::SmolStr::new_static("deployedAt") 423 + ], 424 + ), 425 + nullable: None, 426 + properties: { 427 + #[allow(unused_mut)] 428 + let mut map = ::std::collections::BTreeMap::new(); 429 + map.insert( 430 + ::jacquard_common::smol_str::SmolStr::new_static( 431 + "allowAllCrew", 432 + ), 433 + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 434 + description: None, 435 + default: None, 436 + r#const: None, 437 + }), 438 + ); 439 + map.insert( 440 + ::jacquard_common::smol_str::SmolStr::new_static( 441 + "deployedAt", 442 + ), 443 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 444 + description: Some( 445 + ::jacquard_common::CowStr::new_static( 446 + "RFC3339 timestamp of when the hold was deployed", 447 + ), 448 + ), 449 + format: Some( 450 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 451 + ), 452 + default: None, 453 + min_length: None, 454 + max_length: None, 455 + min_graphemes: None, 456 + max_graphemes: None, 457 + r#enum: None, 458 + r#const: None, 459 + known_values: None, 460 + }), 461 + ); 462 + map.insert( 463 + ::jacquard_common::smol_str::SmolStr::new_static( 464 + "enableBlueskyPosts", 465 + ), 466 + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 467 + description: None, 468 + default: None, 469 + r#const: None, 470 + }), 471 + ); 472 + map.insert( 473 + ::jacquard_common::smol_str::SmolStr::new_static("owner"), 474 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 475 + description: Some( 476 + ::jacquard_common::CowStr::new_static( 477 + "DID of the hold owner", 478 + ), 479 + ), 480 + format: Some( 481 + ::jacquard_lexicon::lexicon::LexStringFormat::Did, 482 + ), 483 + default: None, 484 + min_length: None, 485 + max_length: None, 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( 495 + "provider", 496 + ), 497 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 498 + description: Some( 499 + ::jacquard_common::CowStr::new_static( 500 + "Deployment provider (e.g., fly.io, aws, etc.)", 501 + ), 502 + ), 503 + format: None, 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.insert( 515 + ::jacquard_common::smol_str::SmolStr::new_static("public"), 516 + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { 517 + description: None, 518 + default: None, 519 + r#const: None, 520 + }), 521 + ); 522 + map.insert( 523 + ::jacquard_common::smol_str::SmolStr::new_static("region"), 524 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 525 + description: Some( 526 + ::jacquard_common::CowStr::new_static( 527 + "S3 region where blobs are stored", 528 + ), 529 + ), 530 + format: None, 531 + default: None, 532 + min_length: None, 533 + max_length: None, 534 + min_graphemes: None, 535 + max_graphemes: None, 536 + r#enum: None, 537 + r#const: None, 538 + known_values: None, 539 + }), 540 + ); 541 + map 542 + }, 543 + }), 544 + }), 545 + ); 546 + map 547 + }, 548 + } 549 + }
+442
crates/jacquard-api/src/io_atcr/hold/crew.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: io.atcr.hold.crew 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// Crew member in a hold's embedded PDS. Grants access permissions to push blobs to the hold. Stored in the hold's embedded PDS (one record per member). 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct Crew<'a> { 15 + /// RFC3339 timestamp of when the member was added 16 + pub added_at: jacquard_common::types::string::Datetime, 17 + /// DID of the crew member 18 + #[serde(borrow)] 19 + pub member: jacquard_common::types::string::Did<'a>, 20 + /// Specific permissions granted to this member 21 + #[serde(borrow)] 22 + pub permissions: Vec<jacquard_common::CowStr<'a>>, 23 + /// Member's role in the hold 24 + #[serde(borrow)] 25 + pub role: jacquard_common::CowStr<'a>, 26 + } 27 + 28 + pub mod crew_state { 29 + 30 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 31 + #[allow(unused)] 32 + use ::core::marker::PhantomData; 33 + mod sealed { 34 + pub trait Sealed {} 35 + } 36 + /// State trait tracking which required fields have been set 37 + pub trait State: sealed::Sealed { 38 + type Member; 39 + type Permissions; 40 + type AddedAt; 41 + type Role; 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 Member = Unset; 48 + type Permissions = Unset; 49 + type AddedAt = Unset; 50 + type Role = Unset; 51 + } 52 + ///State transition - sets the `member` field to Set 53 + pub struct SetMember<S: State = Empty>(PhantomData<fn() -> S>); 54 + impl<S: State> sealed::Sealed for SetMember<S> {} 55 + impl<S: State> State for SetMember<S> { 56 + type Member = Set<members::member>; 57 + type Permissions = S::Permissions; 58 + type AddedAt = S::AddedAt; 59 + type Role = S::Role; 60 + } 61 + ///State transition - sets the `permissions` field to Set 62 + pub struct SetPermissions<S: State = Empty>(PhantomData<fn() -> S>); 63 + impl<S: State> sealed::Sealed for SetPermissions<S> {} 64 + impl<S: State> State for SetPermissions<S> { 65 + type Member = S::Member; 66 + type Permissions = Set<members::permissions>; 67 + type AddedAt = S::AddedAt; 68 + type Role = S::Role; 69 + } 70 + ///State transition - sets the `added_at` field to Set 71 + pub struct SetAddedAt<S: State = Empty>(PhantomData<fn() -> S>); 72 + impl<S: State> sealed::Sealed for SetAddedAt<S> {} 73 + impl<S: State> State for SetAddedAt<S> { 74 + type Member = S::Member; 75 + type Permissions = S::Permissions; 76 + type AddedAt = Set<members::added_at>; 77 + type Role = S::Role; 78 + } 79 + ///State transition - sets the `role` field to Set 80 + pub struct SetRole<S: State = Empty>(PhantomData<fn() -> S>); 81 + impl<S: State> sealed::Sealed for SetRole<S> {} 82 + impl<S: State> State for SetRole<S> { 83 + type Member = S::Member; 84 + type Permissions = S::Permissions; 85 + type AddedAt = S::AddedAt; 86 + type Role = Set<members::role>; 87 + } 88 + /// Marker types for field names 89 + #[allow(non_camel_case_types)] 90 + pub mod members { 91 + ///Marker type for the `member` field 92 + pub struct member(()); 93 + ///Marker type for the `permissions` field 94 + pub struct permissions(()); 95 + ///Marker type for the `added_at` field 96 + pub struct added_at(()); 97 + ///Marker type for the `role` field 98 + pub struct role(()); 99 + } 100 + } 101 + 102 + /// Builder for constructing an instance of this type 103 + pub struct CrewBuilder<'a, S: crew_state::State> { 104 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 105 + __unsafe_private_named: ( 106 + ::core::option::Option<jacquard_common::types::string::Datetime>, 107 + ::core::option::Option<jacquard_common::types::string::Did<'a>>, 108 + ::core::option::Option<Vec<jacquard_common::CowStr<'a>>>, 109 + ::core::option::Option<jacquard_common::CowStr<'a>>, 110 + ), 111 + _phantom: ::core::marker::PhantomData<&'a ()>, 112 + } 113 + 114 + impl<'a> Crew<'a> { 115 + /// Create a new builder for this type 116 + pub fn new() -> CrewBuilder<'a, crew_state::Empty> { 117 + CrewBuilder::new() 118 + } 119 + } 120 + 121 + impl<'a> CrewBuilder<'a, crew_state::Empty> { 122 + /// Create a new builder with all fields unset 123 + pub fn new() -> Self { 124 + CrewBuilder { 125 + _phantom_state: ::core::marker::PhantomData, 126 + __unsafe_private_named: (None, None, None, None), 127 + _phantom: ::core::marker::PhantomData, 128 + } 129 + } 130 + } 131 + 132 + impl<'a, S> CrewBuilder<'a, S> 133 + where 134 + S: crew_state::State, 135 + S::AddedAt: crew_state::IsUnset, 136 + { 137 + /// Set the `addedAt` field (required) 138 + pub fn added_at( 139 + mut self, 140 + value: impl Into<jacquard_common::types::string::Datetime>, 141 + ) -> CrewBuilder<'a, crew_state::SetAddedAt<S>> { 142 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 143 + CrewBuilder { 144 + _phantom_state: ::core::marker::PhantomData, 145 + __unsafe_private_named: self.__unsafe_private_named, 146 + _phantom: ::core::marker::PhantomData, 147 + } 148 + } 149 + } 150 + 151 + impl<'a, S> CrewBuilder<'a, S> 152 + where 153 + S: crew_state::State, 154 + S::Member: crew_state::IsUnset, 155 + { 156 + /// Set the `member` field (required) 157 + pub fn member( 158 + mut self, 159 + value: impl Into<jacquard_common::types::string::Did<'a>>, 160 + ) -> CrewBuilder<'a, crew_state::SetMember<S>> { 161 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 162 + CrewBuilder { 163 + _phantom_state: ::core::marker::PhantomData, 164 + __unsafe_private_named: self.__unsafe_private_named, 165 + _phantom: ::core::marker::PhantomData, 166 + } 167 + } 168 + } 169 + 170 + impl<'a, S> CrewBuilder<'a, S> 171 + where 172 + S: crew_state::State, 173 + S::Permissions: crew_state::IsUnset, 174 + { 175 + /// Set the `permissions` field (required) 176 + pub fn permissions( 177 + mut self, 178 + value: impl Into<Vec<jacquard_common::CowStr<'a>>>, 179 + ) -> CrewBuilder<'a, crew_state::SetPermissions<S>> { 180 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 181 + CrewBuilder { 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> CrewBuilder<'a, S> 190 + where 191 + S: crew_state::State, 192 + S::Role: crew_state::IsUnset, 193 + { 194 + /// Set the `role` field (required) 195 + pub fn role( 196 + mut self, 197 + value: impl Into<jacquard_common::CowStr<'a>>, 198 + ) -> CrewBuilder<'a, crew_state::SetRole<S>> { 199 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 200 + CrewBuilder { 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> CrewBuilder<'a, S> 209 + where 210 + S: crew_state::State, 211 + S::Member: crew_state::IsSet, 212 + S::Permissions: crew_state::IsSet, 213 + S::AddedAt: crew_state::IsSet, 214 + S::Role: crew_state::IsSet, 215 + { 216 + /// Build the final struct 217 + pub fn build(self) -> Crew<'a> { 218 + Crew { 219 + added_at: self.__unsafe_private_named.0.unwrap(), 220 + member: self.__unsafe_private_named.1.unwrap(), 221 + permissions: self.__unsafe_private_named.2.unwrap(), 222 + role: self.__unsafe_private_named.3.unwrap(), 223 + extra_data: Default::default(), 224 + } 225 + } 226 + /// Build the final struct with custom extra_data 227 + pub fn build_with_data( 228 + self, 229 + extra_data: std::collections::BTreeMap< 230 + jacquard_common::smol_str::SmolStr, 231 + jacquard_common::types::value::Data<'a>, 232 + >, 233 + ) -> Crew<'a> { 234 + Crew { 235 + added_at: self.__unsafe_private_named.0.unwrap(), 236 + member: self.__unsafe_private_named.1.unwrap(), 237 + permissions: self.__unsafe_private_named.2.unwrap(), 238 + role: self.__unsafe_private_named.3.unwrap(), 239 + extra_data: Some(extra_data), 240 + } 241 + } 242 + } 243 + 244 + impl<'a> Crew<'a> { 245 + pub fn uri( 246 + uri: impl Into<jacquard_common::CowStr<'a>>, 247 + ) -> Result< 248 + jacquard_common::types::uri::RecordUri<'a, CrewRecord>, 249 + jacquard_common::types::uri::UriError, 250 + > { 251 + jacquard_common::types::uri::RecordUri::try_from_uri( 252 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 253 + ) 254 + } 255 + } 256 + 257 + /// Typed wrapper for GetRecord response with this collection's record type. 258 + #[derive( 259 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 260 + )] 261 + #[serde(rename_all = "camelCase")] 262 + pub struct CrewGetRecordOutput<'a> { 263 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 264 + #[serde(borrow)] 265 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 266 + #[serde(borrow)] 267 + pub uri: jacquard_common::types::string::AtUri<'a>, 268 + #[serde(borrow)] 269 + pub value: Crew<'a>, 270 + } 271 + 272 + impl From<CrewGetRecordOutput<'_>> for Crew<'_> { 273 + fn from(output: CrewGetRecordOutput<'_>) -> Self { 274 + use jacquard_common::IntoStatic; 275 + output.value.into_static() 276 + } 277 + } 278 + 279 + impl jacquard_common::types::collection::Collection for Crew<'_> { 280 + const NSID: &'static str = "io.atcr.hold.crew"; 281 + type Record = CrewRecord; 282 + } 283 + 284 + /// Marker type for deserializing records from this collection. 285 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 286 + pub struct CrewRecord; 287 + impl jacquard_common::xrpc::XrpcResp for CrewRecord { 288 + const NSID: &'static str = "io.atcr.hold.crew"; 289 + const ENCODING: &'static str = "application/json"; 290 + type Output<'de> = CrewGetRecordOutput<'de>; 291 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 292 + } 293 + 294 + impl jacquard_common::types::collection::Collection for CrewRecord { 295 + const NSID: &'static str = "io.atcr.hold.crew"; 296 + type Record = CrewRecord; 297 + } 298 + 299 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Crew<'a> { 300 + fn nsid() -> &'static str { 301 + "io.atcr.hold.crew" 302 + } 303 + fn def_name() -> &'static str { 304 + "main" 305 + } 306 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 307 + lexicon_doc_io_atcr_hold_crew() 308 + } 309 + fn validate( 310 + &self, 311 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 312 + Ok(()) 313 + } 314 + } 315 + 316 + fn lexicon_doc_io_atcr_hold_crew() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 317 + ::jacquard_lexicon::lexicon::LexiconDoc { 318 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 319 + id: ::jacquard_common::CowStr::new_static("io.atcr.hold.crew"), 320 + revision: None, 321 + description: None, 322 + defs: { 323 + let mut map = ::std::collections::BTreeMap::new(); 324 + map.insert( 325 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 326 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 327 + description: Some( 328 + ::jacquard_common::CowStr::new_static( 329 + "Crew member in a hold's embedded PDS. Grants access permissions to push blobs to the hold. Stored in the hold's embedded PDS (one record per member).", 330 + ), 331 + ), 332 + key: Some(::jacquard_common::CowStr::new_static("any")), 333 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 334 + description: None, 335 + required: Some( 336 + vec![ 337 + ::jacquard_common::smol_str::SmolStr::new_static("member"), 338 + ::jacquard_common::smol_str::SmolStr::new_static("role"), 339 + ::jacquard_common::smol_str::SmolStr::new_static("permissions"), 340 + ::jacquard_common::smol_str::SmolStr::new_static("addedAt") 341 + ], 342 + ), 343 + nullable: None, 344 + properties: { 345 + #[allow(unused_mut)] 346 + let mut map = ::std::collections::BTreeMap::new(); 347 + map.insert( 348 + ::jacquard_common::smol_str::SmolStr::new_static("addedAt"), 349 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 350 + description: Some( 351 + ::jacquard_common::CowStr::new_static( 352 + "RFC3339 timestamp of when the member was added", 353 + ), 354 + ), 355 + format: Some( 356 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 357 + ), 358 + default: None, 359 + min_length: None, 360 + max_length: None, 361 + min_graphemes: None, 362 + max_graphemes: None, 363 + r#enum: None, 364 + r#const: None, 365 + known_values: None, 366 + }), 367 + ); 368 + map.insert( 369 + ::jacquard_common::smol_str::SmolStr::new_static("member"), 370 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 371 + description: Some( 372 + ::jacquard_common::CowStr::new_static( 373 + "DID of the crew member", 374 + ), 375 + ), 376 + format: Some( 377 + ::jacquard_lexicon::lexicon::LexStringFormat::Did, 378 + ), 379 + default: None, 380 + min_length: None, 381 + max_length: None, 382 + min_graphemes: None, 383 + max_graphemes: None, 384 + r#enum: None, 385 + r#const: None, 386 + known_values: None, 387 + }), 388 + ); 389 + map.insert( 390 + ::jacquard_common::smol_str::SmolStr::new_static( 391 + "permissions", 392 + ), 393 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 394 + description: Some( 395 + ::jacquard_common::CowStr::new_static( 396 + "Specific permissions granted to this member", 397 + ), 398 + ), 399 + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 400 + description: None, 401 + format: None, 402 + default: None, 403 + min_length: None, 404 + max_length: None, 405 + min_graphemes: None, 406 + max_graphemes: None, 407 + r#enum: None, 408 + r#const: None, 409 + known_values: None, 410 + }), 411 + min_length: None, 412 + max_length: None, 413 + }), 414 + ); 415 + map.insert( 416 + ::jacquard_common::smol_str::SmolStr::new_static("role"), 417 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 418 + description: Some( 419 + ::jacquard_common::CowStr::new_static( 420 + "Member's role in the hold", 421 + ), 422 + ), 423 + format: None, 424 + default: None, 425 + min_length: None, 426 + max_length: None, 427 + min_graphemes: None, 428 + max_graphemes: None, 429 + r#enum: None, 430 + r#const: None, 431 + known_values: None, 432 + }), 433 + ); 434 + map 435 + }, 436 + }), 437 + }), 438 + ); 439 + map 440 + }, 441 + } 442 + }
+631
crates/jacquard-api/src/io_atcr/hold/layer.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: io.atcr.hold.layer 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// Represents metadata about a container layer stored in the hold. Stored in the hold's embedded PDS for tracking and analytics. 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct Layer<'a> { 15 + /// RFC3339 timestamp of when the layer was uploaded 16 + pub created_at: jacquard_common::types::string::Datetime, 17 + /// Layer digest (e.g., sha256:abc123...) 18 + #[serde(borrow)] 19 + pub digest: jacquard_common::CowStr<'a>, 20 + /// Media type (e.g., application/vnd.oci.image.layer.v1.tar+gzip) 21 + #[serde(borrow)] 22 + pub media_type: jacquard_common::CowStr<'a>, 23 + /// Repository this layer belongs to 24 + #[serde(borrow)] 25 + pub repository: jacquard_common::CowStr<'a>, 26 + /// Size in bytes 27 + pub size: i64, 28 + /// DID of user who uploaded this layer 29 + #[serde(borrow)] 30 + pub user_did: jacquard_common::types::string::Did<'a>, 31 + /// Handle of user (for display purposes) 32 + #[serde(borrow)] 33 + pub user_handle: jacquard_common::types::string::Handle<'a>, 34 + } 35 + 36 + pub mod layer_state { 37 + 38 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 39 + #[allow(unused)] 40 + use ::core::marker::PhantomData; 41 + mod sealed { 42 + pub trait Sealed {} 43 + } 44 + /// State trait tracking which required fields have been set 45 + pub trait State: sealed::Sealed { 46 + type CreatedAt; 47 + type Digest; 48 + type MediaType; 49 + type Size; 50 + type Repository; 51 + type UserDid; 52 + type UserHandle; 53 + } 54 + /// Empty state - all required fields are unset 55 + pub struct Empty(()); 56 + impl sealed::Sealed for Empty {} 57 + impl State for Empty { 58 + type CreatedAt = Unset; 59 + type Digest = Unset; 60 + type MediaType = Unset; 61 + type Size = Unset; 62 + type Repository = Unset; 63 + type UserDid = Unset; 64 + type UserHandle = Unset; 65 + } 66 + ///State transition - sets the `created_at` field to Set 67 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 68 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 69 + impl<S: State> State for SetCreatedAt<S> { 70 + type CreatedAt = Set<members::created_at>; 71 + type Digest = S::Digest; 72 + type MediaType = S::MediaType; 73 + type Size = S::Size; 74 + type Repository = S::Repository; 75 + type UserDid = S::UserDid; 76 + type UserHandle = S::UserHandle; 77 + } 78 + ///State transition - sets the `digest` field to Set 79 + pub struct SetDigest<S: State = Empty>(PhantomData<fn() -> S>); 80 + impl<S: State> sealed::Sealed for SetDigest<S> {} 81 + impl<S: State> State for SetDigest<S> { 82 + type CreatedAt = S::CreatedAt; 83 + type Digest = Set<members::digest>; 84 + type MediaType = S::MediaType; 85 + type Size = S::Size; 86 + type Repository = S::Repository; 87 + type UserDid = S::UserDid; 88 + type UserHandle = S::UserHandle; 89 + } 90 + ///State transition - sets the `media_type` field to Set 91 + pub struct SetMediaType<S: State = Empty>(PhantomData<fn() -> S>); 92 + impl<S: State> sealed::Sealed for SetMediaType<S> {} 93 + impl<S: State> State for SetMediaType<S> { 94 + type CreatedAt = S::CreatedAt; 95 + type Digest = S::Digest; 96 + type MediaType = Set<members::media_type>; 97 + type Size = S::Size; 98 + type Repository = S::Repository; 99 + type UserDid = S::UserDid; 100 + type UserHandle = S::UserHandle; 101 + } 102 + ///State transition - sets the `size` field to Set 103 + pub struct SetSize<S: State = Empty>(PhantomData<fn() -> S>); 104 + impl<S: State> sealed::Sealed for SetSize<S> {} 105 + impl<S: State> State for SetSize<S> { 106 + type CreatedAt = S::CreatedAt; 107 + type Digest = S::Digest; 108 + type MediaType = S::MediaType; 109 + type Size = Set<members::size>; 110 + type Repository = S::Repository; 111 + type UserDid = S::UserDid; 112 + type UserHandle = S::UserHandle; 113 + } 114 + ///State transition - sets the `repository` field to Set 115 + pub struct SetRepository<S: State = Empty>(PhantomData<fn() -> S>); 116 + impl<S: State> sealed::Sealed for SetRepository<S> {} 117 + impl<S: State> State for SetRepository<S> { 118 + type CreatedAt = S::CreatedAt; 119 + type Digest = S::Digest; 120 + type MediaType = S::MediaType; 121 + type Size = S::Size; 122 + type Repository = Set<members::repository>; 123 + type UserDid = S::UserDid; 124 + type UserHandle = S::UserHandle; 125 + } 126 + ///State transition - sets the `user_did` field to Set 127 + pub struct SetUserDid<S: State = Empty>(PhantomData<fn() -> S>); 128 + impl<S: State> sealed::Sealed for SetUserDid<S> {} 129 + impl<S: State> State for SetUserDid<S> { 130 + type CreatedAt = S::CreatedAt; 131 + type Digest = S::Digest; 132 + type MediaType = S::MediaType; 133 + type Size = S::Size; 134 + type Repository = S::Repository; 135 + type UserDid = Set<members::user_did>; 136 + type UserHandle = S::UserHandle; 137 + } 138 + ///State transition - sets the `user_handle` field to Set 139 + pub struct SetUserHandle<S: State = Empty>(PhantomData<fn() -> S>); 140 + impl<S: State> sealed::Sealed for SetUserHandle<S> {} 141 + impl<S: State> State for SetUserHandle<S> { 142 + type CreatedAt = S::CreatedAt; 143 + type Digest = S::Digest; 144 + type MediaType = S::MediaType; 145 + type Size = S::Size; 146 + type Repository = S::Repository; 147 + type UserDid = S::UserDid; 148 + type UserHandle = Set<members::user_handle>; 149 + } 150 + /// Marker types for field names 151 + #[allow(non_camel_case_types)] 152 + pub mod members { 153 + ///Marker type for the `created_at` field 154 + pub struct created_at(()); 155 + ///Marker type for the `digest` field 156 + pub struct digest(()); 157 + ///Marker type for the `media_type` field 158 + pub struct media_type(()); 159 + ///Marker type for the `size` field 160 + pub struct size(()); 161 + ///Marker type for the `repository` field 162 + pub struct repository(()); 163 + ///Marker type for the `user_did` field 164 + pub struct user_did(()); 165 + ///Marker type for the `user_handle` field 166 + pub struct user_handle(()); 167 + } 168 + } 169 + 170 + /// Builder for constructing an instance of this type 171 + pub struct LayerBuilder<'a, S: layer_state::State> { 172 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 173 + __unsafe_private_named: ( 174 + ::core::option::Option<jacquard_common::types::string::Datetime>, 175 + ::core::option::Option<jacquard_common::CowStr<'a>>, 176 + ::core::option::Option<jacquard_common::CowStr<'a>>, 177 + ::core::option::Option<jacquard_common::CowStr<'a>>, 178 + ::core::option::Option<i64>, 179 + ::core::option::Option<jacquard_common::types::string::Did<'a>>, 180 + ::core::option::Option<jacquard_common::types::string::Handle<'a>>, 181 + ), 182 + _phantom: ::core::marker::PhantomData<&'a ()>, 183 + } 184 + 185 + impl<'a> Layer<'a> { 186 + /// Create a new builder for this type 187 + pub fn new() -> LayerBuilder<'a, layer_state::Empty> { 188 + LayerBuilder::new() 189 + } 190 + } 191 + 192 + impl<'a> LayerBuilder<'a, layer_state::Empty> { 193 + /// Create a new builder with all fields unset 194 + pub fn new() -> Self { 195 + LayerBuilder { 196 + _phantom_state: ::core::marker::PhantomData, 197 + __unsafe_private_named: (None, None, None, None, None, None, None), 198 + _phantom: ::core::marker::PhantomData, 199 + } 200 + } 201 + } 202 + 203 + impl<'a, S> LayerBuilder<'a, S> 204 + where 205 + S: layer_state::State, 206 + S::CreatedAt: layer_state::IsUnset, 207 + { 208 + /// Set the `createdAt` field (required) 209 + pub fn created_at( 210 + mut self, 211 + value: impl Into<jacquard_common::types::string::Datetime>, 212 + ) -> LayerBuilder<'a, layer_state::SetCreatedAt<S>> { 213 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 214 + LayerBuilder { 215 + _phantom_state: ::core::marker::PhantomData, 216 + __unsafe_private_named: self.__unsafe_private_named, 217 + _phantom: ::core::marker::PhantomData, 218 + } 219 + } 220 + } 221 + 222 + impl<'a, S> LayerBuilder<'a, S> 223 + where 224 + S: layer_state::State, 225 + S::Digest: layer_state::IsUnset, 226 + { 227 + /// Set the `digest` field (required) 228 + pub fn digest( 229 + mut self, 230 + value: impl Into<jacquard_common::CowStr<'a>>, 231 + ) -> LayerBuilder<'a, layer_state::SetDigest<S>> { 232 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 233 + LayerBuilder { 234 + _phantom_state: ::core::marker::PhantomData, 235 + __unsafe_private_named: self.__unsafe_private_named, 236 + _phantom: ::core::marker::PhantomData, 237 + } 238 + } 239 + } 240 + 241 + impl<'a, S> LayerBuilder<'a, S> 242 + where 243 + S: layer_state::State, 244 + S::MediaType: layer_state::IsUnset, 245 + { 246 + /// Set the `mediaType` field (required) 247 + pub fn media_type( 248 + mut self, 249 + value: impl Into<jacquard_common::CowStr<'a>>, 250 + ) -> LayerBuilder<'a, layer_state::SetMediaType<S>> { 251 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 252 + LayerBuilder { 253 + _phantom_state: ::core::marker::PhantomData, 254 + __unsafe_private_named: self.__unsafe_private_named, 255 + _phantom: ::core::marker::PhantomData, 256 + } 257 + } 258 + } 259 + 260 + impl<'a, S> LayerBuilder<'a, S> 261 + where 262 + S: layer_state::State, 263 + S::Repository: layer_state::IsUnset, 264 + { 265 + /// Set the `repository` field (required) 266 + pub fn repository( 267 + mut self, 268 + value: impl Into<jacquard_common::CowStr<'a>>, 269 + ) -> LayerBuilder<'a, layer_state::SetRepository<S>> { 270 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 271 + LayerBuilder { 272 + _phantom_state: ::core::marker::PhantomData, 273 + __unsafe_private_named: self.__unsafe_private_named, 274 + _phantom: ::core::marker::PhantomData, 275 + } 276 + } 277 + } 278 + 279 + impl<'a, S> LayerBuilder<'a, S> 280 + where 281 + S: layer_state::State, 282 + S::Size: layer_state::IsUnset, 283 + { 284 + /// Set the `size` field (required) 285 + pub fn size(mut self, value: impl Into<i64>) -> LayerBuilder<'a, layer_state::SetSize<S>> { 286 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 287 + LayerBuilder { 288 + _phantom_state: ::core::marker::PhantomData, 289 + __unsafe_private_named: self.__unsafe_private_named, 290 + _phantom: ::core::marker::PhantomData, 291 + } 292 + } 293 + } 294 + 295 + impl<'a, S> LayerBuilder<'a, S> 296 + where 297 + S: layer_state::State, 298 + S::UserDid: layer_state::IsUnset, 299 + { 300 + /// Set the `userDid` field (required) 301 + pub fn user_did( 302 + mut self, 303 + value: impl Into<jacquard_common::types::string::Did<'a>>, 304 + ) -> LayerBuilder<'a, layer_state::SetUserDid<S>> { 305 + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); 306 + LayerBuilder { 307 + _phantom_state: ::core::marker::PhantomData, 308 + __unsafe_private_named: self.__unsafe_private_named, 309 + _phantom: ::core::marker::PhantomData, 310 + } 311 + } 312 + } 313 + 314 + impl<'a, S> LayerBuilder<'a, S> 315 + where 316 + S: layer_state::State, 317 + S::UserHandle: layer_state::IsUnset, 318 + { 319 + /// Set the `userHandle` field (required) 320 + pub fn user_handle( 321 + mut self, 322 + value: impl Into<jacquard_common::types::string::Handle<'a>>, 323 + ) -> LayerBuilder<'a, layer_state::SetUserHandle<S>> { 324 + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); 325 + LayerBuilder { 326 + _phantom_state: ::core::marker::PhantomData, 327 + __unsafe_private_named: self.__unsafe_private_named, 328 + _phantom: ::core::marker::PhantomData, 329 + } 330 + } 331 + } 332 + 333 + impl<'a, S> LayerBuilder<'a, S> 334 + where 335 + S: layer_state::State, 336 + S::CreatedAt: layer_state::IsSet, 337 + S::Digest: layer_state::IsSet, 338 + S::MediaType: layer_state::IsSet, 339 + S::Size: layer_state::IsSet, 340 + S::Repository: layer_state::IsSet, 341 + S::UserDid: layer_state::IsSet, 342 + S::UserHandle: layer_state::IsSet, 343 + { 344 + /// Build the final struct 345 + pub fn build(self) -> Layer<'a> { 346 + Layer { 347 + created_at: self.__unsafe_private_named.0.unwrap(), 348 + digest: self.__unsafe_private_named.1.unwrap(), 349 + media_type: self.__unsafe_private_named.2.unwrap(), 350 + repository: self.__unsafe_private_named.3.unwrap(), 351 + size: self.__unsafe_private_named.4.unwrap(), 352 + user_did: self.__unsafe_private_named.5.unwrap(), 353 + user_handle: self.__unsafe_private_named.6.unwrap(), 354 + extra_data: Default::default(), 355 + } 356 + } 357 + /// Build the final struct with custom extra_data 358 + pub fn build_with_data( 359 + self, 360 + extra_data: std::collections::BTreeMap< 361 + jacquard_common::smol_str::SmolStr, 362 + jacquard_common::types::value::Data<'a>, 363 + >, 364 + ) -> Layer<'a> { 365 + Layer { 366 + created_at: self.__unsafe_private_named.0.unwrap(), 367 + digest: self.__unsafe_private_named.1.unwrap(), 368 + media_type: self.__unsafe_private_named.2.unwrap(), 369 + repository: self.__unsafe_private_named.3.unwrap(), 370 + size: self.__unsafe_private_named.4.unwrap(), 371 + user_did: self.__unsafe_private_named.5.unwrap(), 372 + user_handle: self.__unsafe_private_named.6.unwrap(), 373 + extra_data: Some(extra_data), 374 + } 375 + } 376 + } 377 + 378 + impl<'a> Layer<'a> { 379 + pub fn uri( 380 + uri: impl Into<jacquard_common::CowStr<'a>>, 381 + ) -> Result< 382 + jacquard_common::types::uri::RecordUri<'a, LayerRecord>, 383 + jacquard_common::types::uri::UriError, 384 + > { 385 + jacquard_common::types::uri::RecordUri::try_from_uri( 386 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 387 + ) 388 + } 389 + } 390 + 391 + /// Typed wrapper for GetRecord response with this collection's record type. 392 + #[derive( 393 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 394 + )] 395 + #[serde(rename_all = "camelCase")] 396 + pub struct LayerGetRecordOutput<'a> { 397 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 398 + #[serde(borrow)] 399 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 400 + #[serde(borrow)] 401 + pub uri: jacquard_common::types::string::AtUri<'a>, 402 + #[serde(borrow)] 403 + pub value: Layer<'a>, 404 + } 405 + 406 + impl From<LayerGetRecordOutput<'_>> for Layer<'_> { 407 + fn from(output: LayerGetRecordOutput<'_>) -> Self { 408 + use jacquard_common::IntoStatic; 409 + output.value.into_static() 410 + } 411 + } 412 + 413 + impl jacquard_common::types::collection::Collection for Layer<'_> { 414 + const NSID: &'static str = "io.atcr.hold.layer"; 415 + type Record = LayerRecord; 416 + } 417 + 418 + /// Marker type for deserializing records from this collection. 419 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 420 + pub struct LayerRecord; 421 + impl jacquard_common::xrpc::XrpcResp for LayerRecord { 422 + const NSID: &'static str = "io.atcr.hold.layer"; 423 + const ENCODING: &'static str = "application/json"; 424 + type Output<'de> = LayerGetRecordOutput<'de>; 425 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 426 + } 427 + 428 + impl jacquard_common::types::collection::Collection for LayerRecord { 429 + const NSID: &'static str = "io.atcr.hold.layer"; 430 + type Record = LayerRecord; 431 + } 432 + 433 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Layer<'a> { 434 + fn nsid() -> &'static str { 435 + "io.atcr.hold.layer" 436 + } 437 + fn def_name() -> &'static str { 438 + "main" 439 + } 440 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 441 + lexicon_doc_io_atcr_hold_layer() 442 + } 443 + fn validate( 444 + &self, 445 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 446 + Ok(()) 447 + } 448 + } 449 + 450 + fn lexicon_doc_io_atcr_hold_layer() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 451 + ::jacquard_lexicon::lexicon::LexiconDoc { 452 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 453 + id: ::jacquard_common::CowStr::new_static("io.atcr.hold.layer"), 454 + revision: None, 455 + description: None, 456 + defs: { 457 + let mut map = ::std::collections::BTreeMap::new(); 458 + map.insert( 459 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 460 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 461 + description: Some( 462 + ::jacquard_common::CowStr::new_static( 463 + "Represents metadata about a container layer stored in the hold. Stored in the hold's embedded PDS for tracking and analytics.", 464 + ), 465 + ), 466 + key: Some(::jacquard_common::CowStr::new_static("tid")), 467 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 468 + description: None, 469 + required: Some( 470 + vec![ 471 + ::jacquard_common::smol_str::SmolStr::new_static("digest"), 472 + ::jacquard_common::smol_str::SmolStr::new_static("size"), 473 + ::jacquard_common::smol_str::SmolStr::new_static("mediaType"), 474 + ::jacquard_common::smol_str::SmolStr::new_static("repository"), 475 + ::jacquard_common::smol_str::SmolStr::new_static("userDid"), 476 + ::jacquard_common::smol_str::SmolStr::new_static("userHandle"), 477 + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") 478 + ], 479 + ), 480 + nullable: None, 481 + properties: { 482 + #[allow(unused_mut)] 483 + let mut map = ::std::collections::BTreeMap::new(); 484 + map.insert( 485 + ::jacquard_common::smol_str::SmolStr::new_static( 486 + "createdAt", 487 + ), 488 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 489 + description: Some( 490 + ::jacquard_common::CowStr::new_static( 491 + "RFC3339 timestamp of when the layer was uploaded", 492 + ), 493 + ), 494 + format: Some( 495 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 496 + ), 497 + default: None, 498 + min_length: None, 499 + max_length: None, 500 + min_graphemes: None, 501 + max_graphemes: None, 502 + r#enum: None, 503 + r#const: None, 504 + known_values: None, 505 + }), 506 + ); 507 + map.insert( 508 + ::jacquard_common::smol_str::SmolStr::new_static("digest"), 509 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 510 + description: Some( 511 + ::jacquard_common::CowStr::new_static( 512 + "Layer digest (e.g., sha256:abc123...)", 513 + ), 514 + ), 515 + format: None, 516 + default: None, 517 + min_length: None, 518 + max_length: None, 519 + min_graphemes: None, 520 + max_graphemes: None, 521 + r#enum: None, 522 + r#const: None, 523 + known_values: None, 524 + }), 525 + ); 526 + map.insert( 527 + ::jacquard_common::smol_str::SmolStr::new_static( 528 + "mediaType", 529 + ), 530 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 531 + description: Some( 532 + ::jacquard_common::CowStr::new_static( 533 + "Media type (e.g., application/vnd.oci.image.layer.v1.tar+gzip)", 534 + ), 535 + ), 536 + format: None, 537 + default: None, 538 + min_length: None, 539 + max_length: None, 540 + min_graphemes: None, 541 + max_graphemes: None, 542 + r#enum: None, 543 + r#const: None, 544 + known_values: None, 545 + }), 546 + ); 547 + map.insert( 548 + ::jacquard_common::smol_str::SmolStr::new_static( 549 + "repository", 550 + ), 551 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 552 + description: Some( 553 + ::jacquard_common::CowStr::new_static( 554 + "Repository this layer belongs to", 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.insert( 569 + ::jacquard_common::smol_str::SmolStr::new_static("size"), 570 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 571 + description: None, 572 + default: None, 573 + minimum: None, 574 + maximum: None, 575 + r#enum: None, 576 + r#const: None, 577 + }), 578 + ); 579 + map.insert( 580 + ::jacquard_common::smol_str::SmolStr::new_static("userDid"), 581 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 582 + description: Some( 583 + ::jacquard_common::CowStr::new_static( 584 + "DID of user who uploaded this layer", 585 + ), 586 + ), 587 + format: Some( 588 + ::jacquard_lexicon::lexicon::LexStringFormat::Did, 589 + ), 590 + default: None, 591 + min_length: None, 592 + max_length: None, 593 + min_graphemes: None, 594 + max_graphemes: None, 595 + r#enum: None, 596 + r#const: None, 597 + known_values: None, 598 + }), 599 + ); 600 + map.insert( 601 + ::jacquard_common::smol_str::SmolStr::new_static( 602 + "userHandle", 603 + ), 604 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 605 + description: Some( 606 + ::jacquard_common::CowStr::new_static( 607 + "Handle of user (for display purposes)", 608 + ), 609 + ), 610 + format: Some( 611 + ::jacquard_lexicon::lexicon::LexStringFormat::Handle, 612 + ), 613 + default: None, 614 + min_length: None, 615 + max_length: None, 616 + min_graphemes: None, 617 + max_graphemes: None, 618 + r#enum: None, 619 + r#const: None, 620 + known_values: None, 621 + }), 622 + ); 623 + map 624 + }, 625 + }), 626 + }), 627 + ); 628 + map 629 + }, 630 + } 631 + }
+1724
crates/jacquard-api/src/io_atcr/manifest.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: io.atcr.manifest 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// Reference to a blob stored in S3 or external storage 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct BlobReference<'a> { 15 + /// Optional OCI annotation metadata. Map of string keys to string values. 16 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 17 + #[serde(borrow)] 18 + pub annotations: std::option::Option<jacquard_common::types::value::Data<'a>>, 19 + /// Content digest (e.g., 'sha256:...') 20 + #[serde(borrow)] 21 + pub digest: jacquard_common::CowStr<'a>, 22 + /// MIME type of the blob 23 + #[serde(borrow)] 24 + pub media_type: jacquard_common::CowStr<'a>, 25 + /// Size in bytes 26 + pub size: i64, 27 + /// Optional direct URLs to blob (for BYOS) 28 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 29 + #[serde(borrow)] 30 + pub urls: std::option::Option<Vec<jacquard_common::types::string::Uri<'a>>>, 31 + } 32 + 33 + pub mod blob_reference_state { 34 + 35 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 36 + #[allow(unused)] 37 + use ::core::marker::PhantomData; 38 + mod sealed { 39 + pub trait Sealed {} 40 + } 41 + /// State trait tracking which required fields have been set 42 + pub trait State: sealed::Sealed { 43 + type MediaType; 44 + type Size; 45 + type Digest; 46 + } 47 + /// Empty state - all required fields are unset 48 + pub struct Empty(()); 49 + impl sealed::Sealed for Empty {} 50 + impl State for Empty { 51 + type MediaType = Unset; 52 + type Size = Unset; 53 + type Digest = Unset; 54 + } 55 + ///State transition - sets the `media_type` field to Set 56 + pub struct SetMediaType<S: State = Empty>(PhantomData<fn() -> S>); 57 + impl<S: State> sealed::Sealed for SetMediaType<S> {} 58 + impl<S: State> State for SetMediaType<S> { 59 + type MediaType = Set<members::media_type>; 60 + type Size = S::Size; 61 + type Digest = S::Digest; 62 + } 63 + ///State transition - sets the `size` field to Set 64 + pub struct SetSize<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetSize<S> {} 66 + impl<S: State> State for SetSize<S> { 67 + type MediaType = S::MediaType; 68 + type Size = Set<members::size>; 69 + type Digest = S::Digest; 70 + } 71 + ///State transition - sets the `digest` field to Set 72 + pub struct SetDigest<S: State = Empty>(PhantomData<fn() -> S>); 73 + impl<S: State> sealed::Sealed for SetDigest<S> {} 74 + impl<S: State> State for SetDigest<S> { 75 + type MediaType = S::MediaType; 76 + type Size = S::Size; 77 + type Digest = Set<members::digest>; 78 + } 79 + /// Marker types for field names 80 + #[allow(non_camel_case_types)] 81 + pub mod members { 82 + ///Marker type for the `media_type` field 83 + pub struct media_type(()); 84 + ///Marker type for the `size` field 85 + pub struct size(()); 86 + ///Marker type for the `digest` field 87 + pub struct digest(()); 88 + } 89 + } 90 + 91 + /// Builder for constructing an instance of this type 92 + pub struct BlobReferenceBuilder<'a, S: blob_reference_state::State> { 93 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 94 + __unsafe_private_named: ( 95 + ::core::option::Option<jacquard_common::types::value::Data<'a>>, 96 + ::core::option::Option<jacquard_common::CowStr<'a>>, 97 + ::core::option::Option<jacquard_common::CowStr<'a>>, 98 + ::core::option::Option<i64>, 99 + ::core::option::Option<Vec<jacquard_common::types::string::Uri<'a>>>, 100 + ), 101 + _phantom: ::core::marker::PhantomData<&'a ()>, 102 + } 103 + 104 + impl<'a> BlobReference<'a> { 105 + /// Create a new builder for this type 106 + pub fn new() -> BlobReferenceBuilder<'a, blob_reference_state::Empty> { 107 + BlobReferenceBuilder::new() 108 + } 109 + } 110 + 111 + impl<'a> BlobReferenceBuilder<'a, blob_reference_state::Empty> { 112 + /// Create a new builder with all fields unset 113 + pub fn new() -> Self { 114 + BlobReferenceBuilder { 115 + _phantom_state: ::core::marker::PhantomData, 116 + __unsafe_private_named: (None, None, None, None, None), 117 + _phantom: ::core::marker::PhantomData, 118 + } 119 + } 120 + } 121 + 122 + impl<'a, S: blob_reference_state::State> BlobReferenceBuilder<'a, S> { 123 + /// Set the `annotations` field (optional) 124 + pub fn annotations( 125 + mut self, 126 + value: impl Into<Option<jacquard_common::types::value::Data<'a>>>, 127 + ) -> Self { 128 + self.__unsafe_private_named.0 = value.into(); 129 + self 130 + } 131 + /// Set the `annotations` field to an Option value (optional) 132 + pub fn maybe_annotations( 133 + mut self, 134 + value: Option<jacquard_common::types::value::Data<'a>>, 135 + ) -> Self { 136 + self.__unsafe_private_named.0 = value; 137 + self 138 + } 139 + } 140 + 141 + impl<'a, S> BlobReferenceBuilder<'a, S> 142 + where 143 + S: blob_reference_state::State, 144 + S::Digest: blob_reference_state::IsUnset, 145 + { 146 + /// Set the `digest` field (required) 147 + pub fn digest( 148 + mut self, 149 + value: impl Into<jacquard_common::CowStr<'a>>, 150 + ) -> BlobReferenceBuilder<'a, blob_reference_state::SetDigest<S>> { 151 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 152 + BlobReferenceBuilder { 153 + _phantom_state: ::core::marker::PhantomData, 154 + __unsafe_private_named: self.__unsafe_private_named, 155 + _phantom: ::core::marker::PhantomData, 156 + } 157 + } 158 + } 159 + 160 + impl<'a, S> BlobReferenceBuilder<'a, S> 161 + where 162 + S: blob_reference_state::State, 163 + S::MediaType: blob_reference_state::IsUnset, 164 + { 165 + /// Set the `mediaType` field (required) 166 + pub fn media_type( 167 + mut self, 168 + value: impl Into<jacquard_common::CowStr<'a>>, 169 + ) -> BlobReferenceBuilder<'a, blob_reference_state::SetMediaType<S>> { 170 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 171 + BlobReferenceBuilder { 172 + _phantom_state: ::core::marker::PhantomData, 173 + __unsafe_private_named: self.__unsafe_private_named, 174 + _phantom: ::core::marker::PhantomData, 175 + } 176 + } 177 + } 178 + 179 + impl<'a, S> BlobReferenceBuilder<'a, S> 180 + where 181 + S: blob_reference_state::State, 182 + S::Size: blob_reference_state::IsUnset, 183 + { 184 + /// Set the `size` field (required) 185 + pub fn size( 186 + mut self, 187 + value: impl Into<i64>, 188 + ) -> BlobReferenceBuilder<'a, blob_reference_state::SetSize<S>> { 189 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 190 + BlobReferenceBuilder { 191 + _phantom_state: ::core::marker::PhantomData, 192 + __unsafe_private_named: self.__unsafe_private_named, 193 + _phantom: ::core::marker::PhantomData, 194 + } 195 + } 196 + } 197 + 198 + impl<'a, S: blob_reference_state::State> BlobReferenceBuilder<'a, S> { 199 + /// Set the `urls` field (optional) 200 + pub fn urls( 201 + mut self, 202 + value: impl Into<Option<Vec<jacquard_common::types::string::Uri<'a>>>>, 203 + ) -> Self { 204 + self.__unsafe_private_named.4 = value.into(); 205 + self 206 + } 207 + /// Set the `urls` field to an Option value (optional) 208 + pub fn maybe_urls( 209 + mut self, 210 + value: Option<Vec<jacquard_common::types::string::Uri<'a>>>, 211 + ) -> Self { 212 + self.__unsafe_private_named.4 = value; 213 + self 214 + } 215 + } 216 + 217 + impl<'a, S> BlobReferenceBuilder<'a, S> 218 + where 219 + S: blob_reference_state::State, 220 + S::MediaType: blob_reference_state::IsSet, 221 + S::Size: blob_reference_state::IsSet, 222 + S::Digest: blob_reference_state::IsSet, 223 + { 224 + /// Build the final struct 225 + pub fn build(self) -> BlobReference<'a> { 226 + BlobReference { 227 + annotations: self.__unsafe_private_named.0, 228 + digest: self.__unsafe_private_named.1.unwrap(), 229 + media_type: self.__unsafe_private_named.2.unwrap(), 230 + size: self.__unsafe_private_named.3.unwrap(), 231 + urls: self.__unsafe_private_named.4, 232 + extra_data: Default::default(), 233 + } 234 + } 235 + /// Build the final struct with custom extra_data 236 + pub fn build_with_data( 237 + self, 238 + extra_data: std::collections::BTreeMap< 239 + jacquard_common::smol_str::SmolStr, 240 + jacquard_common::types::value::Data<'a>, 241 + >, 242 + ) -> BlobReference<'a> { 243 + BlobReference { 244 + annotations: self.__unsafe_private_named.0, 245 + digest: self.__unsafe_private_named.1.unwrap(), 246 + media_type: self.__unsafe_private_named.2.unwrap(), 247 + size: self.__unsafe_private_named.3.unwrap(), 248 + urls: self.__unsafe_private_named.4, 249 + extra_data: Some(extra_data), 250 + } 251 + } 252 + } 253 + 254 + fn lexicon_doc_io_atcr_manifest() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 255 + ::jacquard_lexicon::lexicon::LexiconDoc { 256 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 257 + id: ::jacquard_common::CowStr::new_static("io.atcr.manifest"), 258 + revision: None, 259 + description: None, 260 + defs: { 261 + let mut map = ::std::collections::BTreeMap::new(); 262 + map.insert( 263 + ::jacquard_common::smol_str::SmolStr::new_static("blobReference"), 264 + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 265 + description: Some( 266 + ::jacquard_common::CowStr::new_static( 267 + "Reference to a blob stored in S3 or external storage", 268 + ), 269 + ), 270 + required: Some( 271 + vec![ 272 + ::jacquard_common::smol_str::SmolStr::new_static("mediaType"), 273 + ::jacquard_common::smol_str::SmolStr::new_static("size"), 274 + ::jacquard_common::smol_str::SmolStr::new_static("digest") 275 + ], 276 + ), 277 + nullable: None, 278 + properties: { 279 + #[allow(unused_mut)] 280 + let mut map = ::std::collections::BTreeMap::new(); 281 + map.insert( 282 + ::jacquard_common::smol_str::SmolStr::new_static( 283 + "annotations", 284 + ), 285 + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 286 + description: None, 287 + }), 288 + ); 289 + map.insert( 290 + ::jacquard_common::smol_str::SmolStr::new_static("digest"), 291 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 292 + description: Some( 293 + ::jacquard_common::CowStr::new_static( 294 + "Content digest (e.g., 'sha256:...')", 295 + ), 296 + ), 297 + format: None, 298 + default: None, 299 + min_length: None, 300 + max_length: None, 301 + min_graphemes: None, 302 + max_graphemes: None, 303 + r#enum: None, 304 + r#const: None, 305 + known_values: None, 306 + }), 307 + ); 308 + map.insert( 309 + ::jacquard_common::smol_str::SmolStr::new_static( 310 + "mediaType", 311 + ), 312 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 313 + description: Some( 314 + ::jacquard_common::CowStr::new_static( 315 + "MIME type of the blob", 316 + ), 317 + ), 318 + format: None, 319 + default: None, 320 + min_length: None, 321 + max_length: None, 322 + min_graphemes: None, 323 + max_graphemes: None, 324 + r#enum: None, 325 + r#const: None, 326 + known_values: None, 327 + }), 328 + ); 329 + map.insert( 330 + ::jacquard_common::smol_str::SmolStr::new_static("size"), 331 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 332 + description: None, 333 + default: None, 334 + minimum: None, 335 + maximum: None, 336 + r#enum: None, 337 + r#const: None, 338 + }), 339 + ); 340 + map.insert( 341 + ::jacquard_common::smol_str::SmolStr::new_static("urls"), 342 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 343 + description: Some( 344 + ::jacquard_common::CowStr::new_static( 345 + "Optional direct URLs to blob (for BYOS)", 346 + ), 347 + ), 348 + items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 349 + description: None, 350 + format: Some( 351 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 352 + ), 353 + default: None, 354 + min_length: None, 355 + max_length: None, 356 + min_graphemes: None, 357 + max_graphemes: None, 358 + r#enum: None, 359 + r#const: None, 360 + known_values: None, 361 + }), 362 + min_length: None, 363 + max_length: None, 364 + }), 365 + ); 366 + map 367 + }, 368 + }), 369 + ); 370 + map.insert( 371 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 372 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 373 + description: Some( 374 + ::jacquard_common::CowStr::new_static( 375 + "A container image manifest following OCI specification, stored in ATProto", 376 + ), 377 + ), 378 + key: Some(::jacquard_common::CowStr::new_static("tid")), 379 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 380 + description: None, 381 + required: Some( 382 + vec![ 383 + ::jacquard_common::smol_str::SmolStr::new_static("repository"), 384 + ::jacquard_common::smol_str::SmolStr::new_static("digest"), 385 + ::jacquard_common::smol_str::SmolStr::new_static("mediaType"), 386 + ::jacquard_common::smol_str::SmolStr::new_static("schemaVersion"), 387 + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") 388 + ], 389 + ), 390 + nullable: None, 391 + properties: { 392 + #[allow(unused_mut)] 393 + let mut map = ::std::collections::BTreeMap::new(); 394 + map.insert( 395 + ::jacquard_common::smol_str::SmolStr::new_static( 396 + "annotations", 397 + ), 398 + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { 399 + description: None, 400 + }), 401 + ); 402 + map.insert( 403 + ::jacquard_common::smol_str::SmolStr::new_static("config"), 404 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 405 + description: None, 406 + r#ref: ::jacquard_common::CowStr::new_static( 407 + "#blobReference", 408 + ), 409 + }), 410 + ); 411 + map.insert( 412 + ::jacquard_common::smol_str::SmolStr::new_static( 413 + "createdAt", 414 + ), 415 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 416 + description: Some( 417 + ::jacquard_common::CowStr::new_static( 418 + "Record creation timestamp", 419 + ), 420 + ), 421 + format: Some( 422 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 423 + ), 424 + default: None, 425 + min_length: None, 426 + max_length: None, 427 + min_graphemes: None, 428 + max_graphemes: None, 429 + r#enum: None, 430 + r#const: None, 431 + known_values: None, 432 + }), 433 + ); 434 + map.insert( 435 + ::jacquard_common::smol_str::SmolStr::new_static("digest"), 436 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 437 + description: Some( 438 + ::jacquard_common::CowStr::new_static( 439 + "Content digest (e.g., 'sha256:abc123...')", 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("holdDid"), 455 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 456 + description: Some( 457 + ::jacquard_common::CowStr::new_static( 458 + "DID of the hold service where blobs are stored (e.g., 'did:web:hold01.atcr.io'). Primary reference for hold resolution.", 459 + ), 460 + ), 461 + format: Some( 462 + ::jacquard_lexicon::lexicon::LexStringFormat::Did, 463 + ), 464 + default: None, 465 + min_length: None, 466 + max_length: None, 467 + min_graphemes: None, 468 + max_graphemes: None, 469 + r#enum: None, 470 + r#const: None, 471 + known_values: None, 472 + }), 473 + ); 474 + map.insert( 475 + ::jacquard_common::smol_str::SmolStr::new_static( 476 + "holdEndpoint", 477 + ), 478 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 479 + description: Some( 480 + ::jacquard_common::CowStr::new_static( 481 + "Hold service endpoint URL where blobs are stored. DEPRECATED: Use holdDid instead. Kept for backward compatibility.", 482 + ), 483 + ), 484 + format: Some( 485 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 486 + ), 487 + default: None, 488 + min_length: None, 489 + max_length: None, 490 + min_graphemes: None, 491 + max_graphemes: None, 492 + r#enum: None, 493 + r#const: None, 494 + known_values: None, 495 + }), 496 + ); 497 + map.insert( 498 + ::jacquard_common::smol_str::SmolStr::new_static("layers"), 499 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 500 + description: Some( 501 + ::jacquard_common::CowStr::new_static( 502 + "Filesystem layers (for image manifests)", 503 + ), 504 + ), 505 + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 506 + description: None, 507 + r#ref: ::jacquard_common::CowStr::new_static( 508 + "#blobReference", 509 + ), 510 + }), 511 + min_length: None, 512 + max_length: None, 513 + }), 514 + ); 515 + map.insert( 516 + ::jacquard_common::smol_str::SmolStr::new_static( 517 + "manifestBlob", 518 + ), 519 + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 520 + description: None, 521 + accept: None, 522 + max_size: None, 523 + }), 524 + ); 525 + map.insert( 526 + ::jacquard_common::smol_str::SmolStr::new_static( 527 + "manifests", 528 + ), 529 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 530 + description: Some( 531 + ::jacquard_common::CowStr::new_static( 532 + "Referenced manifests (for manifest lists/indexes)", 533 + ), 534 + ), 535 + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 536 + description: None, 537 + r#ref: ::jacquard_common::CowStr::new_static( 538 + "#manifestReference", 539 + ), 540 + }), 541 + min_length: None, 542 + max_length: None, 543 + }), 544 + ); 545 + map.insert( 546 + ::jacquard_common::smol_str::SmolStr::new_static( 547 + "mediaType", 548 + ), 549 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 550 + description: Some( 551 + ::jacquard_common::CowStr::new_static("OCI media type"), 552 + ), 553 + format: None, 554 + default: None, 555 + min_length: None, 556 + max_length: None, 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 + "repository", 567 + ), 568 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 569 + description: Some( 570 + ::jacquard_common::CowStr::new_static( 571 + "Repository name (e.g., 'myapp'). Scoped to user's DID.", 572 + ), 573 + ), 574 + format: None, 575 + default: None, 576 + min_length: None, 577 + max_length: Some(255usize), 578 + min_graphemes: None, 579 + max_graphemes: None, 580 + r#enum: None, 581 + r#const: None, 582 + known_values: None, 583 + }), 584 + ); 585 + map.insert( 586 + ::jacquard_common::smol_str::SmolStr::new_static( 587 + "schemaVersion", 588 + ), 589 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 590 + description: None, 591 + default: None, 592 + minimum: None, 593 + maximum: None, 594 + r#enum: None, 595 + r#const: None, 596 + }), 597 + ); 598 + map.insert( 599 + ::jacquard_common::smol_str::SmolStr::new_static("subject"), 600 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 601 + description: None, 602 + r#ref: ::jacquard_common::CowStr::new_static( 603 + "#blobReference", 604 + ), 605 + }), 606 + ); 607 + map 608 + }, 609 + }), 610 + }), 611 + ); 612 + map.insert( 613 + ::jacquard_common::smol_str::SmolStr::new_static("manifestReference"), 614 + ::jacquard_lexicon::lexicon::LexUserType::Object( 615 + ::jacquard_lexicon::lexicon::LexObject { 616 + description: Some(::jacquard_common::CowStr::new_static( 617 + "Reference to a manifest in a manifest list/index", 618 + )), 619 + required: Some(vec![ 620 + ::jacquard_common::smol_str::SmolStr::new_static("mediaType"), 621 + ::jacquard_common::smol_str::SmolStr::new_static("size"), 622 + ::jacquard_common::smol_str::SmolStr::new_static("digest"), 623 + ]), 624 + nullable: None, 625 + properties: { 626 + #[allow(unused_mut)] 627 + let mut map = ::std::collections::BTreeMap::new(); 628 + map.insert( 629 + ::jacquard_common::smol_str::SmolStr::new_static("annotations"), 630 + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown( 631 + ::jacquard_lexicon::lexicon::LexUnknown { description: None }, 632 + ), 633 + ); 634 + map.insert( 635 + ::jacquard_common::smol_str::SmolStr::new_static("digest"), 636 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 637 + ::jacquard_lexicon::lexicon::LexString { 638 + description: Some(::jacquard_common::CowStr::new_static( 639 + "Content digest (e.g., 'sha256:...')", 640 + )), 641 + format: None, 642 + default: None, 643 + min_length: None, 644 + max_length: None, 645 + min_graphemes: None, 646 + max_graphemes: None, 647 + r#enum: None, 648 + r#const: None, 649 + known_values: None, 650 + }, 651 + ), 652 + ); 653 + map.insert( 654 + ::jacquard_common::smol_str::SmolStr::new_static("mediaType"), 655 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 656 + ::jacquard_lexicon::lexicon::LexString { 657 + description: Some(::jacquard_common::CowStr::new_static( 658 + "Media type of the referenced manifest", 659 + )), 660 + format: None, 661 + default: None, 662 + min_length: None, 663 + max_length: None, 664 + min_graphemes: None, 665 + max_graphemes: None, 666 + r#enum: None, 667 + r#const: None, 668 + known_values: None, 669 + }, 670 + ), 671 + ); 672 + map.insert( 673 + ::jacquard_common::smol_str::SmolStr::new_static("platform"), 674 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( 675 + ::jacquard_lexicon::lexicon::LexRef { 676 + description: None, 677 + r#ref: ::jacquard_common::CowStr::new_static("#platform"), 678 + }, 679 + ), 680 + ); 681 + map.insert( 682 + ::jacquard_common::smol_str::SmolStr::new_static("size"), 683 + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( 684 + ::jacquard_lexicon::lexicon::LexInteger { 685 + description: None, 686 + default: None, 687 + minimum: None, 688 + maximum: None, 689 + r#enum: None, 690 + r#const: None, 691 + }, 692 + ), 693 + ); 694 + map 695 + }, 696 + }, 697 + ), 698 + ); 699 + map.insert( 700 + ::jacquard_common::smol_str::SmolStr::new_static("platform"), 701 + ::jacquard_lexicon::lexicon::LexUserType::Object( 702 + ::jacquard_lexicon::lexicon::LexObject { 703 + description: Some(::jacquard_common::CowStr::new_static( 704 + "Platform information describing OS and architecture", 705 + )), 706 + required: Some(vec![ 707 + ::jacquard_common::smol_str::SmolStr::new_static("architecture"), 708 + ::jacquard_common::smol_str::SmolStr::new_static("os"), 709 + ]), 710 + nullable: None, 711 + properties: { 712 + #[allow(unused_mut)] 713 + let mut map = ::std::collections::BTreeMap::new(); 714 + map.insert( 715 + ::jacquard_common::smol_str::SmolStr::new_static("architecture"), 716 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 717 + ::jacquard_lexicon::lexicon::LexString { 718 + description: Some(::jacquard_common::CowStr::new_static( 719 + "CPU architecture (e.g., 'amd64', 'arm64', 'arm')", 720 + )), 721 + format: None, 722 + default: None, 723 + min_length: None, 724 + max_length: None, 725 + min_graphemes: None, 726 + max_graphemes: None, 727 + r#enum: None, 728 + r#const: None, 729 + known_values: None, 730 + }, 731 + ), 732 + ); 733 + map.insert( 734 + ::jacquard_common::smol_str::SmolStr::new_static("os"), 735 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 736 + ::jacquard_lexicon::lexicon::LexString { 737 + description: Some(::jacquard_common::CowStr::new_static( 738 + "Operating system (e.g., 'linux', 'windows', 'darwin')", 739 + )), 740 + format: None, 741 + default: None, 742 + min_length: None, 743 + max_length: None, 744 + min_graphemes: None, 745 + max_graphemes: None, 746 + r#enum: None, 747 + r#const: None, 748 + known_values: None, 749 + }, 750 + ), 751 + ); 752 + map.insert( 753 + ::jacquard_common::smol_str::SmolStr::new_static("osFeatures"), 754 + ::jacquard_lexicon::lexicon::LexObjectProperty::Array( 755 + ::jacquard_lexicon::lexicon::LexArray { 756 + description: Some(::jacquard_common::CowStr::new_static( 757 + "Optional OS features", 758 + )), 759 + items: ::jacquard_lexicon::lexicon::LexArrayItem::String( 760 + ::jacquard_lexicon::lexicon::LexString { 761 + description: None, 762 + format: None, 763 + default: None, 764 + min_length: None, 765 + max_length: None, 766 + min_graphemes: None, 767 + max_graphemes: None, 768 + r#enum: None, 769 + r#const: None, 770 + known_values: None, 771 + }, 772 + ), 773 + min_length: None, 774 + max_length: None, 775 + }, 776 + ), 777 + ); 778 + map.insert( 779 + ::jacquard_common::smol_str::SmolStr::new_static("osVersion"), 780 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 781 + ::jacquard_lexicon::lexicon::LexString { 782 + description: Some(::jacquard_common::CowStr::new_static( 783 + "Optional OS version", 784 + )), 785 + format: None, 786 + default: None, 787 + min_length: None, 788 + max_length: None, 789 + min_graphemes: None, 790 + max_graphemes: None, 791 + r#enum: None, 792 + r#const: None, 793 + known_values: None, 794 + }, 795 + ), 796 + ); 797 + map.insert( 798 + ::jacquard_common::smol_str::SmolStr::new_static("variant"), 799 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 800 + ::jacquard_lexicon::lexicon::LexString { 801 + description: Some(::jacquard_common::CowStr::new_static( 802 + "Optional CPU variant (e.g., 'v7' for ARM)", 803 + )), 804 + format: None, 805 + default: None, 806 + min_length: None, 807 + max_length: None, 808 + min_graphemes: None, 809 + max_graphemes: None, 810 + r#enum: None, 811 + r#const: None, 812 + known_values: None, 813 + }, 814 + ), 815 + ); 816 + map 817 + }, 818 + }, 819 + ), 820 + ); 821 + map 822 + }, 823 + } 824 + } 825 + 826 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BlobReference<'a> { 827 + fn nsid() -> &'static str { 828 + "io.atcr.manifest" 829 + } 830 + fn def_name() -> &'static str { 831 + "blobReference" 832 + } 833 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 834 + lexicon_doc_io_atcr_manifest() 835 + } 836 + fn validate( 837 + &self, 838 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 839 + Ok(()) 840 + } 841 + } 842 + 843 + /// A container image manifest following OCI specification, stored in ATProto 844 + #[jacquard_derive::lexicon] 845 + #[derive( 846 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 847 + )] 848 + #[serde(rename_all = "camelCase")] 849 + pub struct Manifest<'a> { 850 + /// Optional OCI annotation metadata. Map of string keys to string values (e.g., org.opencontainers.image.title → 'My App'). 851 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 852 + #[serde(borrow)] 853 + pub annotations: std::option::Option<jacquard_common::types::value::Data<'a>>, 854 + /// Reference to image configuration blob 855 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 856 + #[serde(borrow)] 857 + pub config: std::option::Option<crate::io_atcr::manifest::BlobReference<'a>>, 858 + /// Record creation timestamp 859 + pub created_at: jacquard_common::types::string::Datetime, 860 + /// Content digest (e.g., 'sha256:abc123...') 861 + #[serde(borrow)] 862 + pub digest: jacquard_common::CowStr<'a>, 863 + /// DID of the hold service where blobs are stored (e.g., 'did:web:hold01.atcr.io'). Primary reference for hold resolution. 864 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 865 + #[serde(borrow)] 866 + pub hold_did: std::option::Option<jacquard_common::types::string::Did<'a>>, 867 + /// Hold service endpoint URL where blobs are stored. DEPRECATED: Use holdDid instead. Kept for backward compatibility. 868 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 869 + #[serde(borrow)] 870 + pub hold_endpoint: std::option::Option<jacquard_common::types::string::Uri<'a>>, 871 + /// Filesystem layers (for image manifests) 872 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 873 + #[serde(borrow)] 874 + pub layers: std::option::Option<Vec<crate::io_atcr::manifest::BlobReference<'a>>>, 875 + /// The full OCI manifest stored as a blob in ATProto. 876 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 877 + #[serde(borrow)] 878 + pub manifest_blob: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 879 + /// Referenced manifests (for manifest lists/indexes) 880 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 881 + #[serde(borrow)] 882 + pub manifests: std::option::Option<Vec<crate::io_atcr::manifest::ManifestReference<'a>>>, 883 + /// OCI media type 884 + #[serde(borrow)] 885 + pub media_type: jacquard_common::CowStr<'a>, 886 + /// Repository name (e.g., 'myapp'). Scoped to user's DID. 887 + #[serde(borrow)] 888 + pub repository: jacquard_common::CowStr<'a>, 889 + /// OCI schema version (typically 2) 890 + pub schema_version: i64, 891 + /// Optional reference to another manifest (for attestations, signatures) 892 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 893 + #[serde(borrow)] 894 + pub subject: std::option::Option<crate::io_atcr::manifest::BlobReference<'a>>, 895 + } 896 + 897 + pub mod manifest_state { 898 + 899 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 900 + #[allow(unused)] 901 + use ::core::marker::PhantomData; 902 + mod sealed { 903 + pub trait Sealed {} 904 + } 905 + /// State trait tracking which required fields have been set 906 + pub trait State: sealed::Sealed { 907 + type CreatedAt; 908 + type SchemaVersion; 909 + type Repository; 910 + type MediaType; 911 + type Digest; 912 + } 913 + /// Empty state - all required fields are unset 914 + pub struct Empty(()); 915 + impl sealed::Sealed for Empty {} 916 + impl State for Empty { 917 + type CreatedAt = Unset; 918 + type SchemaVersion = Unset; 919 + type Repository = Unset; 920 + type MediaType = Unset; 921 + type Digest = Unset; 922 + } 923 + ///State transition - sets the `created_at` field to Set 924 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 925 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 926 + impl<S: State> State for SetCreatedAt<S> { 927 + type CreatedAt = Set<members::created_at>; 928 + type SchemaVersion = S::SchemaVersion; 929 + type Repository = S::Repository; 930 + type MediaType = S::MediaType; 931 + type Digest = S::Digest; 932 + } 933 + ///State transition - sets the `schema_version` field to Set 934 + pub struct SetSchemaVersion<S: State = Empty>(PhantomData<fn() -> S>); 935 + impl<S: State> sealed::Sealed for SetSchemaVersion<S> {} 936 + impl<S: State> State for SetSchemaVersion<S> { 937 + type CreatedAt = S::CreatedAt; 938 + type SchemaVersion = Set<members::schema_version>; 939 + type Repository = S::Repository; 940 + type MediaType = S::MediaType; 941 + type Digest = S::Digest; 942 + } 943 + ///State transition - sets the `repository` field to Set 944 + pub struct SetRepository<S: State = Empty>(PhantomData<fn() -> S>); 945 + impl<S: State> sealed::Sealed for SetRepository<S> {} 946 + impl<S: State> State for SetRepository<S> { 947 + type CreatedAt = S::CreatedAt; 948 + type SchemaVersion = S::SchemaVersion; 949 + type Repository = Set<members::repository>; 950 + type MediaType = S::MediaType; 951 + type Digest = S::Digest; 952 + } 953 + ///State transition - sets the `media_type` field to Set 954 + pub struct SetMediaType<S: State = Empty>(PhantomData<fn() -> S>); 955 + impl<S: State> sealed::Sealed for SetMediaType<S> {} 956 + impl<S: State> State for SetMediaType<S> { 957 + type CreatedAt = S::CreatedAt; 958 + type SchemaVersion = S::SchemaVersion; 959 + type Repository = S::Repository; 960 + type MediaType = Set<members::media_type>; 961 + type Digest = S::Digest; 962 + } 963 + ///State transition - sets the `digest` field to Set 964 + pub struct SetDigest<S: State = Empty>(PhantomData<fn() -> S>); 965 + impl<S: State> sealed::Sealed for SetDigest<S> {} 966 + impl<S: State> State for SetDigest<S> { 967 + type CreatedAt = S::CreatedAt; 968 + type SchemaVersion = S::SchemaVersion; 969 + type Repository = S::Repository; 970 + type MediaType = S::MediaType; 971 + type Digest = Set<members::digest>; 972 + } 973 + /// Marker types for field names 974 + #[allow(non_camel_case_types)] 975 + pub mod members { 976 + ///Marker type for the `created_at` field 977 + pub struct created_at(()); 978 + ///Marker type for the `schema_version` field 979 + pub struct schema_version(()); 980 + ///Marker type for the `repository` field 981 + pub struct repository(()); 982 + ///Marker type for the `media_type` field 983 + pub struct media_type(()); 984 + ///Marker type for the `digest` field 985 + pub struct digest(()); 986 + } 987 + } 988 + 989 + /// Builder for constructing an instance of this type 990 + pub struct ManifestBuilder<'a, S: manifest_state::State> { 991 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 992 + __unsafe_private_named: ( 993 + ::core::option::Option<jacquard_common::types::value::Data<'a>>, 994 + ::core::option::Option<crate::io_atcr::manifest::BlobReference<'a>>, 995 + ::core::option::Option<jacquard_common::types::string::Datetime>, 996 + ::core::option::Option<jacquard_common::CowStr<'a>>, 997 + ::core::option::Option<jacquard_common::types::string::Did<'a>>, 998 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 999 + ::core::option::Option<Vec<crate::io_atcr::manifest::BlobReference<'a>>>, 1000 + ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 1001 + ::core::option::Option<Vec<crate::io_atcr::manifest::ManifestReference<'a>>>, 1002 + ::core::option::Option<jacquard_common::CowStr<'a>>, 1003 + ::core::option::Option<jacquard_common::CowStr<'a>>, 1004 + ::core::option::Option<i64>, 1005 + ::core::option::Option<crate::io_atcr::manifest::BlobReference<'a>>, 1006 + ), 1007 + _phantom: ::core::marker::PhantomData<&'a ()>, 1008 + } 1009 + 1010 + impl<'a> Manifest<'a> { 1011 + /// Create a new builder for this type 1012 + pub fn new() -> ManifestBuilder<'a, manifest_state::Empty> { 1013 + ManifestBuilder::new() 1014 + } 1015 + } 1016 + 1017 + impl<'a> ManifestBuilder<'a, manifest_state::Empty> { 1018 + /// Create a new builder with all fields unset 1019 + pub fn new() -> Self { 1020 + ManifestBuilder { 1021 + _phantom_state: ::core::marker::PhantomData, 1022 + __unsafe_private_named: ( 1023 + None, None, None, None, None, None, None, None, None, None, None, None, None, 1024 + ), 1025 + _phantom: ::core::marker::PhantomData, 1026 + } 1027 + } 1028 + } 1029 + 1030 + impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { 1031 + /// Set the `annotations` field (optional) 1032 + pub fn annotations( 1033 + mut self, 1034 + value: impl Into<Option<jacquard_common::types::value::Data<'a>>>, 1035 + ) -> Self { 1036 + self.__unsafe_private_named.0 = value.into(); 1037 + self 1038 + } 1039 + /// Set the `annotations` field to an Option value (optional) 1040 + pub fn maybe_annotations( 1041 + mut self, 1042 + value: Option<jacquard_common::types::value::Data<'a>>, 1043 + ) -> Self { 1044 + self.__unsafe_private_named.0 = value; 1045 + self 1046 + } 1047 + } 1048 + 1049 + impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { 1050 + /// Set the `config` field (optional) 1051 + pub fn config( 1052 + mut self, 1053 + value: impl Into<Option<crate::io_atcr::manifest::BlobReference<'a>>>, 1054 + ) -> Self { 1055 + self.__unsafe_private_named.1 = value.into(); 1056 + self 1057 + } 1058 + /// Set the `config` field to an Option value (optional) 1059 + pub fn maybe_config( 1060 + mut self, 1061 + value: Option<crate::io_atcr::manifest::BlobReference<'a>>, 1062 + ) -> Self { 1063 + self.__unsafe_private_named.1 = value; 1064 + self 1065 + } 1066 + } 1067 + 1068 + impl<'a, S> ManifestBuilder<'a, S> 1069 + where 1070 + S: manifest_state::State, 1071 + S::CreatedAt: manifest_state::IsUnset, 1072 + { 1073 + /// Set the `createdAt` field (required) 1074 + pub fn created_at( 1075 + mut self, 1076 + value: impl Into<jacquard_common::types::string::Datetime>, 1077 + ) -> ManifestBuilder<'a, manifest_state::SetCreatedAt<S>> { 1078 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 1079 + ManifestBuilder { 1080 + _phantom_state: ::core::marker::PhantomData, 1081 + __unsafe_private_named: self.__unsafe_private_named, 1082 + _phantom: ::core::marker::PhantomData, 1083 + } 1084 + } 1085 + } 1086 + 1087 + impl<'a, S> ManifestBuilder<'a, S> 1088 + where 1089 + S: manifest_state::State, 1090 + S::Digest: manifest_state::IsUnset, 1091 + { 1092 + /// Set the `digest` field (required) 1093 + pub fn digest( 1094 + mut self, 1095 + value: impl Into<jacquard_common::CowStr<'a>>, 1096 + ) -> ManifestBuilder<'a, manifest_state::SetDigest<S>> { 1097 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 1098 + ManifestBuilder { 1099 + _phantom_state: ::core::marker::PhantomData, 1100 + __unsafe_private_named: self.__unsafe_private_named, 1101 + _phantom: ::core::marker::PhantomData, 1102 + } 1103 + } 1104 + } 1105 + 1106 + impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { 1107 + /// Set the `holdDid` field (optional) 1108 + pub fn hold_did( 1109 + mut self, 1110 + value: impl Into<Option<jacquard_common::types::string::Did<'a>>>, 1111 + ) -> Self { 1112 + self.__unsafe_private_named.4 = value.into(); 1113 + self 1114 + } 1115 + /// Set the `holdDid` field to an Option value (optional) 1116 + pub fn maybe_hold_did( 1117 + mut self, 1118 + value: Option<jacquard_common::types::string::Did<'a>>, 1119 + ) -> Self { 1120 + self.__unsafe_private_named.4 = value; 1121 + self 1122 + } 1123 + } 1124 + 1125 + impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { 1126 + /// Set the `holdEndpoint` field (optional) 1127 + pub fn hold_endpoint( 1128 + mut self, 1129 + value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 1130 + ) -> Self { 1131 + self.__unsafe_private_named.5 = value.into(); 1132 + self 1133 + } 1134 + /// Set the `holdEndpoint` field to an Option value (optional) 1135 + pub fn maybe_hold_endpoint( 1136 + mut self, 1137 + value: Option<jacquard_common::types::string::Uri<'a>>, 1138 + ) -> Self { 1139 + self.__unsafe_private_named.5 = value; 1140 + self 1141 + } 1142 + } 1143 + 1144 + impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { 1145 + /// Set the `layers` field (optional) 1146 + pub fn layers( 1147 + mut self, 1148 + value: impl Into<Option<Vec<crate::io_atcr::manifest::BlobReference<'a>>>>, 1149 + ) -> Self { 1150 + self.__unsafe_private_named.6 = value.into(); 1151 + self 1152 + } 1153 + /// Set the `layers` field to an Option value (optional) 1154 + pub fn maybe_layers( 1155 + mut self, 1156 + value: Option<Vec<crate::io_atcr::manifest::BlobReference<'a>>>, 1157 + ) -> Self { 1158 + self.__unsafe_private_named.6 = value; 1159 + self 1160 + } 1161 + } 1162 + 1163 + impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { 1164 + /// Set the `manifestBlob` field (optional) 1165 + pub fn manifest_blob( 1166 + mut self, 1167 + value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>, 1168 + ) -> Self { 1169 + self.__unsafe_private_named.7 = value.into(); 1170 + self 1171 + } 1172 + /// Set the `manifestBlob` field to an Option value (optional) 1173 + pub fn maybe_manifest_blob( 1174 + mut self, 1175 + value: Option<jacquard_common::types::blob::BlobRef<'a>>, 1176 + ) -> Self { 1177 + self.__unsafe_private_named.7 = value; 1178 + self 1179 + } 1180 + } 1181 + 1182 + impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { 1183 + /// Set the `manifests` field (optional) 1184 + pub fn manifests( 1185 + mut self, 1186 + value: impl Into<Option<Vec<crate::io_atcr::manifest::ManifestReference<'a>>>>, 1187 + ) -> Self { 1188 + self.__unsafe_private_named.8 = value.into(); 1189 + self 1190 + } 1191 + /// Set the `manifests` field to an Option value (optional) 1192 + pub fn maybe_manifests( 1193 + mut self, 1194 + value: Option<Vec<crate::io_atcr::manifest::ManifestReference<'a>>>, 1195 + ) -> Self { 1196 + self.__unsafe_private_named.8 = value; 1197 + self 1198 + } 1199 + } 1200 + 1201 + impl<'a, S> ManifestBuilder<'a, S> 1202 + where 1203 + S: manifest_state::State, 1204 + S::MediaType: manifest_state::IsUnset, 1205 + { 1206 + /// Set the `mediaType` field (required) 1207 + pub fn media_type( 1208 + mut self, 1209 + value: impl Into<jacquard_common::CowStr<'a>>, 1210 + ) -> ManifestBuilder<'a, manifest_state::SetMediaType<S>> { 1211 + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); 1212 + ManifestBuilder { 1213 + _phantom_state: ::core::marker::PhantomData, 1214 + __unsafe_private_named: self.__unsafe_private_named, 1215 + _phantom: ::core::marker::PhantomData, 1216 + } 1217 + } 1218 + } 1219 + 1220 + impl<'a, S> ManifestBuilder<'a, S> 1221 + where 1222 + S: manifest_state::State, 1223 + S::Repository: manifest_state::IsUnset, 1224 + { 1225 + /// Set the `repository` field (required) 1226 + pub fn repository( 1227 + mut self, 1228 + value: impl Into<jacquard_common::CowStr<'a>>, 1229 + ) -> ManifestBuilder<'a, manifest_state::SetRepository<S>> { 1230 + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); 1231 + ManifestBuilder { 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> ManifestBuilder<'a, S> 1240 + where 1241 + S: manifest_state::State, 1242 + S::SchemaVersion: manifest_state::IsUnset, 1243 + { 1244 + /// Set the `schemaVersion` field (required) 1245 + pub fn schema_version( 1246 + mut self, 1247 + value: impl Into<i64>, 1248 + ) -> ManifestBuilder<'a, manifest_state::SetSchemaVersion<S>> { 1249 + self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); 1250 + ManifestBuilder { 1251 + _phantom_state: ::core::marker::PhantomData, 1252 + __unsafe_private_named: self.__unsafe_private_named, 1253 + _phantom: ::core::marker::PhantomData, 1254 + } 1255 + } 1256 + } 1257 + 1258 + impl<'a, S: manifest_state::State> ManifestBuilder<'a, S> { 1259 + /// Set the `subject` field (optional) 1260 + pub fn subject( 1261 + mut self, 1262 + value: impl Into<Option<crate::io_atcr::manifest::BlobReference<'a>>>, 1263 + ) -> Self { 1264 + self.__unsafe_private_named.12 = value.into(); 1265 + self 1266 + } 1267 + /// Set the `subject` field to an Option value (optional) 1268 + pub fn maybe_subject( 1269 + mut self, 1270 + value: Option<crate::io_atcr::manifest::BlobReference<'a>>, 1271 + ) -> Self { 1272 + self.__unsafe_private_named.12 = value; 1273 + self 1274 + } 1275 + } 1276 + 1277 + impl<'a, S> ManifestBuilder<'a, S> 1278 + where 1279 + S: manifest_state::State, 1280 + S::CreatedAt: manifest_state::IsSet, 1281 + S::SchemaVersion: manifest_state::IsSet, 1282 + S::Repository: manifest_state::IsSet, 1283 + S::MediaType: manifest_state::IsSet, 1284 + S::Digest: manifest_state::IsSet, 1285 + { 1286 + /// Build the final struct 1287 + pub fn build(self) -> Manifest<'a> { 1288 + Manifest { 1289 + annotations: self.__unsafe_private_named.0, 1290 + config: self.__unsafe_private_named.1, 1291 + created_at: self.__unsafe_private_named.2.unwrap(), 1292 + digest: self.__unsafe_private_named.3.unwrap(), 1293 + hold_did: self.__unsafe_private_named.4, 1294 + hold_endpoint: self.__unsafe_private_named.5, 1295 + layers: self.__unsafe_private_named.6, 1296 + manifest_blob: self.__unsafe_private_named.7, 1297 + manifests: self.__unsafe_private_named.8, 1298 + media_type: self.__unsafe_private_named.9.unwrap(), 1299 + repository: self.__unsafe_private_named.10.unwrap(), 1300 + schema_version: self.__unsafe_private_named.11.unwrap(), 1301 + subject: self.__unsafe_private_named.12, 1302 + extra_data: Default::default(), 1303 + } 1304 + } 1305 + /// Build the final struct with custom extra_data 1306 + pub fn build_with_data( 1307 + self, 1308 + extra_data: std::collections::BTreeMap< 1309 + jacquard_common::smol_str::SmolStr, 1310 + jacquard_common::types::value::Data<'a>, 1311 + >, 1312 + ) -> Manifest<'a> { 1313 + Manifest { 1314 + annotations: self.__unsafe_private_named.0, 1315 + config: self.__unsafe_private_named.1, 1316 + created_at: self.__unsafe_private_named.2.unwrap(), 1317 + digest: self.__unsafe_private_named.3.unwrap(), 1318 + hold_did: self.__unsafe_private_named.4, 1319 + hold_endpoint: self.__unsafe_private_named.5, 1320 + layers: self.__unsafe_private_named.6, 1321 + manifest_blob: self.__unsafe_private_named.7, 1322 + manifests: self.__unsafe_private_named.8, 1323 + media_type: self.__unsafe_private_named.9.unwrap(), 1324 + repository: self.__unsafe_private_named.10.unwrap(), 1325 + schema_version: self.__unsafe_private_named.11.unwrap(), 1326 + subject: self.__unsafe_private_named.12, 1327 + extra_data: Some(extra_data), 1328 + } 1329 + } 1330 + } 1331 + 1332 + impl<'a> Manifest<'a> { 1333 + pub fn uri( 1334 + uri: impl Into<jacquard_common::CowStr<'a>>, 1335 + ) -> Result< 1336 + jacquard_common::types::uri::RecordUri<'a, ManifestRecord>, 1337 + jacquard_common::types::uri::UriError, 1338 + > { 1339 + jacquard_common::types::uri::RecordUri::try_from_uri( 1340 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 1341 + ) 1342 + } 1343 + } 1344 + 1345 + /// Typed wrapper for GetRecord response with this collection's record type. 1346 + #[derive( 1347 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 1348 + )] 1349 + #[serde(rename_all = "camelCase")] 1350 + pub struct ManifestGetRecordOutput<'a> { 1351 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1352 + #[serde(borrow)] 1353 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 1354 + #[serde(borrow)] 1355 + pub uri: jacquard_common::types::string::AtUri<'a>, 1356 + #[serde(borrow)] 1357 + pub value: Manifest<'a>, 1358 + } 1359 + 1360 + impl From<ManifestGetRecordOutput<'_>> for Manifest<'_> { 1361 + fn from(output: ManifestGetRecordOutput<'_>) -> Self { 1362 + use jacquard_common::IntoStatic; 1363 + output.value.into_static() 1364 + } 1365 + } 1366 + 1367 + impl jacquard_common::types::collection::Collection for Manifest<'_> { 1368 + const NSID: &'static str = "io.atcr.manifest"; 1369 + type Record = ManifestRecord; 1370 + } 1371 + 1372 + /// Marker type for deserializing records from this collection. 1373 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 1374 + pub struct ManifestRecord; 1375 + impl jacquard_common::xrpc::XrpcResp for ManifestRecord { 1376 + const NSID: &'static str = "io.atcr.manifest"; 1377 + const ENCODING: &'static str = "application/json"; 1378 + type Output<'de> = ManifestGetRecordOutput<'de>; 1379 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 1380 + } 1381 + 1382 + impl jacquard_common::types::collection::Collection for ManifestRecord { 1383 + const NSID: &'static str = "io.atcr.manifest"; 1384 + type Record = ManifestRecord; 1385 + } 1386 + 1387 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Manifest<'a> { 1388 + fn nsid() -> &'static str { 1389 + "io.atcr.manifest" 1390 + } 1391 + fn def_name() -> &'static str { 1392 + "main" 1393 + } 1394 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1395 + lexicon_doc_io_atcr_manifest() 1396 + } 1397 + fn validate( 1398 + &self, 1399 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1400 + { 1401 + let value = &self.repository; 1402 + #[allow(unused_comparisons)] 1403 + if <str>::len(value.as_ref()) > 255usize { 1404 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 1405 + path: ::jacquard_lexicon::validation::ValidationPath::from_field("repository"), 1406 + max: 255usize, 1407 + actual: <str>::len(value.as_ref()), 1408 + }); 1409 + } 1410 + } 1411 + Ok(()) 1412 + } 1413 + } 1414 + 1415 + /// Reference to a manifest in a manifest list/index 1416 + #[jacquard_derive::lexicon] 1417 + #[derive( 1418 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 1419 + )] 1420 + #[serde(rename_all = "camelCase")] 1421 + pub struct ManifestReference<'a> { 1422 + /// Optional OCI annotation metadata. Map of string keys to string values. 1423 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1424 + #[serde(borrow)] 1425 + pub annotations: std::option::Option<jacquard_common::types::value::Data<'a>>, 1426 + /// Content digest (e.g., 'sha256:...') 1427 + #[serde(borrow)] 1428 + pub digest: jacquard_common::CowStr<'a>, 1429 + /// Media type of the referenced manifest 1430 + #[serde(borrow)] 1431 + pub media_type: jacquard_common::CowStr<'a>, 1432 + /// Platform information for this manifest 1433 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1434 + #[serde(borrow)] 1435 + pub platform: std::option::Option<crate::io_atcr::manifest::Platform<'a>>, 1436 + /// Size in bytes 1437 + pub size: i64, 1438 + } 1439 + 1440 + pub mod manifest_reference_state { 1441 + 1442 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 1443 + #[allow(unused)] 1444 + use ::core::marker::PhantomData; 1445 + mod sealed { 1446 + pub trait Sealed {} 1447 + } 1448 + /// State trait tracking which required fields have been set 1449 + pub trait State: sealed::Sealed { 1450 + type Digest; 1451 + type Size; 1452 + type MediaType; 1453 + } 1454 + /// Empty state - all required fields are unset 1455 + pub struct Empty(()); 1456 + impl sealed::Sealed for Empty {} 1457 + impl State for Empty { 1458 + type Digest = Unset; 1459 + type Size = Unset; 1460 + type MediaType = Unset; 1461 + } 1462 + ///State transition - sets the `digest` field to Set 1463 + pub struct SetDigest<S: State = Empty>(PhantomData<fn() -> S>); 1464 + impl<S: State> sealed::Sealed for SetDigest<S> {} 1465 + impl<S: State> State for SetDigest<S> { 1466 + type Digest = Set<members::digest>; 1467 + type Size = S::Size; 1468 + type MediaType = S::MediaType; 1469 + } 1470 + ///State transition - sets the `size` field to Set 1471 + pub struct SetSize<S: State = Empty>(PhantomData<fn() -> S>); 1472 + impl<S: State> sealed::Sealed for SetSize<S> {} 1473 + impl<S: State> State for SetSize<S> { 1474 + type Digest = S::Digest; 1475 + type Size = Set<members::size>; 1476 + type MediaType = S::MediaType; 1477 + } 1478 + ///State transition - sets the `media_type` field to Set 1479 + pub struct SetMediaType<S: State = Empty>(PhantomData<fn() -> S>); 1480 + impl<S: State> sealed::Sealed for SetMediaType<S> {} 1481 + impl<S: State> State for SetMediaType<S> { 1482 + type Digest = S::Digest; 1483 + type Size = S::Size; 1484 + type MediaType = Set<members::media_type>; 1485 + } 1486 + /// Marker types for field names 1487 + #[allow(non_camel_case_types)] 1488 + pub mod members { 1489 + ///Marker type for the `digest` field 1490 + pub struct digest(()); 1491 + ///Marker type for the `size` field 1492 + pub struct size(()); 1493 + ///Marker type for the `media_type` field 1494 + pub struct media_type(()); 1495 + } 1496 + } 1497 + 1498 + /// Builder for constructing an instance of this type 1499 + pub struct ManifestReferenceBuilder<'a, S: manifest_reference_state::State> { 1500 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 1501 + __unsafe_private_named: ( 1502 + ::core::option::Option<jacquard_common::types::value::Data<'a>>, 1503 + ::core::option::Option<jacquard_common::CowStr<'a>>, 1504 + ::core::option::Option<jacquard_common::CowStr<'a>>, 1505 + ::core::option::Option<crate::io_atcr::manifest::Platform<'a>>, 1506 + ::core::option::Option<i64>, 1507 + ), 1508 + _phantom: ::core::marker::PhantomData<&'a ()>, 1509 + } 1510 + 1511 + impl<'a> ManifestReference<'a> { 1512 + /// Create a new builder for this type 1513 + pub fn new() -> ManifestReferenceBuilder<'a, manifest_reference_state::Empty> { 1514 + ManifestReferenceBuilder::new() 1515 + } 1516 + } 1517 + 1518 + impl<'a> ManifestReferenceBuilder<'a, manifest_reference_state::Empty> { 1519 + /// Create a new builder with all fields unset 1520 + pub fn new() -> Self { 1521 + ManifestReferenceBuilder { 1522 + _phantom_state: ::core::marker::PhantomData, 1523 + __unsafe_private_named: (None, None, None, None, None), 1524 + _phantom: ::core::marker::PhantomData, 1525 + } 1526 + } 1527 + } 1528 + 1529 + impl<'a, S: manifest_reference_state::State> ManifestReferenceBuilder<'a, S> { 1530 + /// Set the `annotations` field (optional) 1531 + pub fn annotations( 1532 + mut self, 1533 + value: impl Into<Option<jacquard_common::types::value::Data<'a>>>, 1534 + ) -> Self { 1535 + self.__unsafe_private_named.0 = value.into(); 1536 + self 1537 + } 1538 + /// Set the `annotations` field to an Option value (optional) 1539 + pub fn maybe_annotations( 1540 + mut self, 1541 + value: Option<jacquard_common::types::value::Data<'a>>, 1542 + ) -> Self { 1543 + self.__unsafe_private_named.0 = value; 1544 + self 1545 + } 1546 + } 1547 + 1548 + impl<'a, S> ManifestReferenceBuilder<'a, S> 1549 + where 1550 + S: manifest_reference_state::State, 1551 + S::Digest: manifest_reference_state::IsUnset, 1552 + { 1553 + /// Set the `digest` field (required) 1554 + pub fn digest( 1555 + mut self, 1556 + value: impl Into<jacquard_common::CowStr<'a>>, 1557 + ) -> ManifestReferenceBuilder<'a, manifest_reference_state::SetDigest<S>> { 1558 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 1559 + ManifestReferenceBuilder { 1560 + _phantom_state: ::core::marker::PhantomData, 1561 + __unsafe_private_named: self.__unsafe_private_named, 1562 + _phantom: ::core::marker::PhantomData, 1563 + } 1564 + } 1565 + } 1566 + 1567 + impl<'a, S> ManifestReferenceBuilder<'a, S> 1568 + where 1569 + S: manifest_reference_state::State, 1570 + S::MediaType: manifest_reference_state::IsUnset, 1571 + { 1572 + /// Set the `mediaType` field (required) 1573 + pub fn media_type( 1574 + mut self, 1575 + value: impl Into<jacquard_common::CowStr<'a>>, 1576 + ) -> ManifestReferenceBuilder<'a, manifest_reference_state::SetMediaType<S>> { 1577 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 1578 + ManifestReferenceBuilder { 1579 + _phantom_state: ::core::marker::PhantomData, 1580 + __unsafe_private_named: self.__unsafe_private_named, 1581 + _phantom: ::core::marker::PhantomData, 1582 + } 1583 + } 1584 + } 1585 + 1586 + impl<'a, S: manifest_reference_state::State> ManifestReferenceBuilder<'a, S> { 1587 + /// Set the `platform` field (optional) 1588 + pub fn platform( 1589 + mut self, 1590 + value: impl Into<Option<crate::io_atcr::manifest::Platform<'a>>>, 1591 + ) -> Self { 1592 + self.__unsafe_private_named.3 = value.into(); 1593 + self 1594 + } 1595 + /// Set the `platform` field to an Option value (optional) 1596 + pub fn maybe_platform(mut self, value: Option<crate::io_atcr::manifest::Platform<'a>>) -> Self { 1597 + self.__unsafe_private_named.3 = value; 1598 + self 1599 + } 1600 + } 1601 + 1602 + impl<'a, S> ManifestReferenceBuilder<'a, S> 1603 + where 1604 + S: manifest_reference_state::State, 1605 + S::Size: manifest_reference_state::IsUnset, 1606 + { 1607 + /// Set the `size` field (required) 1608 + pub fn size( 1609 + mut self, 1610 + value: impl Into<i64>, 1611 + ) -> ManifestReferenceBuilder<'a, manifest_reference_state::SetSize<S>> { 1612 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 1613 + ManifestReferenceBuilder { 1614 + _phantom_state: ::core::marker::PhantomData, 1615 + __unsafe_private_named: self.__unsafe_private_named, 1616 + _phantom: ::core::marker::PhantomData, 1617 + } 1618 + } 1619 + } 1620 + 1621 + impl<'a, S> ManifestReferenceBuilder<'a, S> 1622 + where 1623 + S: manifest_reference_state::State, 1624 + S::Digest: manifest_reference_state::IsSet, 1625 + S::Size: manifest_reference_state::IsSet, 1626 + S::MediaType: manifest_reference_state::IsSet, 1627 + { 1628 + /// Build the final struct 1629 + pub fn build(self) -> ManifestReference<'a> { 1630 + ManifestReference { 1631 + annotations: self.__unsafe_private_named.0, 1632 + digest: self.__unsafe_private_named.1.unwrap(), 1633 + media_type: self.__unsafe_private_named.2.unwrap(), 1634 + platform: self.__unsafe_private_named.3, 1635 + size: self.__unsafe_private_named.4.unwrap(), 1636 + extra_data: Default::default(), 1637 + } 1638 + } 1639 + /// Build the final struct with custom extra_data 1640 + pub fn build_with_data( 1641 + self, 1642 + extra_data: std::collections::BTreeMap< 1643 + jacquard_common::smol_str::SmolStr, 1644 + jacquard_common::types::value::Data<'a>, 1645 + >, 1646 + ) -> ManifestReference<'a> { 1647 + ManifestReference { 1648 + annotations: self.__unsafe_private_named.0, 1649 + digest: self.__unsafe_private_named.1.unwrap(), 1650 + media_type: self.__unsafe_private_named.2.unwrap(), 1651 + platform: self.__unsafe_private_named.3, 1652 + size: self.__unsafe_private_named.4.unwrap(), 1653 + extra_data: Some(extra_data), 1654 + } 1655 + } 1656 + } 1657 + 1658 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ManifestReference<'a> { 1659 + fn nsid() -> &'static str { 1660 + "io.atcr.manifest" 1661 + } 1662 + fn def_name() -> &'static str { 1663 + "manifestReference" 1664 + } 1665 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1666 + lexicon_doc_io_atcr_manifest() 1667 + } 1668 + fn validate( 1669 + &self, 1670 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1671 + Ok(()) 1672 + } 1673 + } 1674 + 1675 + /// Platform information describing OS and architecture 1676 + #[jacquard_derive::lexicon] 1677 + #[derive( 1678 + serde::Serialize, 1679 + serde::Deserialize, 1680 + Debug, 1681 + Clone, 1682 + PartialEq, 1683 + Eq, 1684 + jacquard_derive::IntoStatic, 1685 + Default, 1686 + )] 1687 + #[serde(rename_all = "camelCase")] 1688 + pub struct Platform<'a> { 1689 + /// CPU architecture (e.g., 'amd64', 'arm64', 'arm') 1690 + #[serde(borrow)] 1691 + pub architecture: jacquard_common::CowStr<'a>, 1692 + /// Operating system (e.g., 'linux', 'windows', 'darwin') 1693 + #[serde(borrow)] 1694 + pub os: jacquard_common::CowStr<'a>, 1695 + /// Optional OS features 1696 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1697 + #[serde(borrow)] 1698 + pub os_features: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 1699 + /// Optional OS version 1700 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1701 + #[serde(borrow)] 1702 + pub os_version: std::option::Option<jacquard_common::CowStr<'a>>, 1703 + /// Optional CPU variant (e.g., 'v7' for ARM) 1704 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 1705 + #[serde(borrow)] 1706 + pub variant: std::option::Option<jacquard_common::CowStr<'a>>, 1707 + } 1708 + 1709 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Platform<'a> { 1710 + fn nsid() -> &'static str { 1711 + "io.atcr.manifest" 1712 + } 1713 + fn def_name() -> &'static str { 1714 + "platform" 1715 + } 1716 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 1717 + lexicon_doc_io_atcr_manifest() 1718 + } 1719 + fn validate( 1720 + &self, 1721 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 1722 + Ok(()) 1723 + } 1724 + }
+7
crates/jacquard-api/src/io_atcr/sailor.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 profile; 7 + pub mod star;
+352
crates/jacquard-api/src/io_atcr/sailor/profile.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: io.atcr.sailor.profile 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// User profile for ATCR registry. Stores preferences like default hold for blob storage. 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct Profile<'a> { 15 + /// Profile creation timestamp 16 + pub created_at: jacquard_common::types::string::Datetime, 17 + /// Default hold endpoint for blob storage. If null, user has opted out of defaults. 18 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 19 + #[serde(borrow)] 20 + pub default_hold: std::option::Option<jacquard_common::types::string::Uri<'a>>, 21 + /// Profile last updated timestamp 22 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 + pub updated_at: std::option::Option<jacquard_common::types::string::Datetime>, 24 + } 25 + 26 + pub mod profile_state { 27 + 28 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 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 CreatedAt; 37 + } 38 + /// Empty state - all required fields are unset 39 + pub struct Empty(()); 40 + impl sealed::Sealed for Empty {} 41 + impl State for Empty { 42 + type CreatedAt = Unset; 43 + } 44 + ///State transition - sets the `created_at` field to Set 45 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 46 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 47 + impl<S: State> State for SetCreatedAt<S> { 48 + type CreatedAt = Set<members::created_at>; 49 + } 50 + /// Marker types for field names 51 + #[allow(non_camel_case_types)] 52 + pub mod members { 53 + ///Marker type for the `created_at` field 54 + pub struct created_at(()); 55 + } 56 + } 57 + 58 + /// Builder for constructing an instance of this type 59 + pub struct ProfileBuilder<'a, S: profile_state::State> { 60 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 61 + __unsafe_private_named: ( 62 + ::core::option::Option<jacquard_common::types::string::Datetime>, 63 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 64 + ::core::option::Option<jacquard_common::types::string::Datetime>, 65 + ), 66 + _phantom: ::core::marker::PhantomData<&'a ()>, 67 + } 68 + 69 + impl<'a> Profile<'a> { 70 + /// Create a new builder for this type 71 + pub fn new() -> ProfileBuilder<'a, profile_state::Empty> { 72 + ProfileBuilder::new() 73 + } 74 + } 75 + 76 + impl<'a> ProfileBuilder<'a, profile_state::Empty> { 77 + /// Create a new builder with all fields unset 78 + pub fn new() -> Self { 79 + ProfileBuilder { 80 + _phantom_state: ::core::marker::PhantomData, 81 + __unsafe_private_named: (None, None, None), 82 + _phantom: ::core::marker::PhantomData, 83 + } 84 + } 85 + } 86 + 87 + impl<'a, S> ProfileBuilder<'a, S> 88 + where 89 + S: profile_state::State, 90 + S::CreatedAt: profile_state::IsUnset, 91 + { 92 + /// Set the `createdAt` field (required) 93 + pub fn created_at( 94 + mut self, 95 + value: impl Into<jacquard_common::types::string::Datetime>, 96 + ) -> ProfileBuilder<'a, profile_state::SetCreatedAt<S>> { 97 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 98 + ProfileBuilder { 99 + _phantom_state: ::core::marker::PhantomData, 100 + __unsafe_private_named: self.__unsafe_private_named, 101 + _phantom: ::core::marker::PhantomData, 102 + } 103 + } 104 + } 105 + 106 + impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 107 + /// Set the `defaultHold` field (optional) 108 + pub fn default_hold( 109 + mut self, 110 + value: impl Into<Option<jacquard_common::types::string::Uri<'a>>>, 111 + ) -> Self { 112 + self.__unsafe_private_named.1 = value.into(); 113 + self 114 + } 115 + /// Set the `defaultHold` field to an Option value (optional) 116 + pub fn maybe_default_hold( 117 + mut self, 118 + value: Option<jacquard_common::types::string::Uri<'a>>, 119 + ) -> Self { 120 + self.__unsafe_private_named.1 = value; 121 + self 122 + } 123 + } 124 + 125 + impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 126 + /// Set the `updatedAt` field (optional) 127 + pub fn updated_at( 128 + mut self, 129 + value: impl Into<Option<jacquard_common::types::string::Datetime>>, 130 + ) -> Self { 131 + self.__unsafe_private_named.2 = value.into(); 132 + self 133 + } 134 + /// Set the `updatedAt` field to an Option value (optional) 135 + pub fn maybe_updated_at( 136 + mut self, 137 + value: Option<jacquard_common::types::string::Datetime>, 138 + ) -> Self { 139 + self.__unsafe_private_named.2 = value; 140 + self 141 + } 142 + } 143 + 144 + impl<'a, S> ProfileBuilder<'a, S> 145 + where 146 + S: profile_state::State, 147 + S::CreatedAt: profile_state::IsSet, 148 + { 149 + /// Build the final struct 150 + pub fn build(self) -> Profile<'a> { 151 + Profile { 152 + created_at: self.__unsafe_private_named.0.unwrap(), 153 + default_hold: self.__unsafe_private_named.1, 154 + updated_at: self.__unsafe_private_named.2, 155 + extra_data: Default::default(), 156 + } 157 + } 158 + /// Build the final struct with custom extra_data 159 + pub fn build_with_data( 160 + self, 161 + extra_data: std::collections::BTreeMap< 162 + jacquard_common::smol_str::SmolStr, 163 + jacquard_common::types::value::Data<'a>, 164 + >, 165 + ) -> Profile<'a> { 166 + Profile { 167 + created_at: self.__unsafe_private_named.0.unwrap(), 168 + default_hold: self.__unsafe_private_named.1, 169 + updated_at: self.__unsafe_private_named.2, 170 + extra_data: Some(extra_data), 171 + } 172 + } 173 + } 174 + 175 + impl<'a> Profile<'a> { 176 + pub fn uri( 177 + uri: impl Into<jacquard_common::CowStr<'a>>, 178 + ) -> Result< 179 + jacquard_common::types::uri::RecordUri<'a, ProfileRecord>, 180 + jacquard_common::types::uri::UriError, 181 + > { 182 + jacquard_common::types::uri::RecordUri::try_from_uri( 183 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 184 + ) 185 + } 186 + } 187 + 188 + /// Typed wrapper for GetRecord response with this collection's record type. 189 + #[derive( 190 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 191 + )] 192 + #[serde(rename_all = "camelCase")] 193 + pub struct ProfileGetRecordOutput<'a> { 194 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 195 + #[serde(borrow)] 196 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 197 + #[serde(borrow)] 198 + pub uri: jacquard_common::types::string::AtUri<'a>, 199 + #[serde(borrow)] 200 + pub value: Profile<'a>, 201 + } 202 + 203 + impl From<ProfileGetRecordOutput<'_>> for Profile<'_> { 204 + fn from(output: ProfileGetRecordOutput<'_>) -> Self { 205 + use jacquard_common::IntoStatic; 206 + output.value.into_static() 207 + } 208 + } 209 + 210 + impl jacquard_common::types::collection::Collection for Profile<'_> { 211 + const NSID: &'static str = "io.atcr.sailor.profile"; 212 + type Record = ProfileRecord; 213 + } 214 + 215 + /// Marker type for deserializing records from this collection. 216 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 217 + pub struct ProfileRecord; 218 + impl jacquard_common::xrpc::XrpcResp for ProfileRecord { 219 + const NSID: &'static str = "io.atcr.sailor.profile"; 220 + const ENCODING: &'static str = "application/json"; 221 + type Output<'de> = ProfileGetRecordOutput<'de>; 222 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 223 + } 224 + 225 + impl jacquard_common::types::collection::Collection for ProfileRecord { 226 + const NSID: &'static str = "io.atcr.sailor.profile"; 227 + type Record = ProfileRecord; 228 + } 229 + 230 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Profile<'a> { 231 + fn nsid() -> &'static str { 232 + "io.atcr.sailor.profile" 233 + } 234 + fn def_name() -> &'static str { 235 + "main" 236 + } 237 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 238 + lexicon_doc_io_atcr_sailor_profile() 239 + } 240 + fn validate( 241 + &self, 242 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 243 + Ok(()) 244 + } 245 + } 246 + 247 + fn lexicon_doc_io_atcr_sailor_profile() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 248 + ::jacquard_lexicon::lexicon::LexiconDoc { 249 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 250 + id: ::jacquard_common::CowStr::new_static("io.atcr.sailor.profile"), 251 + revision: None, 252 + description: None, 253 + defs: { 254 + let mut map = ::std::collections::BTreeMap::new(); 255 + map.insert( 256 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 257 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 258 + description: Some( 259 + ::jacquard_common::CowStr::new_static( 260 + "User profile for ATCR registry. Stores preferences like default hold for blob storage.", 261 + ), 262 + ), 263 + key: Some(::jacquard_common::CowStr::new_static("literal:self")), 264 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 265 + description: None, 266 + required: Some( 267 + vec![ 268 + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") 269 + ], 270 + ), 271 + nullable: None, 272 + properties: { 273 + #[allow(unused_mut)] 274 + let mut map = ::std::collections::BTreeMap::new(); 275 + map.insert( 276 + ::jacquard_common::smol_str::SmolStr::new_static( 277 + "createdAt", 278 + ), 279 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 280 + description: Some( 281 + ::jacquard_common::CowStr::new_static( 282 + "Profile creation timestamp", 283 + ), 284 + ), 285 + format: Some( 286 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 287 + ), 288 + default: None, 289 + min_length: None, 290 + max_length: None, 291 + min_graphemes: None, 292 + max_graphemes: None, 293 + r#enum: None, 294 + r#const: None, 295 + known_values: None, 296 + }), 297 + ); 298 + map.insert( 299 + ::jacquard_common::smol_str::SmolStr::new_static( 300 + "defaultHold", 301 + ), 302 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 303 + description: Some( 304 + ::jacquard_common::CowStr::new_static( 305 + "Default hold endpoint for blob storage. If null, user has opted out of defaults.", 306 + ), 307 + ), 308 + format: Some( 309 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 310 + ), 311 + default: None, 312 + min_length: None, 313 + max_length: None, 314 + min_graphemes: None, 315 + max_graphemes: None, 316 + r#enum: None, 317 + r#const: None, 318 + known_values: None, 319 + }), 320 + ); 321 + map.insert( 322 + ::jacquard_common::smol_str::SmolStr::new_static( 323 + "updatedAt", 324 + ), 325 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 326 + description: Some( 327 + ::jacquard_common::CowStr::new_static( 328 + "Profile last updated timestamp", 329 + ), 330 + ), 331 + format: Some( 332 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 333 + ), 334 + default: None, 335 + min_length: None, 336 + max_length: None, 337 + min_graphemes: None, 338 + max_graphemes: None, 339 + r#enum: None, 340 + r#const: None, 341 + known_values: None, 342 + }), 343 + ); 344 + map 345 + }, 346 + }), 347 + }), 348 + ); 349 + map 350 + }, 351 + } 352 + }
+544
crates/jacquard-api/src/io_atcr/sailor/star.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: io.atcr.sailor.star 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// A star (like) on a container image repository. Stored in the starrer's PDS, similar to Bluesky likes. 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct Star<'a> { 15 + /// Star creation timestamp 16 + pub created_at: jacquard_common::types::string::Datetime, 17 + /// The repository being starred 18 + #[serde(borrow)] 19 + pub subject: crate::io_atcr::sailor::star::Subject<'a>, 20 + } 21 + 22 + pub mod star_state { 23 + 24 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 25 + #[allow(unused)] 26 + use ::core::marker::PhantomData; 27 + mod sealed { 28 + pub trait Sealed {} 29 + } 30 + /// State trait tracking which required fields have been set 31 + pub trait State: sealed::Sealed { 32 + type Subject; 33 + type CreatedAt; 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 Subject = Unset; 40 + type CreatedAt = Unset; 41 + } 42 + ///State transition - sets the `subject` field to Set 43 + pub struct SetSubject<S: State = Empty>(PhantomData<fn() -> S>); 44 + impl<S: State> sealed::Sealed for SetSubject<S> {} 45 + impl<S: State> State for SetSubject<S> { 46 + type Subject = Set<members::subject>; 47 + type CreatedAt = S::CreatedAt; 48 + } 49 + ///State transition - sets the `created_at` field to Set 50 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 51 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 52 + impl<S: State> State for SetCreatedAt<S> { 53 + type Subject = S::Subject; 54 + type CreatedAt = Set<members::created_at>; 55 + } 56 + /// Marker types for field names 57 + #[allow(non_camel_case_types)] 58 + pub mod members { 59 + ///Marker type for the `subject` field 60 + pub struct subject(()); 61 + ///Marker type for the `created_at` field 62 + pub struct created_at(()); 63 + } 64 + } 65 + 66 + /// Builder for constructing an instance of this type 67 + pub struct StarBuilder<'a, S: star_state::State> { 68 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 69 + __unsafe_private_named: ( 70 + ::core::option::Option<jacquard_common::types::string::Datetime>, 71 + ::core::option::Option<crate::io_atcr::sailor::star::Subject<'a>>, 72 + ), 73 + _phantom: ::core::marker::PhantomData<&'a ()>, 74 + } 75 + 76 + impl<'a> Star<'a> { 77 + /// Create a new builder for this type 78 + pub fn new() -> StarBuilder<'a, star_state::Empty> { 79 + StarBuilder::new() 80 + } 81 + } 82 + 83 + impl<'a> StarBuilder<'a, star_state::Empty> { 84 + /// Create a new builder with all fields unset 85 + pub fn new() -> Self { 86 + StarBuilder { 87 + _phantom_state: ::core::marker::PhantomData, 88 + __unsafe_private_named: (None, None), 89 + _phantom: ::core::marker::PhantomData, 90 + } 91 + } 92 + } 93 + 94 + impl<'a, S> StarBuilder<'a, S> 95 + where 96 + S: star_state::State, 97 + S::CreatedAt: star_state::IsUnset, 98 + { 99 + /// Set the `createdAt` field (required) 100 + pub fn created_at( 101 + mut self, 102 + value: impl Into<jacquard_common::types::string::Datetime>, 103 + ) -> StarBuilder<'a, star_state::SetCreatedAt<S>> { 104 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 105 + StarBuilder { 106 + _phantom_state: ::core::marker::PhantomData, 107 + __unsafe_private_named: self.__unsafe_private_named, 108 + _phantom: ::core::marker::PhantomData, 109 + } 110 + } 111 + } 112 + 113 + impl<'a, S> StarBuilder<'a, S> 114 + where 115 + S: star_state::State, 116 + S::Subject: star_state::IsUnset, 117 + { 118 + /// Set the `subject` field (required) 119 + pub fn subject( 120 + mut self, 121 + value: impl Into<crate::io_atcr::sailor::star::Subject<'a>>, 122 + ) -> StarBuilder<'a, star_state::SetSubject<S>> { 123 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 124 + StarBuilder { 125 + _phantom_state: ::core::marker::PhantomData, 126 + __unsafe_private_named: self.__unsafe_private_named, 127 + _phantom: ::core::marker::PhantomData, 128 + } 129 + } 130 + } 131 + 132 + impl<'a, S> StarBuilder<'a, S> 133 + where 134 + S: star_state::State, 135 + S::Subject: star_state::IsSet, 136 + S::CreatedAt: star_state::IsSet, 137 + { 138 + /// Build the final struct 139 + pub fn build(self) -> Star<'a> { 140 + Star { 141 + created_at: self.__unsafe_private_named.0.unwrap(), 142 + subject: self.__unsafe_private_named.1.unwrap(), 143 + extra_data: Default::default(), 144 + } 145 + } 146 + /// Build the final struct with custom extra_data 147 + pub fn build_with_data( 148 + self, 149 + extra_data: std::collections::BTreeMap< 150 + jacquard_common::smol_str::SmolStr, 151 + jacquard_common::types::value::Data<'a>, 152 + >, 153 + ) -> Star<'a> { 154 + Star { 155 + created_at: self.__unsafe_private_named.0.unwrap(), 156 + subject: self.__unsafe_private_named.1.unwrap(), 157 + extra_data: Some(extra_data), 158 + } 159 + } 160 + } 161 + 162 + impl<'a> Star<'a> { 163 + pub fn uri( 164 + uri: impl Into<jacquard_common::CowStr<'a>>, 165 + ) -> Result< 166 + jacquard_common::types::uri::RecordUri<'a, StarRecord>, 167 + jacquard_common::types::uri::UriError, 168 + > { 169 + jacquard_common::types::uri::RecordUri::try_from_uri( 170 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 171 + ) 172 + } 173 + } 174 + 175 + /// Typed wrapper for GetRecord response with this collection's record type. 176 + #[derive( 177 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 178 + )] 179 + #[serde(rename_all = "camelCase")] 180 + pub struct StarGetRecordOutput<'a> { 181 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 182 + #[serde(borrow)] 183 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 184 + #[serde(borrow)] 185 + pub uri: jacquard_common::types::string::AtUri<'a>, 186 + #[serde(borrow)] 187 + pub value: Star<'a>, 188 + } 189 + 190 + impl From<StarGetRecordOutput<'_>> for Star<'_> { 191 + fn from(output: StarGetRecordOutput<'_>) -> Self { 192 + use jacquard_common::IntoStatic; 193 + output.value.into_static() 194 + } 195 + } 196 + 197 + impl jacquard_common::types::collection::Collection for Star<'_> { 198 + const NSID: &'static str = "io.atcr.sailor.star"; 199 + type Record = StarRecord; 200 + } 201 + 202 + /// Marker type for deserializing records from this collection. 203 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 204 + pub struct StarRecord; 205 + impl jacquard_common::xrpc::XrpcResp for StarRecord { 206 + const NSID: &'static str = "io.atcr.sailor.star"; 207 + const ENCODING: &'static str = "application/json"; 208 + type Output<'de> = StarGetRecordOutput<'de>; 209 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 210 + } 211 + 212 + impl jacquard_common::types::collection::Collection for StarRecord { 213 + const NSID: &'static str = "io.atcr.sailor.star"; 214 + type Record = StarRecord; 215 + } 216 + 217 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Star<'a> { 218 + fn nsid() -> &'static str { 219 + "io.atcr.sailor.star" 220 + } 221 + fn def_name() -> &'static str { 222 + "main" 223 + } 224 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 225 + lexicon_doc_io_atcr_sailor_star() 226 + } 227 + fn validate( 228 + &self, 229 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 230 + Ok(()) 231 + } 232 + } 233 + 234 + fn lexicon_doc_io_atcr_sailor_star() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 235 + ::jacquard_lexicon::lexicon::LexiconDoc { 236 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 237 + id: ::jacquard_common::CowStr::new_static("io.atcr.sailor.star"), 238 + revision: None, 239 + description: None, 240 + defs: { 241 + let mut map = ::std::collections::BTreeMap::new(); 242 + map.insert( 243 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 244 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 245 + description: Some( 246 + ::jacquard_common::CowStr::new_static( 247 + "A star (like) on a container image repository. Stored in the starrer's PDS, similar to Bluesky likes.", 248 + ), 249 + ), 250 + key: Some(::jacquard_common::CowStr::new_static("any")), 251 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 252 + description: None, 253 + required: Some( 254 + vec![ 255 + ::jacquard_common::smol_str::SmolStr::new_static("subject"), 256 + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") 257 + ], 258 + ), 259 + nullable: None, 260 + properties: { 261 + #[allow(unused_mut)] 262 + let mut map = ::std::collections::BTreeMap::new(); 263 + map.insert( 264 + ::jacquard_common::smol_str::SmolStr::new_static( 265 + "createdAt", 266 + ), 267 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 268 + description: Some( 269 + ::jacquard_common::CowStr::new_static( 270 + "Star creation timestamp", 271 + ), 272 + ), 273 + format: Some( 274 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 275 + ), 276 + default: None, 277 + min_length: None, 278 + max_length: None, 279 + min_graphemes: None, 280 + max_graphemes: None, 281 + r#enum: None, 282 + r#const: None, 283 + known_values: None, 284 + }), 285 + ); 286 + map.insert( 287 + ::jacquard_common::smol_str::SmolStr::new_static("subject"), 288 + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 289 + description: None, 290 + r#ref: ::jacquard_common::CowStr::new_static("#subject"), 291 + }), 292 + ); 293 + map 294 + }, 295 + }), 296 + }), 297 + ); 298 + map.insert( 299 + ::jacquard_common::smol_str::SmolStr::new_static("subject"), 300 + ::jacquard_lexicon::lexicon::LexUserType::Object( 301 + ::jacquard_lexicon::lexicon::LexObject { 302 + description: Some(::jacquard_common::CowStr::new_static( 303 + "Reference to a repository owned by a user", 304 + )), 305 + required: Some(vec![ 306 + ::jacquard_common::smol_str::SmolStr::new_static("did"), 307 + ::jacquard_common::smol_str::SmolStr::new_static("repository"), 308 + ]), 309 + nullable: None, 310 + properties: { 311 + #[allow(unused_mut)] 312 + let mut map = ::std::collections::BTreeMap::new(); 313 + map.insert( 314 + ::jacquard_common::smol_str::SmolStr::new_static("did"), 315 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 316 + ::jacquard_lexicon::lexicon::LexString { 317 + description: Some(::jacquard_common::CowStr::new_static( 318 + "DID of the repository owner", 319 + )), 320 + format: Some( 321 + ::jacquard_lexicon::lexicon::LexStringFormat::Did, 322 + ), 323 + default: None, 324 + min_length: None, 325 + max_length: None, 326 + min_graphemes: None, 327 + max_graphemes: None, 328 + r#enum: None, 329 + r#const: None, 330 + known_values: None, 331 + }, 332 + ), 333 + ); 334 + map.insert( 335 + ::jacquard_common::smol_str::SmolStr::new_static("repository"), 336 + ::jacquard_lexicon::lexicon::LexObjectProperty::String( 337 + ::jacquard_lexicon::lexicon::LexString { 338 + description: Some(::jacquard_common::CowStr::new_static( 339 + "Repository name (e.g., 'myapp')", 340 + )), 341 + format: None, 342 + default: None, 343 + min_length: None, 344 + max_length: Some(255usize), 345 + min_graphemes: None, 346 + max_graphemes: None, 347 + r#enum: None, 348 + r#const: None, 349 + known_values: None, 350 + }, 351 + ), 352 + ); 353 + map 354 + }, 355 + }, 356 + ), 357 + ); 358 + map 359 + }, 360 + } 361 + } 362 + 363 + /// Reference to a repository owned by a user 364 + #[jacquard_derive::lexicon] 365 + #[derive( 366 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 367 + )] 368 + #[serde(rename_all = "camelCase")] 369 + pub struct Subject<'a> { 370 + /// DID of the repository owner 371 + #[serde(borrow)] 372 + pub did: jacquard_common::types::string::Did<'a>, 373 + /// Repository name (e.g., 'myapp') 374 + #[serde(borrow)] 375 + pub repository: jacquard_common::CowStr<'a>, 376 + } 377 + 378 + pub mod subject_state { 379 + 380 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 381 + #[allow(unused)] 382 + use ::core::marker::PhantomData; 383 + mod sealed { 384 + pub trait Sealed {} 385 + } 386 + /// State trait tracking which required fields have been set 387 + pub trait State: sealed::Sealed { 388 + type Repository; 389 + type Did; 390 + } 391 + /// Empty state - all required fields are unset 392 + pub struct Empty(()); 393 + impl sealed::Sealed for Empty {} 394 + impl State for Empty { 395 + type Repository = Unset; 396 + type Did = Unset; 397 + } 398 + ///State transition - sets the `repository` field to Set 399 + pub struct SetRepository<S: State = Empty>(PhantomData<fn() -> S>); 400 + impl<S: State> sealed::Sealed for SetRepository<S> {} 401 + impl<S: State> State for SetRepository<S> { 402 + type Repository = Set<members::repository>; 403 + type Did = S::Did; 404 + } 405 + ///State transition - sets the `did` field to Set 406 + pub struct SetDid<S: State = Empty>(PhantomData<fn() -> S>); 407 + impl<S: State> sealed::Sealed for SetDid<S> {} 408 + impl<S: State> State for SetDid<S> { 409 + type Repository = S::Repository; 410 + type Did = Set<members::did>; 411 + } 412 + /// Marker types for field names 413 + #[allow(non_camel_case_types)] 414 + pub mod members { 415 + ///Marker type for the `repository` field 416 + pub struct repository(()); 417 + ///Marker type for the `did` field 418 + pub struct did(()); 419 + } 420 + } 421 + 422 + /// Builder for constructing an instance of this type 423 + pub struct SubjectBuilder<'a, S: subject_state::State> { 424 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 425 + __unsafe_private_named: ( 426 + ::core::option::Option<jacquard_common::types::string::Did<'a>>, 427 + ::core::option::Option<jacquard_common::CowStr<'a>>, 428 + ), 429 + _phantom: ::core::marker::PhantomData<&'a ()>, 430 + } 431 + 432 + impl<'a> Subject<'a> { 433 + /// Create a new builder for this type 434 + pub fn new() -> SubjectBuilder<'a, subject_state::Empty> { 435 + SubjectBuilder::new() 436 + } 437 + } 438 + 439 + impl<'a> SubjectBuilder<'a, subject_state::Empty> { 440 + /// Create a new builder with all fields unset 441 + pub fn new() -> Self { 442 + SubjectBuilder { 443 + _phantom_state: ::core::marker::PhantomData, 444 + __unsafe_private_named: (None, None), 445 + _phantom: ::core::marker::PhantomData, 446 + } 447 + } 448 + } 449 + 450 + impl<'a, S> SubjectBuilder<'a, S> 451 + where 452 + S: subject_state::State, 453 + S::Did: subject_state::IsUnset, 454 + { 455 + /// Set the `did` field (required) 456 + pub fn did( 457 + mut self, 458 + value: impl Into<jacquard_common::types::string::Did<'a>>, 459 + ) -> SubjectBuilder<'a, subject_state::SetDid<S>> { 460 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 461 + SubjectBuilder { 462 + _phantom_state: ::core::marker::PhantomData, 463 + __unsafe_private_named: self.__unsafe_private_named, 464 + _phantom: ::core::marker::PhantomData, 465 + } 466 + } 467 + } 468 + 469 + impl<'a, S> SubjectBuilder<'a, S> 470 + where 471 + S: subject_state::State, 472 + S::Repository: subject_state::IsUnset, 473 + { 474 + /// Set the `repository` field (required) 475 + pub fn repository( 476 + mut self, 477 + value: impl Into<jacquard_common::CowStr<'a>>, 478 + ) -> SubjectBuilder<'a, subject_state::SetRepository<S>> { 479 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 480 + SubjectBuilder { 481 + _phantom_state: ::core::marker::PhantomData, 482 + __unsafe_private_named: self.__unsafe_private_named, 483 + _phantom: ::core::marker::PhantomData, 484 + } 485 + } 486 + } 487 + 488 + impl<'a, S> SubjectBuilder<'a, S> 489 + where 490 + S: subject_state::State, 491 + S::Repository: subject_state::IsSet, 492 + S::Did: subject_state::IsSet, 493 + { 494 + /// Build the final struct 495 + pub fn build(self) -> Subject<'a> { 496 + Subject { 497 + did: self.__unsafe_private_named.0.unwrap(), 498 + repository: self.__unsafe_private_named.1.unwrap(), 499 + extra_data: Default::default(), 500 + } 501 + } 502 + /// Build the final struct with custom extra_data 503 + pub fn build_with_data( 504 + self, 505 + extra_data: std::collections::BTreeMap< 506 + jacquard_common::smol_str::SmolStr, 507 + jacquard_common::types::value::Data<'a>, 508 + >, 509 + ) -> Subject<'a> { 510 + Subject { 511 + did: self.__unsafe_private_named.0.unwrap(), 512 + repository: self.__unsafe_private_named.1.unwrap(), 513 + extra_data: Some(extra_data), 514 + } 515 + } 516 + } 517 + 518 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Subject<'a> { 519 + fn nsid() -> &'static str { 520 + "io.atcr.sailor.star" 521 + } 522 + fn def_name() -> &'static str { 523 + "subject" 524 + } 525 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 526 + lexicon_doc_io_atcr_sailor_star() 527 + } 528 + fn validate( 529 + &self, 530 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 531 + { 532 + let value = &self.repository; 533 + #[allow(unused_comparisons)] 534 + if <str>::len(value.as_ref()) > 255usize { 535 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 536 + path: ::jacquard_lexicon::validation::ValidationPath::from_field("repository"), 537 + max: 255usize, 538 + actual: <str>::len(value.as_ref()), 539 + }); 540 + } 541 + } 542 + Ok(()) 543 + } 544 + }
+490
crates/jacquard-api/src/io_atcr/tag.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: io.atcr.tag 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// A named tag pointing to a specific manifest digest 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct Tag<'a> { 15 + /// Tag creation timestamp 16 + pub created_at: jacquard_common::types::string::Datetime, 17 + /// AT-URI of the manifest this tag points to (e.g., 'at://did:plc:xyz/io.atcr.manifest/abc123'). Preferred over manifestDigest for new records. 18 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 19 + #[serde(borrow)] 20 + pub manifest: std::option::Option<jacquard_common::types::string::AtUri<'a>>, 21 + /// DEPRECATED: Digest of the manifest (e.g., 'sha256:...'). Kept for backward compatibility with old records. New records should use 'manifest' field instead. 22 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 + #[serde(borrow)] 24 + pub manifest_digest: std::option::Option<jacquard_common::CowStr<'a>>, 25 + /// Repository name (e.g., 'myapp'). Scoped to user's DID. 26 + #[serde(borrow)] 27 + pub repository: jacquard_common::CowStr<'a>, 28 + /// Tag name (e.g., 'latest', 'v1.0.0', '12-slim') 29 + #[serde(borrow)] 30 + pub tag: jacquard_common::CowStr<'a>, 31 + } 32 + 33 + pub mod tag_state { 34 + 35 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 36 + #[allow(unused)] 37 + use ::core::marker::PhantomData; 38 + mod sealed { 39 + pub trait Sealed {} 40 + } 41 + /// State trait tracking which required fields have been set 42 + pub trait State: sealed::Sealed { 43 + type Repository; 44 + type CreatedAt; 45 + type Tag; 46 + } 47 + /// Empty state - all required fields are unset 48 + pub struct Empty(()); 49 + impl sealed::Sealed for Empty {} 50 + impl State for Empty { 51 + type Repository = Unset; 52 + type CreatedAt = Unset; 53 + type Tag = Unset; 54 + } 55 + ///State transition - sets the `repository` field to Set 56 + pub struct SetRepository<S: State = Empty>(PhantomData<fn() -> S>); 57 + impl<S: State> sealed::Sealed for SetRepository<S> {} 58 + impl<S: State> State for SetRepository<S> { 59 + type Repository = Set<members::repository>; 60 + type CreatedAt = S::CreatedAt; 61 + type Tag = S::Tag; 62 + } 63 + ///State transition - sets the `created_at` field to Set 64 + pub struct SetCreatedAt<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetCreatedAt<S> {} 66 + impl<S: State> State for SetCreatedAt<S> { 67 + type Repository = S::Repository; 68 + type CreatedAt = Set<members::created_at>; 69 + type Tag = S::Tag; 70 + } 71 + ///State transition - sets the `tag` field to Set 72 + pub struct SetTag<S: State = Empty>(PhantomData<fn() -> S>); 73 + impl<S: State> sealed::Sealed for SetTag<S> {} 74 + impl<S: State> State for SetTag<S> { 75 + type Repository = S::Repository; 76 + type CreatedAt = S::CreatedAt; 77 + type Tag = Set<members::tag>; 78 + } 79 + /// Marker types for field names 80 + #[allow(non_camel_case_types)] 81 + pub mod members { 82 + ///Marker type for the `repository` field 83 + pub struct repository(()); 84 + ///Marker type for the `created_at` field 85 + pub struct created_at(()); 86 + ///Marker type for the `tag` field 87 + pub struct tag(()); 88 + } 89 + } 90 + 91 + /// Builder for constructing an instance of this type 92 + pub struct TagBuilder<'a, S: tag_state::State> { 93 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 94 + __unsafe_private_named: ( 95 + ::core::option::Option<jacquard_common::types::string::Datetime>, 96 + ::core::option::Option<jacquard_common::types::string::AtUri<'a>>, 97 + ::core::option::Option<jacquard_common::CowStr<'a>>, 98 + ::core::option::Option<jacquard_common::CowStr<'a>>, 99 + ::core::option::Option<jacquard_common::CowStr<'a>>, 100 + ), 101 + _phantom: ::core::marker::PhantomData<&'a ()>, 102 + } 103 + 104 + impl<'a> Tag<'a> { 105 + /// Create a new builder for this type 106 + pub fn new() -> TagBuilder<'a, tag_state::Empty> { 107 + TagBuilder::new() 108 + } 109 + } 110 + 111 + impl<'a> TagBuilder<'a, tag_state::Empty> { 112 + /// Create a new builder with all fields unset 113 + pub fn new() -> Self { 114 + TagBuilder { 115 + _phantom_state: ::core::marker::PhantomData, 116 + __unsafe_private_named: (None, None, None, None, None), 117 + _phantom: ::core::marker::PhantomData, 118 + } 119 + } 120 + } 121 + 122 + impl<'a, S> TagBuilder<'a, S> 123 + where 124 + S: tag_state::State, 125 + S::CreatedAt: tag_state::IsUnset, 126 + { 127 + /// Set the `createdAt` field (required) 128 + pub fn created_at( 129 + mut self, 130 + value: impl Into<jacquard_common::types::string::Datetime>, 131 + ) -> TagBuilder<'a, tag_state::SetCreatedAt<S>> { 132 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 133 + TagBuilder { 134 + _phantom_state: ::core::marker::PhantomData, 135 + __unsafe_private_named: self.__unsafe_private_named, 136 + _phantom: ::core::marker::PhantomData, 137 + } 138 + } 139 + } 140 + 141 + impl<'a, S: tag_state::State> TagBuilder<'a, S> { 142 + /// Set the `manifest` field (optional) 143 + pub fn manifest( 144 + mut self, 145 + value: impl Into<Option<jacquard_common::types::string::AtUri<'a>>>, 146 + ) -> Self { 147 + self.__unsafe_private_named.1 = value.into(); 148 + self 149 + } 150 + /// Set the `manifest` field to an Option value (optional) 151 + pub fn maybe_manifest( 152 + mut self, 153 + value: Option<jacquard_common::types::string::AtUri<'a>>, 154 + ) -> Self { 155 + self.__unsafe_private_named.1 = value; 156 + self 157 + } 158 + } 159 + 160 + impl<'a, S: tag_state::State> TagBuilder<'a, S> { 161 + /// Set the `manifestDigest` field (optional) 162 + pub fn manifest_digest( 163 + mut self, 164 + value: impl Into<Option<jacquard_common::CowStr<'a>>>, 165 + ) -> Self { 166 + self.__unsafe_private_named.2 = value.into(); 167 + self 168 + } 169 + /// Set the `manifestDigest` field to an Option value (optional) 170 + pub fn maybe_manifest_digest(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 171 + self.__unsafe_private_named.2 = value; 172 + self 173 + } 174 + } 175 + 176 + impl<'a, S> TagBuilder<'a, S> 177 + where 178 + S: tag_state::State, 179 + S::Repository: tag_state::IsUnset, 180 + { 181 + /// Set the `repository` field (required) 182 + pub fn repository( 183 + mut self, 184 + value: impl Into<jacquard_common::CowStr<'a>>, 185 + ) -> TagBuilder<'a, tag_state::SetRepository<S>> { 186 + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); 187 + TagBuilder { 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> TagBuilder<'a, S> 196 + where 197 + S: tag_state::State, 198 + S::Tag: tag_state::IsUnset, 199 + { 200 + /// Set the `tag` field (required) 201 + pub fn tag( 202 + mut self, 203 + value: impl Into<jacquard_common::CowStr<'a>>, 204 + ) -> TagBuilder<'a, tag_state::SetTag<S>> { 205 + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); 206 + TagBuilder { 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> TagBuilder<'a, S> 215 + where 216 + S: tag_state::State, 217 + S::Repository: tag_state::IsSet, 218 + S::CreatedAt: tag_state::IsSet, 219 + S::Tag: tag_state::IsSet, 220 + { 221 + /// Build the final struct 222 + pub fn build(self) -> Tag<'a> { 223 + Tag { 224 + created_at: self.__unsafe_private_named.0.unwrap(), 225 + manifest: self.__unsafe_private_named.1, 226 + manifest_digest: self.__unsafe_private_named.2, 227 + repository: self.__unsafe_private_named.3.unwrap(), 228 + tag: self.__unsafe_private_named.4.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 + ) -> Tag<'a> { 240 + Tag { 241 + created_at: self.__unsafe_private_named.0.unwrap(), 242 + manifest: self.__unsafe_private_named.1, 243 + manifest_digest: self.__unsafe_private_named.2, 244 + repository: self.__unsafe_private_named.3.unwrap(), 245 + tag: self.__unsafe_private_named.4.unwrap(), 246 + extra_data: Some(extra_data), 247 + } 248 + } 249 + } 250 + 251 + impl<'a> Tag<'a> { 252 + pub fn uri( 253 + uri: impl Into<jacquard_common::CowStr<'a>>, 254 + ) -> Result< 255 + jacquard_common::types::uri::RecordUri<'a, TagRecord>, 256 + jacquard_common::types::uri::UriError, 257 + > { 258 + jacquard_common::types::uri::RecordUri::try_from_uri( 259 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 260 + ) 261 + } 262 + } 263 + 264 + /// Typed wrapper for GetRecord response with this collection's record type. 265 + #[derive( 266 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 267 + )] 268 + #[serde(rename_all = "camelCase")] 269 + pub struct TagGetRecordOutput<'a> { 270 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 271 + #[serde(borrow)] 272 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 273 + #[serde(borrow)] 274 + pub uri: jacquard_common::types::string::AtUri<'a>, 275 + #[serde(borrow)] 276 + pub value: Tag<'a>, 277 + } 278 + 279 + impl From<TagGetRecordOutput<'_>> for Tag<'_> { 280 + fn from(output: TagGetRecordOutput<'_>) -> Self { 281 + use jacquard_common::IntoStatic; 282 + output.value.into_static() 283 + } 284 + } 285 + 286 + impl jacquard_common::types::collection::Collection for Tag<'_> { 287 + const NSID: &'static str = "io.atcr.tag"; 288 + type Record = TagRecord; 289 + } 290 + 291 + /// Marker type for deserializing records from this collection. 292 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 293 + pub struct TagRecord; 294 + impl jacquard_common::xrpc::XrpcResp for TagRecord { 295 + const NSID: &'static str = "io.atcr.tag"; 296 + const ENCODING: &'static str = "application/json"; 297 + type Output<'de> = TagGetRecordOutput<'de>; 298 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 299 + } 300 + 301 + impl jacquard_common::types::collection::Collection for TagRecord { 302 + const NSID: &'static str = "io.atcr.tag"; 303 + type Record = TagRecord; 304 + } 305 + 306 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Tag<'a> { 307 + fn nsid() -> &'static str { 308 + "io.atcr.tag" 309 + } 310 + fn def_name() -> &'static str { 311 + "main" 312 + } 313 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 314 + lexicon_doc_io_atcr_tag() 315 + } 316 + fn validate( 317 + &self, 318 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 319 + { 320 + let value = &self.repository; 321 + #[allow(unused_comparisons)] 322 + if <str>::len(value.as_ref()) > 255usize { 323 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 324 + path: ::jacquard_lexicon::validation::ValidationPath::from_field("repository"), 325 + max: 255usize, 326 + actual: <str>::len(value.as_ref()), 327 + }); 328 + } 329 + } 330 + { 331 + let value = &self.tag; 332 + #[allow(unused_comparisons)] 333 + if <str>::len(value.as_ref()) > 128usize { 334 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 335 + path: ::jacquard_lexicon::validation::ValidationPath::from_field("tag"), 336 + max: 128usize, 337 + actual: <str>::len(value.as_ref()), 338 + }); 339 + } 340 + } 341 + Ok(()) 342 + } 343 + } 344 + 345 + fn lexicon_doc_io_atcr_tag() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 346 + ::jacquard_lexicon::lexicon::LexiconDoc { 347 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 348 + id: ::jacquard_common::CowStr::new_static("io.atcr.tag"), 349 + revision: None, 350 + description: None, 351 + defs: { 352 + let mut map = ::std::collections::BTreeMap::new(); 353 + map.insert( 354 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 355 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 356 + description: Some( 357 + ::jacquard_common::CowStr::new_static( 358 + "A named tag pointing to a specific manifest digest", 359 + ), 360 + ), 361 + key: Some(::jacquard_common::CowStr::new_static("any")), 362 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 363 + description: None, 364 + required: Some( 365 + vec![ 366 + ::jacquard_common::smol_str::SmolStr::new_static("repository"), 367 + ::jacquard_common::smol_str::SmolStr::new_static("tag"), 368 + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") 369 + ], 370 + ), 371 + nullable: None, 372 + properties: { 373 + #[allow(unused_mut)] 374 + let mut map = ::std::collections::BTreeMap::new(); 375 + map.insert( 376 + ::jacquard_common::smol_str::SmolStr::new_static( 377 + "createdAt", 378 + ), 379 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 380 + description: Some( 381 + ::jacquard_common::CowStr::new_static( 382 + "Tag creation timestamp", 383 + ), 384 + ), 385 + format: Some( 386 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 387 + ), 388 + default: None, 389 + min_length: None, 390 + max_length: None, 391 + min_graphemes: None, 392 + max_graphemes: None, 393 + r#enum: None, 394 + r#const: None, 395 + known_values: None, 396 + }), 397 + ); 398 + map.insert( 399 + ::jacquard_common::smol_str::SmolStr::new_static( 400 + "manifest", 401 + ), 402 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 403 + description: Some( 404 + ::jacquard_common::CowStr::new_static( 405 + "AT-URI of the manifest this tag points to (e.g., 'at://did:plc:xyz/io.atcr.manifest/abc123'). Preferred over manifestDigest for new records.", 406 + ), 407 + ), 408 + format: Some( 409 + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, 410 + ), 411 + default: None, 412 + min_length: None, 413 + max_length: None, 414 + min_graphemes: None, 415 + max_graphemes: None, 416 + r#enum: None, 417 + r#const: None, 418 + known_values: None, 419 + }), 420 + ); 421 + map.insert( 422 + ::jacquard_common::smol_str::SmolStr::new_static( 423 + "manifestDigest", 424 + ), 425 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 426 + description: Some( 427 + ::jacquard_common::CowStr::new_static( 428 + "DEPRECATED: Digest of the manifest (e.g., 'sha256:...'). Kept for backward compatibility with old records. New records should use 'manifest' field instead.", 429 + ), 430 + ), 431 + format: None, 432 + default: None, 433 + min_length: None, 434 + max_length: None, 435 + min_graphemes: None, 436 + max_graphemes: None, 437 + r#enum: None, 438 + r#const: None, 439 + known_values: None, 440 + }), 441 + ); 442 + map.insert( 443 + ::jacquard_common::smol_str::SmolStr::new_static( 444 + "repository", 445 + ), 446 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 447 + description: Some( 448 + ::jacquard_common::CowStr::new_static( 449 + "Repository name (e.g., 'myapp'). Scoped to user's DID.", 450 + ), 451 + ), 452 + format: None, 453 + default: None, 454 + min_length: None, 455 + max_length: Some(255usize), 456 + min_graphemes: None, 457 + max_graphemes: None, 458 + r#enum: None, 459 + r#const: None, 460 + known_values: None, 461 + }), 462 + ); 463 + map.insert( 464 + ::jacquard_common::smol_str::SmolStr::new_static("tag"), 465 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 466 + description: Some( 467 + ::jacquard_common::CowStr::new_static( 468 + "Tag name (e.g., 'latest', 'v1.0.0', '12-slim')", 469 + ), 470 + ), 471 + format: None, 472 + default: None, 473 + min_length: None, 474 + max_length: Some(128usize), 475 + min_graphemes: None, 476 + max_graphemes: None, 477 + r#enum: None, 478 + r#const: None, 479 + known_values: None, 480 + }), 481 + ); 482 + map 483 + }, 484 + }), 485 + }), 486 + ); 487 + map 488 + }, 489 + } 490 + }
+7
crates/jacquard-api/src/io_whiteside.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 linked_account; 7 + pub mod profile;
+372
crates/jacquard-api/src/io_whiteside/linked_account.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: io.whiteside.linkedAccount 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// A linked account record containing external account information 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct LinkedAccount<'a> { 15 + /// Icon identifier or URL for the linked account 16 + #[serde(borrow)] 17 + pub icon: jacquard_common::CowStr<'a>, 18 + /// URL to the linked account 19 + #[serde(borrow)] 20 + pub link: jacquard_common::types::string::Uri<'a>, 21 + /// Display name of the linked account 22 + #[serde(borrow)] 23 + pub name: jacquard_common::CowStr<'a>, 24 + } 25 + 26 + pub mod linked_account_state { 27 + 28 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 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 Name; 37 + type Link; 38 + type Icon; 39 + } 40 + /// Empty state - all required fields are unset 41 + pub struct Empty(()); 42 + impl sealed::Sealed for Empty {} 43 + impl State for Empty { 44 + type Name = Unset; 45 + type Link = Unset; 46 + type Icon = Unset; 47 + } 48 + ///State transition - sets the `name` field to Set 49 + pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 50 + impl<S: State> sealed::Sealed for SetName<S> {} 51 + impl<S: State> State for SetName<S> { 52 + type Name = Set<members::name>; 53 + type Link = S::Link; 54 + type Icon = S::Icon; 55 + } 56 + ///State transition - sets the `link` field to Set 57 + pub struct SetLink<S: State = Empty>(PhantomData<fn() -> S>); 58 + impl<S: State> sealed::Sealed for SetLink<S> {} 59 + impl<S: State> State for SetLink<S> { 60 + type Name = S::Name; 61 + type Link = Set<members::link>; 62 + type Icon = S::Icon; 63 + } 64 + ///State transition - sets the `icon` field to Set 65 + pub struct SetIcon<S: State = Empty>(PhantomData<fn() -> S>); 66 + impl<S: State> sealed::Sealed for SetIcon<S> {} 67 + impl<S: State> State for SetIcon<S> { 68 + type Name = S::Name; 69 + type Link = S::Link; 70 + type Icon = Set<members::icon>; 71 + } 72 + /// Marker types for field names 73 + #[allow(non_camel_case_types)] 74 + pub mod members { 75 + ///Marker type for the `name` field 76 + pub struct name(()); 77 + ///Marker type for the `link` field 78 + pub struct link(()); 79 + ///Marker type for the `icon` field 80 + pub struct icon(()); 81 + } 82 + } 83 + 84 + /// Builder for constructing an instance of this type 85 + pub struct LinkedAccountBuilder<'a, S: linked_account_state::State> { 86 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 87 + __unsafe_private_named: ( 88 + ::core::option::Option<jacquard_common::CowStr<'a>>, 89 + ::core::option::Option<jacquard_common::types::string::Uri<'a>>, 90 + ::core::option::Option<jacquard_common::CowStr<'a>>, 91 + ), 92 + _phantom: ::core::marker::PhantomData<&'a ()>, 93 + } 94 + 95 + impl<'a> LinkedAccount<'a> { 96 + /// Create a new builder for this type 97 + pub fn new() -> LinkedAccountBuilder<'a, linked_account_state::Empty> { 98 + LinkedAccountBuilder::new() 99 + } 100 + } 101 + 102 + impl<'a> LinkedAccountBuilder<'a, linked_account_state::Empty> { 103 + /// Create a new builder with all fields unset 104 + pub fn new() -> Self { 105 + LinkedAccountBuilder { 106 + _phantom_state: ::core::marker::PhantomData, 107 + __unsafe_private_named: (None, None, None), 108 + _phantom: ::core::marker::PhantomData, 109 + } 110 + } 111 + } 112 + 113 + impl<'a, S> LinkedAccountBuilder<'a, S> 114 + where 115 + S: linked_account_state::State, 116 + S::Icon: linked_account_state::IsUnset, 117 + { 118 + /// Set the `icon` field (required) 119 + pub fn icon( 120 + mut self, 121 + value: impl Into<jacquard_common::CowStr<'a>>, 122 + ) -> LinkedAccountBuilder<'a, linked_account_state::SetIcon<S>> { 123 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 124 + LinkedAccountBuilder { 125 + _phantom_state: ::core::marker::PhantomData, 126 + __unsafe_private_named: self.__unsafe_private_named, 127 + _phantom: ::core::marker::PhantomData, 128 + } 129 + } 130 + } 131 + 132 + impl<'a, S> LinkedAccountBuilder<'a, S> 133 + where 134 + S: linked_account_state::State, 135 + S::Link: linked_account_state::IsUnset, 136 + { 137 + /// Set the `link` field (required) 138 + pub fn link( 139 + mut self, 140 + value: impl Into<jacquard_common::types::string::Uri<'a>>, 141 + ) -> LinkedAccountBuilder<'a, linked_account_state::SetLink<S>> { 142 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 143 + LinkedAccountBuilder { 144 + _phantom_state: ::core::marker::PhantomData, 145 + __unsafe_private_named: self.__unsafe_private_named, 146 + _phantom: ::core::marker::PhantomData, 147 + } 148 + } 149 + } 150 + 151 + impl<'a, S> LinkedAccountBuilder<'a, S> 152 + where 153 + S: linked_account_state::State, 154 + S::Name: linked_account_state::IsUnset, 155 + { 156 + /// Set the `name` field (required) 157 + pub fn name( 158 + mut self, 159 + value: impl Into<jacquard_common::CowStr<'a>>, 160 + ) -> LinkedAccountBuilder<'a, linked_account_state::SetName<S>> { 161 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 162 + LinkedAccountBuilder { 163 + _phantom_state: ::core::marker::PhantomData, 164 + __unsafe_private_named: self.__unsafe_private_named, 165 + _phantom: ::core::marker::PhantomData, 166 + } 167 + } 168 + } 169 + 170 + impl<'a, S> LinkedAccountBuilder<'a, S> 171 + where 172 + S: linked_account_state::State, 173 + S::Name: linked_account_state::IsSet, 174 + S::Link: linked_account_state::IsSet, 175 + S::Icon: linked_account_state::IsSet, 176 + { 177 + /// Build the final struct 178 + pub fn build(self) -> LinkedAccount<'a> { 179 + LinkedAccount { 180 + icon: self.__unsafe_private_named.0.unwrap(), 181 + link: self.__unsafe_private_named.1.unwrap(), 182 + name: self.__unsafe_private_named.2.unwrap(), 183 + extra_data: Default::default(), 184 + } 185 + } 186 + /// Build the final struct with custom extra_data 187 + pub fn build_with_data( 188 + self, 189 + extra_data: std::collections::BTreeMap< 190 + jacquard_common::smol_str::SmolStr, 191 + jacquard_common::types::value::Data<'a>, 192 + >, 193 + ) -> LinkedAccount<'a> { 194 + LinkedAccount { 195 + icon: self.__unsafe_private_named.0.unwrap(), 196 + link: self.__unsafe_private_named.1.unwrap(), 197 + name: self.__unsafe_private_named.2.unwrap(), 198 + extra_data: Some(extra_data), 199 + } 200 + } 201 + } 202 + 203 + impl<'a> LinkedAccount<'a> { 204 + pub fn uri( 205 + uri: impl Into<jacquard_common::CowStr<'a>>, 206 + ) -> Result< 207 + jacquard_common::types::uri::RecordUri<'a, LinkedAccountRecord>, 208 + jacquard_common::types::uri::UriError, 209 + > { 210 + jacquard_common::types::uri::RecordUri::try_from_uri( 211 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 212 + ) 213 + } 214 + } 215 + 216 + /// Typed wrapper for GetRecord response with this collection's record type. 217 + #[derive( 218 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 219 + )] 220 + #[serde(rename_all = "camelCase")] 221 + pub struct LinkedAccountGetRecordOutput<'a> { 222 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 223 + #[serde(borrow)] 224 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 225 + #[serde(borrow)] 226 + pub uri: jacquard_common::types::string::AtUri<'a>, 227 + #[serde(borrow)] 228 + pub value: LinkedAccount<'a>, 229 + } 230 + 231 + impl From<LinkedAccountGetRecordOutput<'_>> for LinkedAccount<'_> { 232 + fn from(output: LinkedAccountGetRecordOutput<'_>) -> Self { 233 + use jacquard_common::IntoStatic; 234 + output.value.into_static() 235 + } 236 + } 237 + 238 + impl jacquard_common::types::collection::Collection for LinkedAccount<'_> { 239 + const NSID: &'static str = "io.whiteside.linkedAccount"; 240 + type Record = LinkedAccountRecord; 241 + } 242 + 243 + /// Marker type for deserializing records from this collection. 244 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 245 + pub struct LinkedAccountRecord; 246 + impl jacquard_common::xrpc::XrpcResp for LinkedAccountRecord { 247 + const NSID: &'static str = "io.whiteside.linkedAccount"; 248 + const ENCODING: &'static str = "application/json"; 249 + type Output<'de> = LinkedAccountGetRecordOutput<'de>; 250 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 251 + } 252 + 253 + impl jacquard_common::types::collection::Collection for LinkedAccountRecord { 254 + const NSID: &'static str = "io.whiteside.linkedAccount"; 255 + type Record = LinkedAccountRecord; 256 + } 257 + 258 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for LinkedAccount<'a> { 259 + fn nsid() -> &'static str { 260 + "io.whiteside.linkedAccount" 261 + } 262 + fn def_name() -> &'static str { 263 + "main" 264 + } 265 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 266 + lexicon_doc_io_whiteside_linkedAccount() 267 + } 268 + fn validate( 269 + &self, 270 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 271 + Ok(()) 272 + } 273 + } 274 + 275 + fn lexicon_doc_io_whiteside_linkedAccount() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 276 + ::jacquard_lexicon::lexicon::LexiconDoc { 277 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 278 + id: ::jacquard_common::CowStr::new_static("io.whiteside.linkedAccount"), 279 + revision: None, 280 + description: None, 281 + defs: { 282 + let mut map = ::std::collections::BTreeMap::new(); 283 + map.insert( 284 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 285 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 286 + description: Some( 287 + ::jacquard_common::CowStr::new_static( 288 + "A linked account record containing external account information", 289 + ), 290 + ), 291 + key: None, 292 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 293 + description: None, 294 + required: Some( 295 + vec![ 296 + ::jacquard_common::smol_str::SmolStr::new_static("icon"), 297 + ::jacquard_common::smol_str::SmolStr::new_static("name"), 298 + ::jacquard_common::smol_str::SmolStr::new_static("link") 299 + ], 300 + ), 301 + nullable: None, 302 + properties: { 303 + #[allow(unused_mut)] 304 + let mut map = ::std::collections::BTreeMap::new(); 305 + map.insert( 306 + ::jacquard_common::smol_str::SmolStr::new_static("icon"), 307 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 308 + description: Some( 309 + ::jacquard_common::CowStr::new_static( 310 + "Icon identifier or URL for the linked account", 311 + ), 312 + ), 313 + format: None, 314 + default: None, 315 + min_length: None, 316 + max_length: None, 317 + min_graphemes: None, 318 + max_graphemes: None, 319 + r#enum: None, 320 + r#const: None, 321 + known_values: None, 322 + }), 323 + ); 324 + map.insert( 325 + ::jacquard_common::smol_str::SmolStr::new_static("link"), 326 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 327 + description: Some( 328 + ::jacquard_common::CowStr::new_static( 329 + "URL to the linked account", 330 + ), 331 + ), 332 + format: Some( 333 + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, 334 + ), 335 + default: None, 336 + min_length: None, 337 + max_length: None, 338 + min_graphemes: None, 339 + max_graphemes: None, 340 + r#enum: None, 341 + r#const: None, 342 + known_values: None, 343 + }), 344 + ); 345 + map.insert( 346 + ::jacquard_common::smol_str::SmolStr::new_static("name"), 347 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 348 + description: Some( 349 + ::jacquard_common::CowStr::new_static( 350 + "Display name of the linked account", 351 + ), 352 + ), 353 + format: None, 354 + default: None, 355 + min_length: None, 356 + max_length: None, 357 + min_graphemes: None, 358 + max_graphemes: None, 359 + r#enum: None, 360 + r#const: None, 361 + known_values: None, 362 + }), 363 + ); 364 + map 365 + }, 366 + }), 367 + }), 368 + ); 369 + map 370 + }, 371 + } 372 + }
+395
crates/jacquard-api/src/io_whiteside/profile.rs
··· 1 + // @generated by jacquard-lexicon. DO NOT EDIT. 2 + // 3 + // Lexicon: io.whiteside.profile 4 + // 5 + // This file was automatically generated from Lexicon schemas. 6 + // Any manual changes will be overwritten on the next regeneration. 7 + 8 + /// Profile information (bio, skills, etc.) 9 + #[jacquard_derive::lexicon] 10 + #[derive( 11 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 12 + )] 13 + #[serde(rename_all = "camelCase")] 14 + pub struct Profile<'a> { 15 + /// Profile content in plain text or markdown format 16 + #[serde(borrow)] 17 + pub content: jacquard_common::CowStr<'a>, 18 + /// Profile section heading (e.g. 'Hey, I'm John') 19 + #[serde(borrow)] 20 + pub heading: jacquard_common::CowStr<'a>, 21 + /// Last update timestamp in ISO 8601 format 22 + pub updated_at: jacquard_common::types::string::Datetime, 23 + } 24 + 25 + pub mod profile_state { 26 + 27 + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 28 + #[allow(unused)] 29 + use ::core::marker::PhantomData; 30 + mod sealed { 31 + pub trait Sealed {} 32 + } 33 + /// State trait tracking which required fields have been set 34 + pub trait State: sealed::Sealed { 35 + type Heading; 36 + type UpdatedAt; 37 + type Content; 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 Heading = Unset; 44 + type UpdatedAt = Unset; 45 + type Content = Unset; 46 + } 47 + ///State transition - sets the `heading` field to Set 48 + pub struct SetHeading<S: State = Empty>(PhantomData<fn() -> S>); 49 + impl<S: State> sealed::Sealed for SetHeading<S> {} 50 + impl<S: State> State for SetHeading<S> { 51 + type Heading = Set<members::heading>; 52 + type UpdatedAt = S::UpdatedAt; 53 + type Content = S::Content; 54 + } 55 + ///State transition - sets the `updated_at` field to Set 56 + pub struct SetUpdatedAt<S: State = Empty>(PhantomData<fn() -> S>); 57 + impl<S: State> sealed::Sealed for SetUpdatedAt<S> {} 58 + impl<S: State> State for SetUpdatedAt<S> { 59 + type Heading = S::Heading; 60 + type UpdatedAt = Set<members::updated_at>; 61 + type Content = S::Content; 62 + } 63 + ///State transition - sets the `content` field to Set 64 + pub struct SetContent<S: State = Empty>(PhantomData<fn() -> S>); 65 + impl<S: State> sealed::Sealed for SetContent<S> {} 66 + impl<S: State> State for SetContent<S> { 67 + type Heading = S::Heading; 68 + type UpdatedAt = S::UpdatedAt; 69 + type Content = Set<members::content>; 70 + } 71 + /// Marker types for field names 72 + #[allow(non_camel_case_types)] 73 + pub mod members { 74 + ///Marker type for the `heading` field 75 + pub struct heading(()); 76 + ///Marker type for the `updated_at` field 77 + pub struct updated_at(()); 78 + ///Marker type for the `content` field 79 + pub struct content(()); 80 + } 81 + } 82 + 83 + /// Builder for constructing an instance of this type 84 + pub struct ProfileBuilder<'a, S: profile_state::State> { 85 + _phantom_state: ::core::marker::PhantomData<fn() -> S>, 86 + __unsafe_private_named: ( 87 + ::core::option::Option<jacquard_common::CowStr<'a>>, 88 + ::core::option::Option<jacquard_common::CowStr<'a>>, 89 + ::core::option::Option<jacquard_common::types::string::Datetime>, 90 + ), 91 + _phantom: ::core::marker::PhantomData<&'a ()>, 92 + } 93 + 94 + impl<'a> Profile<'a> { 95 + /// Create a new builder for this type 96 + pub fn new() -> ProfileBuilder<'a, profile_state::Empty> { 97 + ProfileBuilder::new() 98 + } 99 + } 100 + 101 + impl<'a> ProfileBuilder<'a, profile_state::Empty> { 102 + /// Create a new builder with all fields unset 103 + pub fn new() -> Self { 104 + ProfileBuilder { 105 + _phantom_state: ::core::marker::PhantomData, 106 + __unsafe_private_named: (None, None, None), 107 + _phantom: ::core::marker::PhantomData, 108 + } 109 + } 110 + } 111 + 112 + impl<'a, S> ProfileBuilder<'a, S> 113 + where 114 + S: profile_state::State, 115 + S::Content: profile_state::IsUnset, 116 + { 117 + /// Set the `content` field (required) 118 + pub fn content( 119 + mut self, 120 + value: impl Into<jacquard_common::CowStr<'a>>, 121 + ) -> ProfileBuilder<'a, profile_state::SetContent<S>> { 122 + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 123 + ProfileBuilder { 124 + _phantom_state: ::core::marker::PhantomData, 125 + __unsafe_private_named: self.__unsafe_private_named, 126 + _phantom: ::core::marker::PhantomData, 127 + } 128 + } 129 + } 130 + 131 + impl<'a, S> ProfileBuilder<'a, S> 132 + where 133 + S: profile_state::State, 134 + S::Heading: profile_state::IsUnset, 135 + { 136 + /// Set the `heading` field (required) 137 + pub fn heading( 138 + mut self, 139 + value: impl Into<jacquard_common::CowStr<'a>>, 140 + ) -> ProfileBuilder<'a, profile_state::SetHeading<S>> { 141 + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 142 + ProfileBuilder { 143 + _phantom_state: ::core::marker::PhantomData, 144 + __unsafe_private_named: self.__unsafe_private_named, 145 + _phantom: ::core::marker::PhantomData, 146 + } 147 + } 148 + } 149 + 150 + impl<'a, S> ProfileBuilder<'a, S> 151 + where 152 + S: profile_state::State, 153 + S::UpdatedAt: profile_state::IsUnset, 154 + { 155 + /// Set the `updatedAt` field (required) 156 + pub fn updated_at( 157 + mut self, 158 + value: impl Into<jacquard_common::types::string::Datetime>, 159 + ) -> ProfileBuilder<'a, profile_state::SetUpdatedAt<S>> { 160 + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 161 + ProfileBuilder { 162 + _phantom_state: ::core::marker::PhantomData, 163 + __unsafe_private_named: self.__unsafe_private_named, 164 + _phantom: ::core::marker::PhantomData, 165 + } 166 + } 167 + } 168 + 169 + impl<'a, S> ProfileBuilder<'a, S> 170 + where 171 + S: profile_state::State, 172 + S::Heading: profile_state::IsSet, 173 + S::UpdatedAt: profile_state::IsSet, 174 + S::Content: profile_state::IsSet, 175 + { 176 + /// Build the final struct 177 + pub fn build(self) -> Profile<'a> { 178 + Profile { 179 + content: self.__unsafe_private_named.0.unwrap(), 180 + heading: self.__unsafe_private_named.1.unwrap(), 181 + updated_at: self.__unsafe_private_named.2.unwrap(), 182 + extra_data: Default::default(), 183 + } 184 + } 185 + /// Build the final struct with custom extra_data 186 + pub fn build_with_data( 187 + self, 188 + extra_data: std::collections::BTreeMap< 189 + jacquard_common::smol_str::SmolStr, 190 + jacquard_common::types::value::Data<'a>, 191 + >, 192 + ) -> Profile<'a> { 193 + Profile { 194 + content: self.__unsafe_private_named.0.unwrap(), 195 + heading: self.__unsafe_private_named.1.unwrap(), 196 + updated_at: self.__unsafe_private_named.2.unwrap(), 197 + extra_data: Some(extra_data), 198 + } 199 + } 200 + } 201 + 202 + impl<'a> Profile<'a> { 203 + pub fn uri( 204 + uri: impl Into<jacquard_common::CowStr<'a>>, 205 + ) -> Result< 206 + jacquard_common::types::uri::RecordUri<'a, ProfileRecord>, 207 + jacquard_common::types::uri::UriError, 208 + > { 209 + jacquard_common::types::uri::RecordUri::try_from_uri( 210 + jacquard_common::types::string::AtUri::new_cow(uri.into())?, 211 + ) 212 + } 213 + } 214 + 215 + /// Typed wrapper for GetRecord response with this collection's record type. 216 + #[derive( 217 + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 218 + )] 219 + #[serde(rename_all = "camelCase")] 220 + pub struct ProfileGetRecordOutput<'a> { 221 + #[serde(skip_serializing_if = "std::option::Option::is_none")] 222 + #[serde(borrow)] 223 + pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 224 + #[serde(borrow)] 225 + pub uri: jacquard_common::types::string::AtUri<'a>, 226 + #[serde(borrow)] 227 + pub value: Profile<'a>, 228 + } 229 + 230 + impl From<ProfileGetRecordOutput<'_>> for Profile<'_> { 231 + fn from(output: ProfileGetRecordOutput<'_>) -> Self { 232 + use jacquard_common::IntoStatic; 233 + output.value.into_static() 234 + } 235 + } 236 + 237 + impl jacquard_common::types::collection::Collection for Profile<'_> { 238 + const NSID: &'static str = "io.whiteside.profile"; 239 + type Record = ProfileRecord; 240 + } 241 + 242 + /// Marker type for deserializing records from this collection. 243 + #[derive(Debug, serde::Serialize, serde::Deserialize)] 244 + pub struct ProfileRecord; 245 + impl jacquard_common::xrpc::XrpcResp for ProfileRecord { 246 + const NSID: &'static str = "io.whiteside.profile"; 247 + const ENCODING: &'static str = "application/json"; 248 + type Output<'de> = ProfileGetRecordOutput<'de>; 249 + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 250 + } 251 + 252 + impl jacquard_common::types::collection::Collection for ProfileRecord { 253 + const NSID: &'static str = "io.whiteside.profile"; 254 + type Record = ProfileRecord; 255 + } 256 + 257 + impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Profile<'a> { 258 + fn nsid() -> &'static str { 259 + "io.whiteside.profile" 260 + } 261 + fn def_name() -> &'static str { 262 + "main" 263 + } 264 + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 265 + lexicon_doc_io_whiteside_profile() 266 + } 267 + fn validate( 268 + &self, 269 + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 270 + { 271 + let value = &self.content; 272 + #[allow(unused_comparisons)] 273 + if <str>::len(value.as_ref()) > 5000usize { 274 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 275 + path: ::jacquard_lexicon::validation::ValidationPath::from_field("content"), 276 + max: 5000usize, 277 + actual: <str>::len(value.as_ref()), 278 + }); 279 + } 280 + } 281 + { 282 + let value = &self.heading; 283 + #[allow(unused_comparisons)] 284 + if <str>::len(value.as_ref()) > 200usize { 285 + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 286 + path: ::jacquard_lexicon::validation::ValidationPath::from_field("heading"), 287 + max: 200usize, 288 + actual: <str>::len(value.as_ref()), 289 + }); 290 + } 291 + } 292 + Ok(()) 293 + } 294 + } 295 + 296 + fn lexicon_doc_io_whiteside_profile() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 297 + ::jacquard_lexicon::lexicon::LexiconDoc { 298 + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 299 + id: ::jacquard_common::CowStr::new_static("io.whiteside.profile"), 300 + revision: None, 301 + description: None, 302 + defs: { 303 + let mut map = ::std::collections::BTreeMap::new(); 304 + map.insert( 305 + ::jacquard_common::smol_str::SmolStr::new_static("main"), 306 + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 307 + description: Some( 308 + ::jacquard_common::CowStr::new_static( 309 + "Profile information (bio, skills, etc.)", 310 + ), 311 + ), 312 + key: Some(::jacquard_common::CowStr::new_static("literal:bio")), 313 + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 314 + description: None, 315 + required: Some( 316 + vec![ 317 + ::jacquard_common::smol_str::SmolStr::new_static("heading"), 318 + ::jacquard_common::smol_str::SmolStr::new_static("content"), 319 + ::jacquard_common::smol_str::SmolStr::new_static("updatedAt") 320 + ], 321 + ), 322 + nullable: None, 323 + properties: { 324 + #[allow(unused_mut)] 325 + let mut map = ::std::collections::BTreeMap::new(); 326 + map.insert( 327 + ::jacquard_common::smol_str::SmolStr::new_static("content"), 328 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 329 + description: Some( 330 + ::jacquard_common::CowStr::new_static( 331 + "Profile content in plain text or markdown format", 332 + ), 333 + ), 334 + format: None, 335 + default: None, 336 + min_length: None, 337 + max_length: Some(5000usize), 338 + min_graphemes: None, 339 + max_graphemes: None, 340 + r#enum: None, 341 + r#const: None, 342 + known_values: None, 343 + }), 344 + ); 345 + map.insert( 346 + ::jacquard_common::smol_str::SmolStr::new_static("heading"), 347 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 348 + description: Some( 349 + ::jacquard_common::CowStr::new_static( 350 + "Profile section heading (e.g. 'Hey, I'm John')", 351 + ), 352 + ), 353 + format: None, 354 + default: None, 355 + min_length: None, 356 + max_length: Some(200usize), 357 + min_graphemes: None, 358 + max_graphemes: None, 359 + r#enum: None, 360 + r#const: None, 361 + known_values: None, 362 + }), 363 + ); 364 + map.insert( 365 + ::jacquard_common::smol_str::SmolStr::new_static( 366 + "updatedAt", 367 + ), 368 + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 369 + description: Some( 370 + ::jacquard_common::CowStr::new_static( 371 + "Last update timestamp in ISO 8601 format", 372 + ), 373 + ), 374 + format: Some( 375 + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 376 + ), 377 + default: None, 378 + min_length: None, 379 + max_length: None, 380 + min_graphemes: None, 381 + max_graphemes: None, 382 + r#enum: None, 383 + r#const: None, 384 + known_values: None, 385 + }), 386 + ); 387 + map 388 + }, 389 + }), 390 + }), 391 + ); 392 + map 393 + }, 394 + } 395 + }