this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

use teal.fm lexicon from `jacquard-api`

+3 -7566
+1 -13
Cargo.lock
··· 2814 2814 "dirs", 2815 2815 "http", 2816 2816 "jacquard", 2817 + "jacquard-api", 2817 2818 "jacquard-identity", 2818 2819 "jacquard-oauth", 2819 2820 "keyring", 2820 - "onyx-lexicons", 2821 2821 "owo-colors", 2822 2822 "serde", 2823 2823 "serde_json", 2824 2824 "thiserror 2.0.18", 2825 2825 "tokio", 2826 - ] 2827 - 2828 - [[package]] 2829 - name = "onyx-lexicons" 2830 - version = "0.1.0" 2831 - dependencies = [ 2832 - "jacquard-common", 2833 - "jacquard-derive", 2834 - "jacquard-lexicon", 2835 - "rustversion", 2836 - "serde", 2837 - "unicode-segmentation", 2838 2826 ] 2839 2827 2840 2828 [[package]]
+1 -4
Cargo.toml
··· 9 9 dirs = "6.0.0" 10 10 http = "1.4.0" 11 11 jacquard = "0.9.5" 12 + jacquard-api = { version = "0.9.5", features = ["fm_teal"] } 12 13 jacquard-identity = { version = "0.9.5", features = ["dns"] } 13 14 jacquard-oauth = { version = "0.9.6", features = ["browser-open", "loopback"] } 14 15 keyring = { version = "3.6.3", features = ["linux-native-sync-persistent", "apple-native", "windows-native", "crypto-rust", "vendored"] } 15 - onyx-lexicons = { path = "crates/lexicons" } 16 16 owo-colors = "4.2.3" 17 17 serde = "1.0.228" 18 18 serde_json = "1.0.149" 19 19 thiserror = "2.0.18" 20 20 tokio = { version = "1.49.0", features = ["macros", "rt", "rt-multi-thread"] } 21 - 22 - [workspace] 23 - members = [ ".", "crates/lexicons" ]
-22
crates/lexicons/Cargo.toml
··· 1 - [package] 2 - name = "onyx-lexicons" 3 - version = "0.1.0" 4 - edition = "2024" 5 - 6 - [lints.rust] 7 - non_snake_case = "allow" 8 - 9 - [dependencies] 10 - unicode-segmentation = "1.12.0" 11 - jacquard-common = "0.9.5" 12 - jacquard-derive = "0.9.5" 13 - jacquard-lexicon = "0.9.5" 14 - serde = { version = "1.0", features = ["derive"] } 15 - rustversion = "1.0" 16 - 17 - [features] 18 - default = ["fm_teal"] 19 - 20 - # --- generated --- 21 - # Generated namespace features 22 - fm_teal = []
-90
crates/lexicons/lexicons/fm_teal_alpha_actor_defs.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.actor.defs", 4 - "defs": { 5 - "miniProfileView": { 6 - "type": "object", 7 - "properties": { 8 - "avatar": { 9 - "type": "string", 10 - "description": "IPLD of the avatar" 11 - }, 12 - "did": { 13 - "type": "string", 14 - "description": "The decentralized identifier of the actor" 15 - }, 16 - "displayName": { 17 - "type": "string" 18 - }, 19 - "handle": { 20 - "type": "string" 21 - } 22 - } 23 - }, 24 - "profileView": { 25 - "type": "object", 26 - "properties": { 27 - "avatar": { 28 - "type": "string", 29 - "description": "IPLD of the avatar" 30 - }, 31 - "banner": { 32 - "type": "string", 33 - "description": "IPLD of the banner image" 34 - }, 35 - "createdAt": { 36 - "type": "string", 37 - "format": "datetime" 38 - }, 39 - "description": { 40 - "type": "string", 41 - "description": "Free-form profile description text." 42 - }, 43 - "descriptionFacets": { 44 - "type": "array", 45 - "description": "Annotations of text in the profile description (mentions, URLs, hashtags, etc). May be changed to another (backwards compatible) lexicon.", 46 - "items": { 47 - "type": "ref", 48 - "ref": "app.bsky.richtext.facet" 49 - } 50 - }, 51 - "did": { 52 - "type": "string", 53 - "description": "The decentralized identifier of the actor" 54 - }, 55 - "displayName": { 56 - "type": "string" 57 - }, 58 - "featuredItem": { 59 - "type": "ref", 60 - "description": "The user's most recent item featured on their profile.", 61 - "ref": "fm.teal.alpha.actor.profile#featuredItem" 62 - }, 63 - "status": { 64 - "type": "ref", 65 - "ref": "#statusView" 66 - } 67 - } 68 - }, 69 - "statusView": { 70 - "type": "object", 71 - "description": "A declaration of the status of the actor.", 72 - "properties": { 73 - "expiry": { 74 - "type": "string", 75 - "description": "The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time.", 76 - "format": "datetime" 77 - }, 78 - "item": { 79 - "type": "ref", 80 - "ref": "fm.teal.alpha.feed.defs#playView" 81 - }, 82 - "time": { 83 - "type": "string", 84 - "description": "The unix timestamp of when the item was recorded", 85 - "format": "datetime" 86 - } 87 - } 88 - } 89 - } 90 - }
-38
crates/lexicons/lexicons/fm_teal_alpha_actor_getProfile.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.actor.getProfile", 4 - "description": "This lexicon is in a not officially released state. It is subject to change. | Retrieves a play given an author DID and record key.", 5 - "defs": { 6 - "main": { 7 - "type": "query", 8 - "parameters": { 9 - "type": "params", 10 - "required": [ 11 - "actor" 12 - ], 13 - "properties": { 14 - "actor": { 15 - "type": "string", 16 - "description": "The author's DID", 17 - "format": "at-identifier" 18 - } 19 - } 20 - }, 21 - "output": { 22 - "encoding": "application/json", 23 - "schema": { 24 - "type": "object", 25 - "required": [ 26 - "actor" 27 - ], 28 - "properties": { 29 - "actor": { 30 - "type": "ref", 31 - "ref": "fm.teal.alpha.actor.defs#profileView" 32 - } 33 - } 34 - } 35 - } 36 - } 37 - } 38 - }
-44
crates/lexicons/lexicons/fm_teal_alpha_actor_getProfiles.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.actor.getProfiles", 4 - "description": "This lexicon is in a not officially released state. It is subject to change. | Retrieves the associated profile.", 5 - "defs": { 6 - "main": { 7 - "type": "query", 8 - "parameters": { 9 - "type": "params", 10 - "required": [ 11 - "actors" 12 - ], 13 - "properties": { 14 - "actors": { 15 - "type": "array", 16 - "description": "Array of actor DIDs", 17 - "items": { 18 - "type": "string", 19 - "format": "at-identifier" 20 - } 21 - } 22 - } 23 - }, 24 - "output": { 25 - "encoding": "application/json", 26 - "schema": { 27 - "type": "object", 28 - "required": [ 29 - "actors" 30 - ], 31 - "properties": { 32 - "actors": { 33 - "type": "array", 34 - "items": { 35 - "type": "ref", 36 - "ref": "fm.teal.alpha.actor.defs#miniProfileView" 37 - } 38 - } 39 - } 40 - } 41 - } 42 - } 43 - } 44 - }
-79
crates/lexicons/lexicons/fm_teal_alpha_actor_profile.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.actor.profile", 4 - "defs": { 5 - "featuredItem": { 6 - "type": "object", 7 - "required": [ 8 - "mbid", 9 - "type" 10 - ], 11 - "properties": { 12 - "mbid": { 13 - "type": "string", 14 - "description": "The Musicbrainz ID of the item" 15 - }, 16 - "type": { 17 - "type": "string", 18 - "description": "The type of the item. Must be a valid Musicbrainz type, e.g. album, track, recording, etc." 19 - } 20 - } 21 - }, 22 - "main": { 23 - "type": "record", 24 - "description": "This lexicon is in a not officially released state. It is subject to change. | A declaration of a teal.fm account profile.", 25 - "key": "literal:self", 26 - "record": { 27 - "type": "object", 28 - "properties": { 29 - "avatar": { 30 - "type": "blob", 31 - "description": "Small image to be displayed next to posts from account. AKA, 'profile picture'", 32 - "accept": [ 33 - "image/png", 34 - "image/jpeg" 35 - ], 36 - "maxSize": 1000000 37 - }, 38 - "banner": { 39 - "type": "blob", 40 - "description": "Larger horizontal image to display behind profile view.", 41 - "accept": [ 42 - "image/png", 43 - "image/jpeg" 44 - ], 45 - "maxSize": 1000000 46 - }, 47 - "createdAt": { 48 - "type": "string", 49 - "format": "datetime" 50 - }, 51 - "description": { 52 - "type": "string", 53 - "description": "Free-form profile description text.", 54 - "maxLength": 2560, 55 - "maxGraphemes": 256 56 - }, 57 - "descriptionFacets": { 58 - "type": "array", 59 - "description": "Annotations of text in the profile description (mentions, URLs, hashtags, etc).", 60 - "items": { 61 - "type": "ref", 62 - "ref": "app.bsky.richtext.facet" 63 - } 64 - }, 65 - "displayName": { 66 - "type": "string", 67 - "maxLength": 640, 68 - "maxGraphemes": 64 69 - }, 70 - "featuredItem": { 71 - "type": "ref", 72 - "description": "The user's most recent item featured on their profile.", 73 - "ref": "#featuredItem" 74 - } 75 - } 76 - } 77 - } 78 - } 79 - }
-39
crates/lexicons/lexicons/fm_teal_alpha_actor_profileStatus.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.actor.profileStatus", 4 - "defs": { 5 - "main": { 6 - "type": "record", 7 - "description": "This lexicon is in a not officially released state. It is subject to change. | A declaration of the profile status of the actor.", 8 - "key": "literal:self", 9 - "record": { 10 - "type": "object", 11 - "required": [ 12 - "completedOnboarding" 13 - ], 14 - "properties": { 15 - "completedOnboarding": { 16 - "type": "string", 17 - "description": "The onboarding completion status", 18 - "knownValues": [ 19 - "none", 20 - "profileOnboarding", 21 - "playOnboarding", 22 - "complete" 23 - ] 24 - }, 25 - "createdAt": { 26 - "type": "string", 27 - "description": "The timestamp when this status was created", 28 - "format": "datetime" 29 - }, 30 - "updatedAt": { 31 - "type": "string", 32 - "description": "The timestamp when this status was last updated", 33 - "format": "datetime" 34 - } 35 - } 36 - } 37 - } 38 - } 39 - }
-56
crates/lexicons/lexicons/fm_teal_alpha_actor_searchActors.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.actor.searchActors", 4 - "description": "This lexicon is in a not officially released state. It is subject to change. | Searches for actors based on profile contents.", 5 - "defs": { 6 - "main": { 7 - "type": "query", 8 - "parameters": { 9 - "type": "params", 10 - "required": [ 11 - "q" 12 - ], 13 - "properties": { 14 - "cursor": { 15 - "type": "string", 16 - "description": "Cursor for pagination" 17 - }, 18 - "limit": { 19 - "type": "integer", 20 - "description": "The maximum number of actors to return", 21 - "minimum": 1, 22 - "maximum": 25 23 - }, 24 - "q": { 25 - "type": "string", 26 - "description": "The search query", 27 - "maxLength": 640, 28 - "maxGraphemes": 128 29 - } 30 - } 31 - }, 32 - "output": { 33 - "encoding": "application/json", 34 - "schema": { 35 - "type": "object", 36 - "required": [ 37 - "actors" 38 - ], 39 - "properties": { 40 - "actors": { 41 - "type": "array", 42 - "items": { 43 - "type": "ref", 44 - "ref": "fm.teal.alpha.actor.defs#miniProfileView" 45 - } 46 - }, 47 - "cursor": { 48 - "type": "string", 49 - "description": "Cursor for pagination" 50 - } 51 - } 52 - } 53 - } 54 - } 55 - } 56 - }
-34
crates/lexicons/lexicons/fm_teal_alpha_actor_status.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.actor.status", 4 - "defs": { 5 - "main": { 6 - "type": "record", 7 - "description": "This lexicon is in a not officially released state. It is subject to change. | A declaration of the status of the actor. Only one can be shown at a time. If there are multiple, the latest record should be picked and earlier records should be deleted or tombstoned.", 8 - "key": "literal:self", 9 - "record": { 10 - "type": "object", 11 - "required": [ 12 - "time", 13 - "item" 14 - ], 15 - "properties": { 16 - "expiry": { 17 - "type": "string", 18 - "description": "The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time.", 19 - "format": "datetime" 20 - }, 21 - "item": { 22 - "type": "ref", 23 - "ref": "fm.teal.alpha.feed.defs#playView" 24 - }, 25 - "time": { 26 - "type": "string", 27 - "description": "The unix timestamp of when the item was recorded", 28 - "format": "datetime" 29 - } 30 - } 31 - } 32 - } 33 - } 34 - }
-95
crates/lexicons/lexicons/fm_teal_alpha_feed_defs.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.feed.defs", 4 - "description": "This lexicon is in a not officially released state. It is subject to change. | Misc. items related to feeds.", 5 - "defs": { 6 - "artist": { 7 - "type": "object", 8 - "required": [ 9 - "artistName" 10 - ], 11 - "properties": { 12 - "artistMbId": { 13 - "type": "string", 14 - "description": "The Musicbrainz ID of the artist" 15 - }, 16 - "artistName": { 17 - "type": "string", 18 - "description": "The name of the artist", 19 - "minLength": 1, 20 - "maxLength": 256, 21 - "maxGraphemes": 2560 22 - } 23 - } 24 - }, 25 - "playView": { 26 - "type": "object", 27 - "required": [ 28 - "trackName", 29 - "artists" 30 - ], 31 - "properties": { 32 - "artists": { 33 - "type": "array", 34 - "description": "Array of artists in order of original appearance.", 35 - "items": { 36 - "type": "ref", 37 - "ref": "#artist" 38 - } 39 - }, 40 - "duration": { 41 - "type": "integer", 42 - "description": "The length of the track in seconds" 43 - }, 44 - "isrc": { 45 - "type": "string", 46 - "description": "The ISRC code associated with the recording" 47 - }, 48 - "musicServiceBaseDomain": { 49 - "type": "string", 50 - "description": "The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if not provided." 51 - }, 52 - "originUrl": { 53 - "type": "string", 54 - "description": "The URL associated with this track" 55 - }, 56 - "playedTime": { 57 - "type": "string", 58 - "description": "The unix timestamp of when the track was played", 59 - "format": "datetime" 60 - }, 61 - "recordingMbId": { 62 - "type": "string", 63 - "description": "The Musicbrainz recording ID of the track" 64 - }, 65 - "releaseMbId": { 66 - "type": "string", 67 - "description": "The Musicbrainz release ID" 68 - }, 69 - "releaseName": { 70 - "type": "string", 71 - "description": "The name of the release/album", 72 - "maxLength": 256, 73 - "maxGraphemes": 2560 74 - }, 75 - "submissionClientAgent": { 76 - "type": "string", 77 - "description": "A user-agent style string specifying the user agent. e.g. tealtracker/0.0.1b (Linux; Android 13; SM-A715F). Defaults to 'manual/unknown' if not provided.", 78 - "maxLength": 256, 79 - "maxGraphemes": 2560 80 - }, 81 - "trackMbId": { 82 - "type": "string", 83 - "description": "The Musicbrainz ID of the track" 84 - }, 85 - "trackName": { 86 - "type": "string", 87 - "description": "The name of the track", 88 - "minLength": 1, 89 - "maxLength": 256, 90 - "maxGraphemes": 2560 91 - } 92 - } 93 - } 94 - } 95 - }
-49
crates/lexicons/lexicons/fm_teal_alpha_feed_getActorFeed.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.feed.getActorFeed", 4 - "description": "This lexicon is in a not officially released state. It is subject to change. | Retrieves multiple plays from the index or via an author's DID.", 5 - "defs": { 6 - "main": { 7 - "type": "query", 8 - "parameters": { 9 - "type": "params", 10 - "required": [ 11 - "authorDID" 12 - ], 13 - "properties": { 14 - "authorDID": { 15 - "type": "string", 16 - "description": "The author's DID for the play", 17 - "format": "at-identifier" 18 - }, 19 - "cursor": { 20 - "type": "string", 21 - "description": "The cursor to start the query from" 22 - }, 23 - "limit": { 24 - "type": "integer", 25 - "description": "The upper limit of tracks to get per request. Default is 20, max is 50." 26 - } 27 - } 28 - }, 29 - "output": { 30 - "encoding": "application/json", 31 - "schema": { 32 - "type": "object", 33 - "required": [ 34 - "plays" 35 - ], 36 - "properties": { 37 - "plays": { 38 - "type": "array", 39 - "items": { 40 - "type": "ref", 41 - "ref": "fm.teal.alpha.feed.defs#playView" 42 - } 43 - } 44 - } 45 - } 46 - } 47 - } 48 - } 49 - }
-43
crates/lexicons/lexicons/fm_teal_alpha_feed_getPlay.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.feed.getPlay", 4 - "description": "This lexicon is in a not officially released state. It is subject to change. | Retrieves a play given an author DID and record key.", 5 - "defs": { 6 - "main": { 7 - "type": "query", 8 - "parameters": { 9 - "type": "params", 10 - "required": [ 11 - "authorDID", 12 - "rkey" 13 - ], 14 - "properties": { 15 - "authorDID": { 16 - "type": "string", 17 - "description": "The author's DID for the play", 18 - "format": "at-identifier" 19 - }, 20 - "rkey": { 21 - "type": "string", 22 - "description": "The record key of the play" 23 - } 24 - } 25 - }, 26 - "output": { 27 - "encoding": "application/json", 28 - "schema": { 29 - "type": "object", 30 - "required": [ 31 - "play" 32 - ], 33 - "properties": { 34 - "play": { 35 - "type": "ref", 36 - "ref": "fm.teal.alpha.feed.defs#playView" 37 - } 38 - } 39 - } 40 - } 41 - } 42 - } 43 - }
-108
crates/lexicons/lexicons/fm_teal_alpha_feed_play.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.feed.play", 4 - "description": "This lexicon is in a not officially released state. It is subject to change. | A declaration of a teal.fm play. Plays are submitted as a result of a user listening to a track. Plays should be marked as tracked when a user has listened to the entire track if it's under 2 minutes long, or half of the track's duration up to 4 minutes, whichever is longest.", 5 - "defs": { 6 - "main": { 7 - "type": "record", 8 - "key": "tid", 9 - "record": { 10 - "type": "object", 11 - "required": [ 12 - "trackName" 13 - ], 14 - "properties": { 15 - "artistMbIds": { 16 - "type": "array", 17 - "description": "Array of Musicbrainz artist IDs. Prefer using 'artists'.", 18 - "items": { 19 - "type": "string" 20 - } 21 - }, 22 - "artistNames": { 23 - "type": "array", 24 - "description": "Array of artist names in order of original appearance. Prefer using 'artists'.", 25 - "items": { 26 - "type": "string", 27 - "minLength": 1, 28 - "maxLength": 256, 29 - "maxGraphemes": 2560 30 - } 31 - }, 32 - "artists": { 33 - "type": "array", 34 - "description": "Array of artists in order of original appearance.", 35 - "items": { 36 - "type": "ref", 37 - "ref": "fm.teal.alpha.feed.defs#artist" 38 - } 39 - }, 40 - "duration": { 41 - "type": "integer", 42 - "description": "The length of the track in seconds" 43 - }, 44 - "isrc": { 45 - "type": "string", 46 - "description": "The ISRC code associated with the recording" 47 - }, 48 - "musicServiceBaseDomain": { 49 - "type": "string", 50 - "description": "The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if unavailable or not provided." 51 - }, 52 - "originUrl": { 53 - "type": "string", 54 - "description": "The URL associated with this track" 55 - }, 56 - "playedTime": { 57 - "type": "string", 58 - "description": "The unix timestamp of when the track was played", 59 - "format": "datetime" 60 - }, 61 - "recordingMbId": { 62 - "type": "string", 63 - "description": "The Musicbrainz recording ID of the track" 64 - }, 65 - "releaseDiscriminant": { 66 - "type": "string", 67 - "description": "Distinguishing information for release variants (e.g. 'Deluxe Edition', 'Remastered', '2023 Remaster', 'Special Edition'). Used to differentiate between different versions of the same base release while maintaining grouping capabilities.", 68 - "maxLength": 128, 69 - "maxGraphemes": 1280 70 - }, 71 - "releaseMbId": { 72 - "type": "string", 73 - "description": "The Musicbrainz release ID" 74 - }, 75 - "releaseName": { 76 - "type": "string", 77 - "description": "The name of the release/album", 78 - "maxLength": 256, 79 - "maxGraphemes": 2560 80 - }, 81 - "submissionClientAgent": { 82 - "type": "string", 83 - "description": "A metadata string specifying the user agent where the format is `<app-identifier>/<version> (<kernel/OS-base>; <platform/OS-version>; <device-model>)`. If string is provided, only `app-identifier` and `version` are required. `app-identifier` is recommended to be in reverse dns format. Defaults to 'manual/unknown' if unavailable or not provided.", 84 - "maxLength": 256, 85 - "maxGraphemes": 2560 86 - }, 87 - "trackDiscriminant": { 88 - "type": "string", 89 - "description": "Distinguishing information for track variants (e.g. 'Acoustic Version', 'Live at Wembley', 'Radio Edit', 'Demo'). Used to differentiate between different versions of the same base track while maintaining grouping capabilities.", 90 - "maxLength": 128, 91 - "maxGraphemes": 1280 92 - }, 93 - "trackMbId": { 94 - "type": "string", 95 - "description": "The Musicbrainz ID of the track" 96 - }, 97 - "trackName": { 98 - "type": "string", 99 - "description": "The name of the track", 100 - "minLength": 1, 101 - "maxLength": 256, 102 - "maxGraphemes": 2560 103 - } 104 - } 105 - } 106 - } 107 - } 108 - }
-72
crates/lexicons/lexicons/fm_teal_alpha_stats_defs.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.stats.defs", 4 - "defs": { 5 - "artistView": { 6 - "type": "object", 7 - "required": [ 8 - "mbid", 9 - "name", 10 - "playCount" 11 - ], 12 - "properties": { 13 - "mbid": { 14 - "type": "string", 15 - "description": "MusicBrainz artist ID" 16 - }, 17 - "name": { 18 - "type": "string", 19 - "description": "Artist name" 20 - }, 21 - "playCount": { 22 - "type": "integer", 23 - "description": "Total number of plays for this artist" 24 - } 25 - } 26 - }, 27 - "recordingView": { 28 - "type": "object", 29 - "required": [ 30 - "mbid", 31 - "name", 32 - "playCount" 33 - ], 34 - "properties": { 35 - "mbid": { 36 - "type": "string", 37 - "description": "MusicBrainz recording ID" 38 - }, 39 - "name": { 40 - "type": "string", 41 - "description": "Recording/track name" 42 - }, 43 - "playCount": { 44 - "type": "integer", 45 - "description": "Total number of plays for this recording" 46 - } 47 - } 48 - }, 49 - "releaseView": { 50 - "type": "object", 51 - "required": [ 52 - "mbid", 53 - "name", 54 - "playCount" 55 - ], 56 - "properties": { 57 - "mbid": { 58 - "type": "string", 59 - "description": "MusicBrainz release ID" 60 - }, 61 - "name": { 62 - "type": "string", 63 - "description": "Release/album name" 64 - }, 65 - "playCount": { 66 - "type": "integer", 67 - "description": "Total number of plays for this release" 68 - } 69 - } 70 - } 71 - } 72 - }
-40
crates/lexicons/lexicons/fm_teal_alpha_stats_getLatest.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.stats.getLatest", 4 - "defs": { 5 - "main": { 6 - "type": "query", 7 - "description": "Get latest plays globally", 8 - "parameters": { 9 - "type": "params", 10 - "properties": { 11 - "limit": { 12 - "type": "integer", 13 - "description": "Number of latest plays to return", 14 - "default": 50, 15 - "minimum": 1, 16 - "maximum": 100 17 - } 18 - } 19 - }, 20 - "output": { 21 - "encoding": "application/json", 22 - "schema": { 23 - "type": "object", 24 - "required": [ 25 - "plays" 26 - ], 27 - "properties": { 28 - "plays": { 29 - "type": "array", 30 - "items": { 31 - "type": "ref", 32 - "ref": "fm.teal.alpha.feed.defs#playView" 33 - } 34 - } 35 - } 36 - } 37 - } 38 - } 39 - } 40 - }
-58
crates/lexicons/lexicons/fm_teal_alpha_stats_getTopArtists.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.stats.getTopArtists", 4 - "description": "Get top artists by play count", 5 - "defs": { 6 - "main": { 7 - "type": "query", 8 - "parameters": { 9 - "type": "params", 10 - "properties": { 11 - "cursor": { 12 - "type": "string", 13 - "description": "Pagination cursor" 14 - }, 15 - "limit": { 16 - "type": "integer", 17 - "description": "Number of artists to return", 18 - "default": 50, 19 - "minimum": 1, 20 - "maximum": 100 21 - }, 22 - "period": { 23 - "type": "string", 24 - "description": "Time period for top artists", 25 - "default": "all", 26 - "enum": [ 27 - "all", 28 - "30days", 29 - "7days" 30 - ] 31 - } 32 - } 33 - }, 34 - "output": { 35 - "encoding": "application/json", 36 - "schema": { 37 - "type": "object", 38 - "required": [ 39 - "artists" 40 - ], 41 - "properties": { 42 - "artists": { 43 - "type": "array", 44 - "items": { 45 - "type": "ref", 46 - "ref": "fm.teal.alpha.stats.defs#artistView" 47 - } 48 - }, 49 - "cursor": { 50 - "type": "string", 51 - "description": "Next page cursor" 52 - } 53 - } 54 - } 55 - } 56 - } 57 - } 58 - }
-58
crates/lexicons/lexicons/fm_teal_alpha_stats_getTopReleases.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.stats.getTopReleases", 4 - "description": "Get top releases/albums by play count", 5 - "defs": { 6 - "main": { 7 - "type": "query", 8 - "parameters": { 9 - "type": "params", 10 - "properties": { 11 - "cursor": { 12 - "type": "string", 13 - "description": "Pagination cursor" 14 - }, 15 - "limit": { 16 - "type": "integer", 17 - "description": "Number of releases to return", 18 - "default": 50, 19 - "minimum": 1, 20 - "maximum": 100 21 - }, 22 - "period": { 23 - "type": "string", 24 - "description": "Time period for top releases", 25 - "default": "all", 26 - "enum": [ 27 - "all", 28 - "30days", 29 - "7days" 30 - ] 31 - } 32 - } 33 - }, 34 - "output": { 35 - "encoding": "application/json", 36 - "schema": { 37 - "type": "object", 38 - "required": [ 39 - "releases" 40 - ], 41 - "properties": { 42 - "cursor": { 43 - "type": "string", 44 - "description": "Next page cursor" 45 - }, 46 - "releases": { 47 - "type": "array", 48 - "items": { 49 - "type": "ref", 50 - "ref": "fm.teal.alpha.stats.defs#releaseView" 51 - } 52 - } 53 - } 54 - } 55 - } 56 - } 57 - } 58 - }
-65
crates/lexicons/lexicons/fm_teal_alpha_stats_getUserTopArtists.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.stats.getUserTopArtists", 4 - "description": "Get a user's top artists by play count", 5 - "defs": { 6 - "main": { 7 - "type": "query", 8 - "parameters": { 9 - "type": "params", 10 - "required": [ 11 - "actor" 12 - ], 13 - "properties": { 14 - "actor": { 15 - "type": "string", 16 - "description": "The user's DID or handle", 17 - "format": "at-identifier" 18 - }, 19 - "cursor": { 20 - "type": "string", 21 - "description": "Pagination cursor" 22 - }, 23 - "limit": { 24 - "type": "integer", 25 - "description": "Number of artists to return", 26 - "default": 50, 27 - "minimum": 1, 28 - "maximum": 100 29 - }, 30 - "period": { 31 - "type": "string", 32 - "description": "Time period for top artists", 33 - "default": "30days", 34 - "enum": [ 35 - "30days", 36 - "7days" 37 - ] 38 - } 39 - } 40 - }, 41 - "output": { 42 - "encoding": "application/json", 43 - "schema": { 44 - "type": "object", 45 - "required": [ 46 - "artists" 47 - ], 48 - "properties": { 49 - "artists": { 50 - "type": "array", 51 - "items": { 52 - "type": "ref", 53 - "ref": "fm.teal.alpha.stats.defs#artistView" 54 - } 55 - }, 56 - "cursor": { 57 - "type": "string", 58 - "description": "Next page cursor" 59 - } 60 - } 61 - } 62 - } 63 - } 64 - } 65 - }
-65
crates/lexicons/lexicons/fm_teal_alpha_stats_getUserTopReleases.json
··· 1 - { 2 - "lexicon": 1, 3 - "id": "fm.teal.alpha.stats.getUserTopReleases", 4 - "description": "Get a user's top releases/albums by play count", 5 - "defs": { 6 - "main": { 7 - "type": "query", 8 - "parameters": { 9 - "type": "params", 10 - "required": [ 11 - "actor" 12 - ], 13 - "properties": { 14 - "actor": { 15 - "type": "string", 16 - "description": "The user's DID or handle", 17 - "format": "at-identifier" 18 - }, 19 - "cursor": { 20 - "type": "string", 21 - "description": "Pagination cursor" 22 - }, 23 - "limit": { 24 - "type": "integer", 25 - "description": "Number of releases to return", 26 - "default": 50, 27 - "minimum": 1, 28 - "maximum": 100 29 - }, 30 - "period": { 31 - "type": "string", 32 - "description": "Time period for top releases", 33 - "default": "30days", 34 - "enum": [ 35 - "30days", 36 - "7days" 37 - ] 38 - } 39 - } 40 - }, 41 - "output": { 42 - "encoding": "application/json", 43 - "schema": { 44 - "type": "object", 45 - "required": [ 46 - "releases" 47 - ], 48 - "properties": { 49 - "cursor": { 50 - "type": "string", 51 - "description": "Next page cursor" 52 - }, 53 - "releases": { 54 - "type": "array", 55 - "items": { 56 - "type": "ref", 57 - "ref": "fm.teal.alpha.stats.defs#releaseView" 58 - } 59 - } 60 - } 61 - } 62 - } 63 - } 64 - } 65 - }
-43
crates/lexicons/src/builder_types.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 - /// Marker type indicating a builder field has been set 7 - pub struct Set<T>(pub T); 8 - impl<T> Set<T> { 9 - /// Extract the inner value 10 - #[inline] 11 - pub fn into_inner(self) -> T { 12 - self.0 13 - } 14 - } 15 - 16 - /// Marker type indicating a builder field has not been set 17 - pub struct Unset; 18 - /// Trait indicating a builder field is set (has a value) 19 - #[rustversion::attr( 20 - since(1.78.0), 21 - diagnostic::on_unimplemented( 22 - message = "the field `{Self}` was not set, but this method requires it to be set", 23 - label = "the field `{Self}` was not set" 24 - ) 25 - )] 26 - pub trait IsSet: private::Sealed {} 27 - /// Trait indicating a builder field is unset (no value yet) 28 - #[rustversion::attr( 29 - since(1.78.0), 30 - diagnostic::on_unimplemented( 31 - message = "the field `{Self}` was already set, but this method requires it to be unset", 32 - label = "the field `{Self}` was already set" 33 - ) 34 - )] 35 - pub trait IsUnset: private::Sealed {} 36 - impl<T> IsSet for Set<T> {} 37 - impl IsUnset for Unset {} 38 - mod private { 39 - /// Sealed trait to prevent external implementations 40 - pub trait Sealed {} 41 - impl<T> Sealed for super::Set<T> {} 42 - impl Sealed for super::Unset {} 43 - }
-6
crates/lexicons/src/fm_teal.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 alpha;
-8
crates/lexicons/src/fm_teal/alpha.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 actor; 7 - pub mod feed; 8 - pub mod stats;
-496
crates/lexicons/src/fm_teal/alpha/actor.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.actor.defs 4 - // 5 - // This file was automatically generated from Lexicon schemas. 6 - // Any manual changes will be overwritten on the next regeneration. 7 - 8 - pub mod get_profile; 9 - pub mod get_profiles; 10 - pub mod profile; 11 - pub mod profile_status; 12 - pub mod search_actors; 13 - pub mod status; 14 - 15 - #[jacquard_derive::lexicon] 16 - #[derive( 17 - serde::Serialize, 18 - serde::Deserialize, 19 - Debug, 20 - Clone, 21 - PartialEq, 22 - Eq, 23 - jacquard_derive::IntoStatic, 24 - Default, 25 - )] 26 - #[serde(rename_all = "camelCase")] 27 - pub struct MiniProfileView<'a> { 28 - /// IPLD of the avatar 29 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 30 - #[serde(borrow)] 31 - pub avatar: std::option::Option<jacquard_common::CowStr<'a>>, 32 - /// The decentralized identifier of the actor 33 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 34 - #[serde(borrow)] 35 - pub did: std::option::Option<jacquard_common::CowStr<'a>>, 36 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 37 - #[serde(borrow)] 38 - pub display_name: std::option::Option<jacquard_common::CowStr<'a>>, 39 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 40 - #[serde(borrow)] 41 - pub handle: std::option::Option<jacquard_common::CowStr<'a>>, 42 - } 43 - 44 - fn lexicon_doc_fm_teal_alpha_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 45 - ::jacquard_lexicon::lexicon::LexiconDoc { 46 - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 47 - id: ::jacquard_common::CowStr::new_static("fm.teal.alpha.actor.defs"), 48 - revision: None, 49 - description: None, 50 - defs: { 51 - let mut map = ::alloc::collections::BTreeMap::new(); 52 - map.insert( 53 - ::jacquard_common::smol_str::SmolStr::new_static("miniProfileView"), 54 - ::jacquard_lexicon::lexicon::LexUserType::Object( 55 - ::jacquard_lexicon::lexicon::LexObject { 56 - description: None, 57 - required: None, 58 - nullable: None, 59 - properties: { 60 - #[allow(unused_mut)] 61 - let mut map = ::alloc::collections::BTreeMap::new(); 62 - map.insert( 63 - ::jacquard_common::smol_str::SmolStr::new_static("avatar"), 64 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 65 - ::jacquard_lexicon::lexicon::LexString { 66 - description: Some(::jacquard_common::CowStr::new_static( 67 - "IPLD of the avatar", 68 - )), 69 - format: None, 70 - default: None, 71 - min_length: None, 72 - max_length: None, 73 - min_graphemes: None, 74 - max_graphemes: None, 75 - r#enum: None, 76 - r#const: None, 77 - known_values: None, 78 - }, 79 - ), 80 - ); 81 - map.insert( 82 - ::jacquard_common::smol_str::SmolStr::new_static("did"), 83 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 84 - ::jacquard_lexicon::lexicon::LexString { 85 - description: Some(::jacquard_common::CowStr::new_static( 86 - "The decentralized identifier of the actor", 87 - )), 88 - format: None, 89 - default: None, 90 - min_length: None, 91 - max_length: None, 92 - min_graphemes: None, 93 - max_graphemes: None, 94 - r#enum: None, 95 - r#const: None, 96 - known_values: None, 97 - }, 98 - ), 99 - ); 100 - map.insert( 101 - ::jacquard_common::smol_str::SmolStr::new_static("displayName"), 102 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 103 - ::jacquard_lexicon::lexicon::LexString { 104 - description: None, 105 - format: None, 106 - default: None, 107 - min_length: None, 108 - max_length: None, 109 - min_graphemes: None, 110 - max_graphemes: None, 111 - r#enum: None, 112 - r#const: None, 113 - known_values: None, 114 - }, 115 - ), 116 - ); 117 - map.insert( 118 - ::jacquard_common::smol_str::SmolStr::new_static("handle"), 119 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 120 - ::jacquard_lexicon::lexicon::LexString { 121 - description: None, 122 - format: None, 123 - default: None, 124 - min_length: None, 125 - max_length: None, 126 - min_graphemes: None, 127 - max_graphemes: None, 128 - r#enum: None, 129 - r#const: None, 130 - known_values: None, 131 - }, 132 - ), 133 - ); 134 - map 135 - }, 136 - }, 137 - ), 138 - ); 139 - map.insert( 140 - ::jacquard_common::smol_str::SmolStr::new_static("profileView"), 141 - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 142 - description: None, 143 - required: None, 144 - nullable: None, 145 - properties: { 146 - #[allow(unused_mut)] 147 - let mut map = ::alloc::collections::BTreeMap::new(); 148 - map.insert( 149 - ::jacquard_common::smol_str::SmolStr::new_static("avatar"), 150 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 151 - description: Some( 152 - ::jacquard_common::CowStr::new_static("IPLD of the avatar"), 153 - ), 154 - format: None, 155 - default: None, 156 - min_length: None, 157 - max_length: None, 158 - min_graphemes: None, 159 - max_graphemes: None, 160 - r#enum: None, 161 - r#const: None, 162 - known_values: None, 163 - }), 164 - ); 165 - map.insert( 166 - ::jacquard_common::smol_str::SmolStr::new_static("banner"), 167 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 168 - description: Some( 169 - ::jacquard_common::CowStr::new_static( 170 - "IPLD of the banner image", 171 - ), 172 - ), 173 - format: None, 174 - default: None, 175 - min_length: None, 176 - max_length: None, 177 - min_graphemes: None, 178 - max_graphemes: None, 179 - r#enum: None, 180 - r#const: None, 181 - known_values: None, 182 - }), 183 - ); 184 - map.insert( 185 - ::jacquard_common::smol_str::SmolStr::new_static( 186 - "createdAt", 187 - ), 188 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 189 - description: None, 190 - format: Some( 191 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 192 - ), 193 - default: None, 194 - min_length: None, 195 - max_length: None, 196 - min_graphemes: None, 197 - max_graphemes: None, 198 - r#enum: None, 199 - r#const: None, 200 - known_values: None, 201 - }), 202 - ); 203 - map.insert( 204 - ::jacquard_common::smol_str::SmolStr::new_static( 205 - "description", 206 - ), 207 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 208 - description: Some( 209 - ::jacquard_common::CowStr::new_static( 210 - "Free-form profile description text.", 211 - ), 212 - ), 213 - format: None, 214 - default: None, 215 - min_length: None, 216 - max_length: None, 217 - min_graphemes: None, 218 - max_graphemes: None, 219 - r#enum: None, 220 - r#const: None, 221 - known_values: None, 222 - }), 223 - ); 224 - map.insert( 225 - ::jacquard_common::smol_str::SmolStr::new_static( 226 - "descriptionFacets", 227 - ), 228 - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 229 - description: Some( 230 - ::jacquard_common::CowStr::new_static( 231 - "Annotations of text in the profile description (mentions, URLs, hashtags, etc). May be changed to another (backwards compatible) lexicon.", 232 - ), 233 - ), 234 - items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 235 - description: None, 236 - r#ref: ::jacquard_common::CowStr::new_static( 237 - "app.bsky.richtext.facet", 238 - ), 239 - }), 240 - min_length: None, 241 - max_length: None, 242 - }), 243 - ); 244 - map.insert( 245 - ::jacquard_common::smol_str::SmolStr::new_static("did"), 246 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 247 - description: Some( 248 - ::jacquard_common::CowStr::new_static( 249 - "The decentralized identifier of the actor", 250 - ), 251 - ), 252 - format: None, 253 - default: None, 254 - min_length: None, 255 - max_length: None, 256 - min_graphemes: None, 257 - max_graphemes: None, 258 - r#enum: None, 259 - r#const: None, 260 - known_values: None, 261 - }), 262 - ); 263 - map.insert( 264 - ::jacquard_common::smol_str::SmolStr::new_static( 265 - "displayName", 266 - ), 267 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 268 - description: None, 269 - format: None, 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 - map.insert( 281 - ::jacquard_common::smol_str::SmolStr::new_static( 282 - "featuredItem", 283 - ), 284 - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 285 - description: None, 286 - r#ref: ::jacquard_common::CowStr::new_static( 287 - "fm.teal.alpha.actor.profile#featuredItem", 288 - ), 289 - }), 290 - ); 291 - map.insert( 292 - ::jacquard_common::smol_str::SmolStr::new_static("status"), 293 - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 294 - description: None, 295 - r#ref: ::jacquard_common::CowStr::new_static("#statusView"), 296 - }), 297 - ); 298 - map 299 - }, 300 - }), 301 - ); 302 - map.insert( 303 - ::jacquard_common::smol_str::SmolStr::new_static("statusView"), 304 - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 305 - description: Some( 306 - ::jacquard_common::CowStr::new_static( 307 - "A declaration of the status of the actor.", 308 - ), 309 - ), 310 - required: None, 311 - nullable: None, 312 - properties: { 313 - #[allow(unused_mut)] 314 - let mut map = ::alloc::collections::BTreeMap::new(); 315 - map.insert( 316 - ::jacquard_common::smol_str::SmolStr::new_static("expiry"), 317 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 318 - description: Some( 319 - ::jacquard_common::CowStr::new_static( 320 - "The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time.", 321 - ), 322 - ), 323 - format: Some( 324 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 325 - ), 326 - default: None, 327 - min_length: None, 328 - max_length: None, 329 - min_graphemes: None, 330 - max_graphemes: None, 331 - r#enum: None, 332 - r#const: None, 333 - known_values: None, 334 - }), 335 - ); 336 - map.insert( 337 - ::jacquard_common::smol_str::SmolStr::new_static("item"), 338 - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 339 - description: None, 340 - r#ref: ::jacquard_common::CowStr::new_static( 341 - "fm.teal.alpha.feed.defs#playView", 342 - ), 343 - }), 344 - ); 345 - map.insert( 346 - ::jacquard_common::smol_str::SmolStr::new_static("time"), 347 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 348 - description: Some( 349 - ::jacquard_common::CowStr::new_static( 350 - "The unix timestamp of when the item was recorded", 351 - ), 352 - ), 353 - format: Some( 354 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 355 - ), 356 - default: None, 357 - min_length: None, 358 - max_length: None, 359 - min_graphemes: None, 360 - max_graphemes: None, 361 - r#enum: None, 362 - r#const: None, 363 - known_values: None, 364 - }), 365 - ); 366 - map 367 - }, 368 - }), 369 - ); 370 - map 371 - }, 372 - } 373 - } 374 - 375 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for MiniProfileView<'a> { 376 - fn nsid() -> &'static str { 377 - "fm.teal.alpha.actor.defs" 378 - } 379 - fn def_name() -> &'static str { 380 - "miniProfileView" 381 - } 382 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 383 - lexicon_doc_fm_teal_alpha_actor_defs() 384 - } 385 - fn validate( 386 - &self, 387 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 388 - Ok(()) 389 - } 390 - } 391 - 392 - #[jacquard_derive::lexicon] 393 - #[derive( 394 - serde::Serialize, 395 - serde::Deserialize, 396 - Debug, 397 - Clone, 398 - PartialEq, 399 - Eq, 400 - jacquard_derive::IntoStatic, 401 - Default, 402 - )] 403 - #[serde(rename_all = "camelCase")] 404 - pub struct ProfileView<'a> { 405 - /// IPLD of the avatar 406 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 407 - #[serde(borrow)] 408 - pub avatar: std::option::Option<jacquard_common::CowStr<'a>>, 409 - /// IPLD of the banner image 410 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 411 - #[serde(borrow)] 412 - pub banner: std::option::Option<jacquard_common::CowStr<'a>>, 413 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 414 - pub created_at: std::option::Option<jacquard_common::types::string::Datetime>, 415 - /// Free-form profile description text. 416 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 417 - #[serde(borrow)] 418 - pub description: std::option::Option<jacquard_common::CowStr<'a>>, 419 - /// Annotations of text in the profile description (mentions, URLs, hashtags, etc). May be changed to another (backwards compatible) lexicon. 420 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 421 - #[serde(borrow)] 422 - pub description_facets: std::option::Option<Vec<jacquard_common::types::value::Data<'a>>>, 423 - /// The decentralized identifier of the actor 424 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 425 - #[serde(borrow)] 426 - pub did: std::option::Option<jacquard_common::CowStr<'a>>, 427 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 428 - #[serde(borrow)] 429 - pub display_name: std::option::Option<jacquard_common::CowStr<'a>>, 430 - /// The user's most recent item featured on their profile. 431 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 432 - #[serde(borrow)] 433 - pub featured_item: std::option::Option<crate::fm_teal::alpha::actor::profile::FeaturedItem<'a>>, 434 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 435 - #[serde(borrow)] 436 - pub status: std::option::Option<crate::fm_teal::alpha::actor::StatusView<'a>>, 437 - } 438 - 439 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileView<'a> { 440 - fn nsid() -> &'static str { 441 - "fm.teal.alpha.actor.defs" 442 - } 443 - fn def_name() -> &'static str { 444 - "profileView" 445 - } 446 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 447 - lexicon_doc_fm_teal_alpha_actor_defs() 448 - } 449 - fn validate( 450 - &self, 451 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 452 - Ok(()) 453 - } 454 - } 455 - 456 - /// A declaration of the status of the actor. 457 - #[jacquard_derive::lexicon] 458 - #[derive( 459 - serde::Serialize, 460 - serde::Deserialize, 461 - Debug, 462 - Clone, 463 - PartialEq, 464 - Eq, 465 - jacquard_derive::IntoStatic, 466 - Default, 467 - )] 468 - #[serde(rename_all = "camelCase")] 469 - pub struct StatusView<'a> { 470 - /// The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time. 471 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 472 - pub expiry: std::option::Option<jacquard_common::types::string::Datetime>, 473 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 474 - #[serde(borrow)] 475 - pub item: std::option::Option<crate::fm_teal::alpha::feed::PlayView<'a>>, 476 - /// The unix timestamp of when the item was recorded 477 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 478 - pub time: std::option::Option<jacquard_common::types::string::Datetime>, 479 - } 480 - 481 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for StatusView<'a> { 482 - fn nsid() -> &'static str { 483 - "fm.teal.alpha.actor.defs" 484 - } 485 - fn def_name() -> &'static str { 486 - "statusView" 487 - } 488 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 489 - lexicon_doc_fm_teal_alpha_actor_defs() 490 - } 491 - fn validate( 492 - &self, 493 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 494 - Ok(()) 495 - } 496 - }
-141
crates/lexicons/src/fm_teal/alpha/actor/get_profile.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.actor.getProfile 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 GetProfile<'a> { 13 - #[serde(borrow)] 14 - pub actor: jacquard_common::types::ident::AtIdentifier<'a>, 15 - } 16 - 17 - pub mod get_profile_state { 18 - 19 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 20 - #[allow(unused)] 21 - use ::core::marker::PhantomData; 22 - mod sealed { 23 - pub trait Sealed {} 24 - } 25 - /// State trait tracking which required fields have been set 26 - pub trait State: sealed::Sealed { 27 - type Actor; 28 - } 29 - /// Empty state - all required fields are unset 30 - pub struct Empty(()); 31 - impl sealed::Sealed for Empty {} 32 - impl State for Empty { 33 - type Actor = Unset; 34 - } 35 - ///State transition - sets the `actor` field to Set 36 - pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 37 - impl<S: State> sealed::Sealed for SetActor<S> {} 38 - impl<S: State> State for SetActor<S> { 39 - type Actor = Set<members::actor>; 40 - } 41 - /// Marker types for field names 42 - #[allow(non_camel_case_types)] 43 - pub mod members { 44 - ///Marker type for the `actor` field 45 - pub struct actor(()); 46 - } 47 - } 48 - 49 - /// Builder for constructing an instance of this type 50 - pub struct GetProfileBuilder<'a, S: get_profile_state::State> { 51 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 52 - __unsafe_private_named: 53 - (::core::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>,), 54 - _phantom: ::core::marker::PhantomData<&'a ()>, 55 - } 56 - 57 - impl<'a> GetProfile<'a> { 58 - /// Create a new builder for this type 59 - pub fn new() -> GetProfileBuilder<'a, get_profile_state::Empty> { 60 - GetProfileBuilder::new() 61 - } 62 - } 63 - 64 - impl<'a> GetProfileBuilder<'a, get_profile_state::Empty> { 65 - /// Create a new builder with all fields unset 66 - pub fn new() -> Self { 67 - GetProfileBuilder { 68 - _phantom_state: ::core::marker::PhantomData, 69 - __unsafe_private_named: (None,), 70 - _phantom: ::core::marker::PhantomData, 71 - } 72 - } 73 - } 74 - 75 - impl<'a, S> GetProfileBuilder<'a, S> 76 - where 77 - S: get_profile_state::State, 78 - S::Actor: get_profile_state::IsUnset, 79 - { 80 - /// Set the `actor` field (required) 81 - pub fn actor( 82 - mut self, 83 - value: impl Into<jacquard_common::types::ident::AtIdentifier<'a>>, 84 - ) -> GetProfileBuilder<'a, get_profile_state::SetActor<S>> { 85 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 86 - GetProfileBuilder { 87 - _phantom_state: ::core::marker::PhantomData, 88 - __unsafe_private_named: self.__unsafe_private_named, 89 - _phantom: ::core::marker::PhantomData, 90 - } 91 - } 92 - } 93 - 94 - impl<'a, S> GetProfileBuilder<'a, S> 95 - where 96 - S: get_profile_state::State, 97 - S::Actor: get_profile_state::IsSet, 98 - { 99 - /// Build the final struct 100 - pub fn build(self) -> GetProfile<'a> { 101 - GetProfile { 102 - actor: self.__unsafe_private_named.0.unwrap(), 103 - } 104 - } 105 - } 106 - 107 - #[jacquard_derive::lexicon] 108 - #[derive( 109 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 110 - )] 111 - #[serde(rename_all = "camelCase")] 112 - pub struct GetProfileOutput<'a> { 113 - #[serde(borrow)] 114 - pub actor: crate::fm_teal::alpha::actor::ProfileView<'a>, 115 - } 116 - 117 - /// Response type for 118 - ///fm.teal.alpha.actor.getProfile 119 - pub struct GetProfileResponse; 120 - impl jacquard_common::xrpc::XrpcResp for GetProfileResponse { 121 - const NSID: &'static str = "fm.teal.alpha.actor.getProfile"; 122 - const ENCODING: &'static str = "application/json"; 123 - type Output<'de> = GetProfileOutput<'de>; 124 - type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 125 - } 126 - 127 - impl<'a> jacquard_common::xrpc::XrpcRequest for GetProfile<'a> { 128 - const NSID: &'static str = "fm.teal.alpha.actor.getProfile"; 129 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 130 - type Response = GetProfileResponse; 131 - } 132 - 133 - /// Endpoint type for 134 - ///fm.teal.alpha.actor.getProfile 135 - pub struct GetProfileRequest; 136 - impl jacquard_common::xrpc::XrpcEndpoint for GetProfileRequest { 137 - const PATH: &'static str = "/xrpc/fm.teal.alpha.actor.getProfile"; 138 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 139 - type Request<'de> = GetProfile<'de>; 140 - type Response = GetProfileResponse; 141 - }
-141
crates/lexicons/src/fm_teal/alpha/actor/get_profiles.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.actor.getProfiles 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 GetProfiles<'a> { 13 - #[serde(borrow)] 14 - pub actors: Vec<jacquard_common::types::ident::AtIdentifier<'a>>, 15 - } 16 - 17 - pub mod get_profiles_state { 18 - 19 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 20 - #[allow(unused)] 21 - use ::core::marker::PhantomData; 22 - mod sealed { 23 - pub trait Sealed {} 24 - } 25 - /// State trait tracking which required fields have been set 26 - pub trait State: sealed::Sealed { 27 - type Actors; 28 - } 29 - /// Empty state - all required fields are unset 30 - pub struct Empty(()); 31 - impl sealed::Sealed for Empty {} 32 - impl State for Empty { 33 - type Actors = Unset; 34 - } 35 - ///State transition - sets the `actors` field to Set 36 - pub struct SetActors<S: State = Empty>(PhantomData<fn() -> S>); 37 - impl<S: State> sealed::Sealed for SetActors<S> {} 38 - impl<S: State> State for SetActors<S> { 39 - type Actors = Set<members::actors>; 40 - } 41 - /// Marker types for field names 42 - #[allow(non_camel_case_types)] 43 - pub mod members { 44 - ///Marker type for the `actors` field 45 - pub struct actors(()); 46 - } 47 - } 48 - 49 - /// Builder for constructing an instance of this type 50 - pub struct GetProfilesBuilder<'a, S: get_profiles_state::State> { 51 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 52 - __unsafe_private_named: 53 - (::core::option::Option<Vec<jacquard_common::types::ident::AtIdentifier<'a>>>,), 54 - _phantom: ::core::marker::PhantomData<&'a ()>, 55 - } 56 - 57 - impl<'a> GetProfiles<'a> { 58 - /// Create a new builder for this type 59 - pub fn new() -> GetProfilesBuilder<'a, get_profiles_state::Empty> { 60 - GetProfilesBuilder::new() 61 - } 62 - } 63 - 64 - impl<'a> GetProfilesBuilder<'a, get_profiles_state::Empty> { 65 - /// Create a new builder with all fields unset 66 - pub fn new() -> Self { 67 - GetProfilesBuilder { 68 - _phantom_state: ::core::marker::PhantomData, 69 - __unsafe_private_named: (None,), 70 - _phantom: ::core::marker::PhantomData, 71 - } 72 - } 73 - } 74 - 75 - impl<'a, S> GetProfilesBuilder<'a, S> 76 - where 77 - S: get_profiles_state::State, 78 - S::Actors: get_profiles_state::IsUnset, 79 - { 80 - /// Set the `actors` field (required) 81 - pub fn actors( 82 - mut self, 83 - value: impl Into<Vec<jacquard_common::types::ident::AtIdentifier<'a>>>, 84 - ) -> GetProfilesBuilder<'a, get_profiles_state::SetActors<S>> { 85 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 86 - GetProfilesBuilder { 87 - _phantom_state: ::core::marker::PhantomData, 88 - __unsafe_private_named: self.__unsafe_private_named, 89 - _phantom: ::core::marker::PhantomData, 90 - } 91 - } 92 - } 93 - 94 - impl<'a, S> GetProfilesBuilder<'a, S> 95 - where 96 - S: get_profiles_state::State, 97 - S::Actors: get_profiles_state::IsSet, 98 - { 99 - /// Build the final struct 100 - pub fn build(self) -> GetProfiles<'a> { 101 - GetProfiles { 102 - actors: self.__unsafe_private_named.0.unwrap(), 103 - } 104 - } 105 - } 106 - 107 - #[jacquard_derive::lexicon] 108 - #[derive( 109 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 110 - )] 111 - #[serde(rename_all = "camelCase")] 112 - pub struct GetProfilesOutput<'a> { 113 - #[serde(borrow)] 114 - pub actors: Vec<crate::fm_teal::alpha::actor::MiniProfileView<'a>>, 115 - } 116 - 117 - /// Response type for 118 - ///fm.teal.alpha.actor.getProfiles 119 - pub struct GetProfilesResponse; 120 - impl jacquard_common::xrpc::XrpcResp for GetProfilesResponse { 121 - const NSID: &'static str = "fm.teal.alpha.actor.getProfiles"; 122 - const ENCODING: &'static str = "application/json"; 123 - type Output<'de> = GetProfilesOutput<'de>; 124 - type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 125 - } 126 - 127 - impl<'a> jacquard_common::xrpc::XrpcRequest for GetProfiles<'a> { 128 - const NSID: &'static str = "fm.teal.alpha.actor.getProfiles"; 129 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 130 - type Response = GetProfilesResponse; 131 - } 132 - 133 - /// Endpoint type for 134 - ///fm.teal.alpha.actor.getProfiles 135 - pub struct GetProfilesRequest; 136 - impl jacquard_common::xrpc::XrpcEndpoint for GetProfilesRequest { 137 - const PATH: &'static str = "/xrpc/fm.teal.alpha.actor.getProfiles"; 138 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 139 - type Request<'de> = GetProfiles<'de>; 140 - type Response = GetProfilesResponse; 141 - }
-613
crates/lexicons/src/fm_teal/alpha/actor/profile.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.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 - #[jacquard_derive::lexicon] 9 - #[derive( 10 - serde::Serialize, 11 - serde::Deserialize, 12 - Debug, 13 - Clone, 14 - PartialEq, 15 - Eq, 16 - jacquard_derive::IntoStatic, 17 - Default, 18 - )] 19 - #[serde(rename_all = "camelCase")] 20 - pub struct FeaturedItem<'a> { 21 - /// The Musicbrainz ID of the item 22 - #[serde(borrow)] 23 - pub mbid: jacquard_common::CowStr<'a>, 24 - /// The type of the item. Must be a valid Musicbrainz type, e.g. album, track, recording, etc. 25 - #[serde(borrow)] 26 - pub r#type: jacquard_common::CowStr<'a>, 27 - } 28 - 29 - fn lexicon_doc_fm_teal_alpha_actor_profile() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 30 - ::jacquard_lexicon::lexicon::LexiconDoc { 31 - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 32 - id: ::jacquard_common::CowStr::new_static("fm.teal.alpha.actor.profile"), 33 - revision: None, 34 - description: None, 35 - defs: { 36 - let mut map = ::alloc::collections::BTreeMap::new(); 37 - map.insert( 38 - ::jacquard_common::smol_str::SmolStr::new_static("featuredItem"), 39 - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 40 - description: None, 41 - required: Some( 42 - vec![ 43 - ::jacquard_common::smol_str::SmolStr::new_static("mbid"), 44 - ::jacquard_common::smol_str::SmolStr::new_static("type") 45 - ], 46 - ), 47 - nullable: None, 48 - properties: { 49 - #[allow(unused_mut)] 50 - let mut map = ::alloc::collections::BTreeMap::new(); 51 - map.insert( 52 - ::jacquard_common::smol_str::SmolStr::new_static("mbid"), 53 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 54 - description: Some( 55 - ::jacquard_common::CowStr::new_static( 56 - "The Musicbrainz ID of the item", 57 - ), 58 - ), 59 - format: None, 60 - default: None, 61 - min_length: None, 62 - max_length: None, 63 - min_graphemes: None, 64 - max_graphemes: None, 65 - r#enum: None, 66 - r#const: None, 67 - known_values: None, 68 - }), 69 - ); 70 - map.insert( 71 - ::jacquard_common::smol_str::SmolStr::new_static("type"), 72 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 73 - description: Some( 74 - ::jacquard_common::CowStr::new_static( 75 - "The type of the item. Must be a valid Musicbrainz type, e.g. album, track, recording, etc.", 76 - ), 77 - ), 78 - format: None, 79 - default: None, 80 - min_length: None, 81 - max_length: None, 82 - min_graphemes: None, 83 - max_graphemes: None, 84 - r#enum: None, 85 - r#const: None, 86 - known_values: None, 87 - }), 88 - ); 89 - map 90 - }, 91 - }), 92 - ); 93 - map.insert( 94 - ::jacquard_common::smol_str::SmolStr::new_static("main"), 95 - ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 96 - description: Some( 97 - ::jacquard_common::CowStr::new_static( 98 - "This lexicon is in a not officially released state. It is subject to change. | A declaration of a teal.fm account profile.", 99 - ), 100 - ), 101 - key: Some(::jacquard_common::CowStr::new_static("literal:self")), 102 - record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 103 - description: None, 104 - required: None, 105 - nullable: None, 106 - properties: { 107 - #[allow(unused_mut)] 108 - let mut map = ::alloc::collections::BTreeMap::new(); 109 - map.insert( 110 - ::jacquard_common::smol_str::SmolStr::new_static("avatar"), 111 - ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 112 - description: None, 113 - accept: None, 114 - max_size: None, 115 - }), 116 - ); 117 - map.insert( 118 - ::jacquard_common::smol_str::SmolStr::new_static("banner"), 119 - ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { 120 - description: None, 121 - accept: None, 122 - max_size: None, 123 - }), 124 - ); 125 - map.insert( 126 - ::jacquard_common::smol_str::SmolStr::new_static( 127 - "createdAt", 128 - ), 129 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 130 - description: None, 131 - format: Some( 132 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 133 - ), 134 - default: None, 135 - min_length: None, 136 - max_length: None, 137 - min_graphemes: None, 138 - max_graphemes: None, 139 - r#enum: None, 140 - r#const: None, 141 - known_values: None, 142 - }), 143 - ); 144 - map.insert( 145 - ::jacquard_common::smol_str::SmolStr::new_static( 146 - "description", 147 - ), 148 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 149 - description: Some( 150 - ::jacquard_common::CowStr::new_static( 151 - "Free-form profile description text.", 152 - ), 153 - ), 154 - format: None, 155 - default: None, 156 - min_length: None, 157 - max_length: Some(2560usize), 158 - min_graphemes: None, 159 - max_graphemes: Some(256usize), 160 - r#enum: None, 161 - r#const: None, 162 - known_values: None, 163 - }), 164 - ); 165 - map.insert( 166 - ::jacquard_common::smol_str::SmolStr::new_static( 167 - "descriptionFacets", 168 - ), 169 - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 170 - description: Some( 171 - ::jacquard_common::CowStr::new_static( 172 - "Annotations of text in the profile description (mentions, URLs, hashtags, etc).", 173 - ), 174 - ), 175 - items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 176 - description: None, 177 - r#ref: ::jacquard_common::CowStr::new_static( 178 - "app.bsky.richtext.facet", 179 - ), 180 - }), 181 - min_length: None, 182 - max_length: None, 183 - }), 184 - ); 185 - map.insert( 186 - ::jacquard_common::smol_str::SmolStr::new_static( 187 - "displayName", 188 - ), 189 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 190 - description: None, 191 - format: None, 192 - default: None, 193 - min_length: None, 194 - max_length: Some(640usize), 195 - min_graphemes: None, 196 - max_graphemes: Some(64usize), 197 - r#enum: None, 198 - r#const: None, 199 - known_values: None, 200 - }), 201 - ); 202 - map.insert( 203 - ::jacquard_common::smol_str::SmolStr::new_static( 204 - "featuredItem", 205 - ), 206 - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 207 - description: None, 208 - r#ref: ::jacquard_common::CowStr::new_static( 209 - "#featuredItem", 210 - ), 211 - }), 212 - ); 213 - map 214 - }, 215 - }), 216 - }), 217 - ); 218 - map 219 - }, 220 - } 221 - } 222 - 223 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeaturedItem<'a> { 224 - fn nsid() -> &'static str { 225 - "fm.teal.alpha.actor.profile" 226 - } 227 - fn def_name() -> &'static str { 228 - "featuredItem" 229 - } 230 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 231 - lexicon_doc_fm_teal_alpha_actor_profile() 232 - } 233 - fn validate( 234 - &self, 235 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 236 - Ok(()) 237 - } 238 - } 239 - 240 - /// This lexicon is in a not officially released state. It is subject to change. | A declaration of a teal.fm account profile. 241 - #[jacquard_derive::lexicon] 242 - #[derive( 243 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 244 - )] 245 - #[serde(rename_all = "camelCase")] 246 - pub struct Profile<'a> { 247 - /// Small image to be displayed next to posts from account. AKA, 'profile picture' 248 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 249 - #[serde(borrow)] 250 - pub avatar: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 251 - /// Larger horizontal image to display behind profile view. 252 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 253 - #[serde(borrow)] 254 - pub banner: std::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 255 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 256 - pub created_at: std::option::Option<jacquard_common::types::string::Datetime>, 257 - /// Free-form profile description text. 258 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 259 - #[serde(borrow)] 260 - pub description: std::option::Option<jacquard_common::CowStr<'a>>, 261 - /// Annotations of text in the profile description (mentions, URLs, hashtags, etc). 262 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 263 - #[serde(borrow)] 264 - pub description_facets: std::option::Option<Vec<jacquard_common::types::value::Data<'a>>>, 265 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 266 - #[serde(borrow)] 267 - pub display_name: std::option::Option<jacquard_common::CowStr<'a>>, 268 - /// The user's most recent item featured on their profile. 269 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 270 - #[serde(borrow)] 271 - pub featured_item: std::option::Option<crate::fm_teal::alpha::actor::profile::FeaturedItem<'a>>, 272 - } 273 - 274 - pub mod profile_state { 275 - 276 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 277 - #[allow(unused)] 278 - use ::core::marker::PhantomData; 279 - mod sealed { 280 - pub trait Sealed {} 281 - } 282 - /// State trait tracking which required fields have been set 283 - pub trait State: sealed::Sealed {} 284 - /// Empty state - all required fields are unset 285 - pub struct Empty(()); 286 - impl sealed::Sealed for Empty {} 287 - impl State for Empty {} 288 - /// Marker types for field names 289 - #[allow(non_camel_case_types)] 290 - pub mod members {} 291 - } 292 - 293 - /// Builder for constructing an instance of this type 294 - pub struct ProfileBuilder<'a, S: profile_state::State> { 295 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 296 - __unsafe_private_named: ( 297 - ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 298 - ::core::option::Option<jacquard_common::types::blob::BlobRef<'a>>, 299 - ::core::option::Option<jacquard_common::types::string::Datetime>, 300 - ::core::option::Option<jacquard_common::CowStr<'a>>, 301 - ::core::option::Option<Vec<jacquard_common::types::value::Data<'a>>>, 302 - ::core::option::Option<jacquard_common::CowStr<'a>>, 303 - ::core::option::Option<crate::fm_teal::alpha::actor::profile::FeaturedItem<'a>>, 304 - ), 305 - _phantom: ::core::marker::PhantomData<&'a ()>, 306 - } 307 - 308 - impl<'a> Profile<'a> { 309 - /// Create a new builder for this type 310 - pub fn new() -> ProfileBuilder<'a, profile_state::Empty> { 311 - ProfileBuilder::new() 312 - } 313 - } 314 - 315 - impl<'a> ProfileBuilder<'a, profile_state::Empty> { 316 - /// Create a new builder with all fields unset 317 - pub fn new() -> Self { 318 - ProfileBuilder { 319 - _phantom_state: ::core::marker::PhantomData, 320 - __unsafe_private_named: (None, None, None, None, None, None, None), 321 - _phantom: ::core::marker::PhantomData, 322 - } 323 - } 324 - } 325 - 326 - impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 327 - /// Set the `avatar` field (optional) 328 - pub fn avatar( 329 - mut self, 330 - value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>, 331 - ) -> Self { 332 - self.__unsafe_private_named.0 = value.into(); 333 - self 334 - } 335 - /// Set the `avatar` field to an Option value (optional) 336 - pub fn maybe_avatar( 337 - mut self, 338 - value: Option<jacquard_common::types::blob::BlobRef<'a>>, 339 - ) -> Self { 340 - self.__unsafe_private_named.0 = value; 341 - self 342 - } 343 - } 344 - 345 - impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 346 - /// Set the `banner` field (optional) 347 - pub fn banner( 348 - mut self, 349 - value: impl Into<Option<jacquard_common::types::blob::BlobRef<'a>>>, 350 - ) -> Self { 351 - self.__unsafe_private_named.1 = value.into(); 352 - self 353 - } 354 - /// Set the `banner` field to an Option value (optional) 355 - pub fn maybe_banner( 356 - mut self, 357 - value: Option<jacquard_common::types::blob::BlobRef<'a>>, 358 - ) -> Self { 359 - self.__unsafe_private_named.1 = value; 360 - self 361 - } 362 - } 363 - 364 - impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 365 - /// Set the `createdAt` field (optional) 366 - pub fn created_at( 367 - mut self, 368 - value: impl Into<Option<jacquard_common::types::string::Datetime>>, 369 - ) -> Self { 370 - self.__unsafe_private_named.2 = value.into(); 371 - self 372 - } 373 - /// Set the `createdAt` field to an Option value (optional) 374 - pub fn maybe_created_at( 375 - mut self, 376 - value: Option<jacquard_common::types::string::Datetime>, 377 - ) -> Self { 378 - self.__unsafe_private_named.2 = value; 379 - self 380 - } 381 - } 382 - 383 - impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 384 - /// Set the `description` field (optional) 385 - pub fn description(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 386 - self.__unsafe_private_named.3 = value.into(); 387 - self 388 - } 389 - /// Set the `description` field to an Option value (optional) 390 - pub fn maybe_description(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 391 - self.__unsafe_private_named.3 = value; 392 - self 393 - } 394 - } 395 - 396 - impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 397 - /// Set the `descriptionFacets` field (optional) 398 - pub fn description_facets( 399 - mut self, 400 - value: impl Into<Option<Vec<jacquard_common::types::value::Data<'a>>>>, 401 - ) -> Self { 402 - self.__unsafe_private_named.4 = value.into(); 403 - self 404 - } 405 - /// Set the `descriptionFacets` field to an Option value (optional) 406 - pub fn maybe_description_facets( 407 - mut self, 408 - value: Option<Vec<jacquard_common::types::value::Data<'a>>>, 409 - ) -> Self { 410 - self.__unsafe_private_named.4 = value; 411 - self 412 - } 413 - } 414 - 415 - impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 416 - /// Set the `displayName` field (optional) 417 - pub fn display_name(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 418 - self.__unsafe_private_named.5 = value.into(); 419 - self 420 - } 421 - /// Set the `displayName` field to an Option value (optional) 422 - pub fn maybe_display_name(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 423 - self.__unsafe_private_named.5 = value; 424 - self 425 - } 426 - } 427 - 428 - impl<'a, S: profile_state::State> ProfileBuilder<'a, S> { 429 - /// Set the `featuredItem` field (optional) 430 - pub fn featured_item( 431 - mut self, 432 - value: impl Into<Option<crate::fm_teal::alpha::actor::profile::FeaturedItem<'a>>>, 433 - ) -> Self { 434 - self.__unsafe_private_named.6 = value.into(); 435 - self 436 - } 437 - /// Set the `featuredItem` field to an Option value (optional) 438 - pub fn maybe_featured_item( 439 - mut self, 440 - value: Option<crate::fm_teal::alpha::actor::profile::FeaturedItem<'a>>, 441 - ) -> Self { 442 - self.__unsafe_private_named.6 = value; 443 - self 444 - } 445 - } 446 - 447 - impl<'a, S> ProfileBuilder<'a, S> 448 - where 449 - S: profile_state::State, 450 - { 451 - /// Build the final struct 452 - pub fn build(self) -> Profile<'a> { 453 - Profile { 454 - avatar: self.__unsafe_private_named.0, 455 - banner: self.__unsafe_private_named.1, 456 - created_at: self.__unsafe_private_named.2, 457 - description: self.__unsafe_private_named.3, 458 - description_facets: self.__unsafe_private_named.4, 459 - display_name: self.__unsafe_private_named.5, 460 - featured_item: self.__unsafe_private_named.6, 461 - extra_data: Default::default(), 462 - } 463 - } 464 - /// Build the final struct with custom extra_data 465 - pub fn build_with_data( 466 - self, 467 - extra_data: std::collections::BTreeMap< 468 - jacquard_common::smol_str::SmolStr, 469 - jacquard_common::types::value::Data<'a>, 470 - >, 471 - ) -> Profile<'a> { 472 - Profile { 473 - avatar: self.__unsafe_private_named.0, 474 - banner: self.__unsafe_private_named.1, 475 - created_at: self.__unsafe_private_named.2, 476 - description: self.__unsafe_private_named.3, 477 - description_facets: self.__unsafe_private_named.4, 478 - display_name: self.__unsafe_private_named.5, 479 - featured_item: self.__unsafe_private_named.6, 480 - extra_data: Some(extra_data), 481 - } 482 - } 483 - } 484 - 485 - impl<'a> Profile<'a> { 486 - pub fn uri( 487 - uri: impl Into<jacquard_common::CowStr<'a>>, 488 - ) -> Result< 489 - jacquard_common::types::uri::RecordUri<'a, ProfileRecord>, 490 - jacquard_common::types::uri::UriError, 491 - > { 492 - jacquard_common::types::uri::RecordUri::try_from_uri( 493 - jacquard_common::types::string::AtUri::new_cow(uri.into())?, 494 - ) 495 - } 496 - } 497 - 498 - /// Typed wrapper for GetRecord response with this collection's record type. 499 - #[derive( 500 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 501 - )] 502 - #[serde(rename_all = "camelCase")] 503 - pub struct ProfileGetRecordOutput<'a> { 504 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 505 - #[serde(borrow)] 506 - pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 507 - #[serde(borrow)] 508 - pub uri: jacquard_common::types::string::AtUri<'a>, 509 - #[serde(borrow)] 510 - pub value: Profile<'a>, 511 - } 512 - 513 - impl From<ProfileGetRecordOutput<'_>> for Profile<'_> { 514 - fn from(output: ProfileGetRecordOutput<'_>) -> Self { 515 - use jacquard_common::IntoStatic; 516 - output.value.into_static() 517 - } 518 - } 519 - 520 - impl jacquard_common::types::collection::Collection for Profile<'_> { 521 - const NSID: &'static str = "fm.teal.alpha.actor.profile"; 522 - type Record = ProfileRecord; 523 - } 524 - 525 - /// Marker type for deserializing records from this collection. 526 - #[derive(Debug, serde::Serialize, serde::Deserialize)] 527 - pub struct ProfileRecord; 528 - impl jacquard_common::xrpc::XrpcResp for ProfileRecord { 529 - const NSID: &'static str = "fm.teal.alpha.actor.profile"; 530 - const ENCODING: &'static str = "application/json"; 531 - type Output<'de> = ProfileGetRecordOutput<'de>; 532 - type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 533 - } 534 - 535 - impl jacquard_common::types::collection::Collection for ProfileRecord { 536 - const NSID: &'static str = "fm.teal.alpha.actor.profile"; 537 - type Record = ProfileRecord; 538 - } 539 - 540 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Profile<'a> { 541 - fn nsid() -> &'static str { 542 - "fm.teal.alpha.actor.profile" 543 - } 544 - fn def_name() -> &'static str { 545 - "main" 546 - } 547 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 548 - lexicon_doc_fm_teal_alpha_actor_profile() 549 - } 550 - fn validate( 551 - &self, 552 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 553 - if let Some(ref value) = self.description { 554 - #[allow(unused_comparisons)] 555 - if <str>::len(value.as_ref()) > 2560usize { 556 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 557 - path: ::jacquard_lexicon::validation::ValidationPath::from_field("description"), 558 - max: 2560usize, 559 - actual: <str>::len(value.as_ref()), 560 - }); 561 - } 562 - } 563 - if let Some(ref value) = self.description { 564 - { 565 - let count = 566 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 567 - .count(); 568 - if count > 256usize { 569 - return Err( 570 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 571 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 572 - "description", 573 - ), 574 - max: 256usize, 575 - actual: count, 576 - }, 577 - ); 578 - } 579 - } 580 - } 581 - if let Some(ref value) = self.display_name { 582 - #[allow(unused_comparisons)] 583 - if <str>::len(value.as_ref()) > 640usize { 584 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 585 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 586 - "display_name", 587 - ), 588 - max: 640usize, 589 - actual: <str>::len(value.as_ref()), 590 - }); 591 - } 592 - } 593 - if let Some(ref value) = self.display_name { 594 - { 595 - let count = 596 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 597 - .count(); 598 - if count > 64usize { 599 - return Err( 600 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 601 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 602 - "display_name", 603 - ), 604 - max: 64usize, 605 - actual: count, 606 - }, 607 - ); 608 - } 609 - } 610 - } 611 - Ok(()) 612 - } 613 - }
-458
crates/lexicons/src/fm_teal/alpha/actor/profile_status.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.actor.profileStatus 4 - // 5 - // This file was automatically generated from Lexicon schemas. 6 - // Any manual changes will be overwritten on the next regeneration. 7 - 8 - /// This lexicon is in a not officially released state. It is subject to change. | A declaration of the profile status of the actor. 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 ProfileStatus<'a> { 15 - /// The onboarding completion status 16 - #[serde(borrow)] 17 - pub completed_onboarding: ProfileStatusCompletedOnboarding<'a>, 18 - /// The timestamp when this status was created 19 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 20 - pub created_at: std::option::Option<jacquard_common::types::string::Datetime>, 21 - /// The timestamp when this status was last updated 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_status_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 CompletedOnboarding; 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 CompletedOnboarding = Unset; 43 - } 44 - ///State transition - sets the `completed_onboarding` field to Set 45 - pub struct SetCompletedOnboarding<S: State = Empty>(PhantomData<fn() -> S>); 46 - impl<S: State> sealed::Sealed for SetCompletedOnboarding<S> {} 47 - impl<S: State> State for SetCompletedOnboarding<S> { 48 - type CompletedOnboarding = Set<members::completed_onboarding>; 49 - } 50 - /// Marker types for field names 51 - #[allow(non_camel_case_types)] 52 - pub mod members { 53 - ///Marker type for the `completed_onboarding` field 54 - pub struct completed_onboarding(()); 55 - } 56 - } 57 - 58 - /// Builder for constructing an instance of this type 59 - pub struct ProfileStatusBuilder<'a, S: profile_status_state::State> { 60 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 61 - __unsafe_private_named: ( 62 - ::core::option::Option<ProfileStatusCompletedOnboarding<'a>>, 63 - ::core::option::Option<jacquard_common::types::string::Datetime>, 64 - ::core::option::Option<jacquard_common::types::string::Datetime>, 65 - ), 66 - _phantom: ::core::marker::PhantomData<&'a ()>, 67 - } 68 - 69 - impl<'a> ProfileStatus<'a> { 70 - /// Create a new builder for this type 71 - pub fn new() -> ProfileStatusBuilder<'a, profile_status_state::Empty> { 72 - ProfileStatusBuilder::new() 73 - } 74 - } 75 - 76 - impl<'a> ProfileStatusBuilder<'a, profile_status_state::Empty> { 77 - /// Create a new builder with all fields unset 78 - pub fn new() -> Self { 79 - ProfileStatusBuilder { 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> ProfileStatusBuilder<'a, S> 88 - where 89 - S: profile_status_state::State, 90 - S::CompletedOnboarding: profile_status_state::IsUnset, 91 - { 92 - /// Set the `completedOnboarding` field (required) 93 - pub fn completed_onboarding( 94 - mut self, 95 - value: impl Into<ProfileStatusCompletedOnboarding<'a>>, 96 - ) -> ProfileStatusBuilder<'a, profile_status_state::SetCompletedOnboarding<S>> { 97 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 98 - ProfileStatusBuilder { 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_status_state::State> ProfileStatusBuilder<'a, S> { 107 - /// Set the `createdAt` field (optional) 108 - pub fn created_at( 109 - mut self, 110 - value: impl Into<Option<jacquard_common::types::string::Datetime>>, 111 - ) -> Self { 112 - self.__unsafe_private_named.1 = value.into(); 113 - self 114 - } 115 - /// Set the `createdAt` field to an Option value (optional) 116 - pub fn maybe_created_at( 117 - mut self, 118 - value: Option<jacquard_common::types::string::Datetime>, 119 - ) -> Self { 120 - self.__unsafe_private_named.1 = value; 121 - self 122 - } 123 - } 124 - 125 - impl<'a, S: profile_status_state::State> ProfileStatusBuilder<'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> ProfileStatusBuilder<'a, S> 145 - where 146 - S: profile_status_state::State, 147 - S::CompletedOnboarding: profile_status_state::IsSet, 148 - { 149 - /// Build the final struct 150 - pub fn build(self) -> ProfileStatus<'a> { 151 - ProfileStatus { 152 - completed_onboarding: self.__unsafe_private_named.0.unwrap(), 153 - created_at: 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 - ) -> ProfileStatus<'a> { 166 - ProfileStatus { 167 - completed_onboarding: self.__unsafe_private_named.0.unwrap(), 168 - created_at: 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> ProfileStatus<'a> { 176 - pub fn uri( 177 - uri: impl Into<jacquard_common::CowStr<'a>>, 178 - ) -> Result< 179 - jacquard_common::types::uri::RecordUri<'a, ProfileStatusRecord>, 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 - /// The onboarding completion status 189 - #[derive(Debug, Clone, PartialEq, Eq, Hash)] 190 - pub enum ProfileStatusCompletedOnboarding<'a> { 191 - None, 192 - ProfileOnboarding, 193 - PlayOnboarding, 194 - Complete, 195 - Other(jacquard_common::CowStr<'a>), 196 - } 197 - 198 - impl<'a> ProfileStatusCompletedOnboarding<'a> { 199 - pub fn as_str(&self) -> &str { 200 - match self { 201 - Self::None => "none", 202 - Self::ProfileOnboarding => "profileOnboarding", 203 - Self::PlayOnboarding => "playOnboarding", 204 - Self::Complete => "complete", 205 - Self::Other(s) => s.as_ref(), 206 - } 207 - } 208 - } 209 - 210 - impl<'a> From<&'a str> for ProfileStatusCompletedOnboarding<'a> { 211 - fn from(s: &'a str) -> Self { 212 - match s { 213 - "none" => Self::None, 214 - "profileOnboarding" => Self::ProfileOnboarding, 215 - "playOnboarding" => Self::PlayOnboarding, 216 - "complete" => Self::Complete, 217 - _ => Self::Other(jacquard_common::CowStr::from(s)), 218 - } 219 - } 220 - } 221 - 222 - impl<'a> From<String> for ProfileStatusCompletedOnboarding<'a> { 223 - fn from(s: String) -> Self { 224 - match s.as_str() { 225 - "none" => Self::None, 226 - "profileOnboarding" => Self::ProfileOnboarding, 227 - "playOnboarding" => Self::PlayOnboarding, 228 - "complete" => Self::Complete, 229 - _ => Self::Other(jacquard_common::CowStr::from(s)), 230 - } 231 - } 232 - } 233 - 234 - impl<'a> core::fmt::Display for ProfileStatusCompletedOnboarding<'a> { 235 - fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { 236 - write!(f, "{}", self.as_str()) 237 - } 238 - } 239 - 240 - impl<'a> AsRef<str> for ProfileStatusCompletedOnboarding<'a> { 241 - fn as_ref(&self) -> &str { 242 - self.as_str() 243 - } 244 - } 245 - 246 - impl<'a> serde::Serialize for ProfileStatusCompletedOnboarding<'a> { 247 - fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> 248 - where 249 - S: serde::Serializer, 250 - { 251 - serializer.serialize_str(self.as_str()) 252 - } 253 - } 254 - 255 - impl<'de, 'a> serde::Deserialize<'de> for ProfileStatusCompletedOnboarding<'a> 256 - where 257 - 'de: 'a, 258 - { 259 - fn deserialize<D>(deserializer: D) -> Result<Self, D::Error> 260 - where 261 - D: serde::Deserializer<'de>, 262 - { 263 - let s = <&'de str>::deserialize(deserializer)?; 264 - Ok(Self::from(s)) 265 - } 266 - } 267 - 268 - impl<'a> Default for ProfileStatusCompletedOnboarding<'a> { 269 - fn default() -> Self { 270 - Self::Other(Default::default()) 271 - } 272 - } 273 - 274 - impl jacquard_common::IntoStatic for ProfileStatusCompletedOnboarding<'_> { 275 - type Output = ProfileStatusCompletedOnboarding<'static>; 276 - fn into_static(self) -> Self::Output { 277 - match self { 278 - ProfileStatusCompletedOnboarding::None => ProfileStatusCompletedOnboarding::None, 279 - ProfileStatusCompletedOnboarding::ProfileOnboarding => { 280 - ProfileStatusCompletedOnboarding::ProfileOnboarding 281 - } 282 - ProfileStatusCompletedOnboarding::PlayOnboarding => { 283 - ProfileStatusCompletedOnboarding::PlayOnboarding 284 - } 285 - ProfileStatusCompletedOnboarding::Complete => { 286 - ProfileStatusCompletedOnboarding::Complete 287 - } 288 - ProfileStatusCompletedOnboarding::Other(v) => { 289 - ProfileStatusCompletedOnboarding::Other(v.into_static()) 290 - } 291 - } 292 - } 293 - } 294 - 295 - /// Typed wrapper for GetRecord response with this collection's record type. 296 - #[derive( 297 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 298 - )] 299 - #[serde(rename_all = "camelCase")] 300 - pub struct ProfileStatusGetRecordOutput<'a> { 301 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 302 - #[serde(borrow)] 303 - pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 304 - #[serde(borrow)] 305 - pub uri: jacquard_common::types::string::AtUri<'a>, 306 - #[serde(borrow)] 307 - pub value: ProfileStatus<'a>, 308 - } 309 - 310 - impl From<ProfileStatusGetRecordOutput<'_>> for ProfileStatus<'_> { 311 - fn from(output: ProfileStatusGetRecordOutput<'_>) -> Self { 312 - use jacquard_common::IntoStatic; 313 - output.value.into_static() 314 - } 315 - } 316 - 317 - impl jacquard_common::types::collection::Collection for ProfileStatus<'_> { 318 - const NSID: &'static str = "fm.teal.alpha.actor.profileStatus"; 319 - type Record = ProfileStatusRecord; 320 - } 321 - 322 - /// Marker type for deserializing records from this collection. 323 - #[derive(Debug, serde::Serialize, serde::Deserialize)] 324 - pub struct ProfileStatusRecord; 325 - impl jacquard_common::xrpc::XrpcResp for ProfileStatusRecord { 326 - const NSID: &'static str = "fm.teal.alpha.actor.profileStatus"; 327 - const ENCODING: &'static str = "application/json"; 328 - type Output<'de> = ProfileStatusGetRecordOutput<'de>; 329 - type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 330 - } 331 - 332 - impl jacquard_common::types::collection::Collection for ProfileStatusRecord { 333 - const NSID: &'static str = "fm.teal.alpha.actor.profileStatus"; 334 - type Record = ProfileStatusRecord; 335 - } 336 - 337 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileStatus<'a> { 338 - fn nsid() -> &'static str { 339 - "fm.teal.alpha.actor.profileStatus" 340 - } 341 - fn def_name() -> &'static str { 342 - "main" 343 - } 344 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 345 - lexicon_doc_fm_teal_alpha_actor_profileStatus() 346 - } 347 - fn validate( 348 - &self, 349 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 350 - Ok(()) 351 - } 352 - } 353 - 354 - fn lexicon_doc_fm_teal_alpha_actor_profileStatus() 355 - -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 356 - ::jacquard_lexicon::lexicon::LexiconDoc { 357 - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 358 - id: ::jacquard_common::CowStr::new_static("fm.teal.alpha.actor.profileStatus"), 359 - revision: None, 360 - description: None, 361 - defs: { 362 - let mut map = ::alloc::collections::BTreeMap::new(); 363 - map.insert( 364 - ::jacquard_common::smol_str::SmolStr::new_static("main"), 365 - ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 366 - description: Some( 367 - ::jacquard_common::CowStr::new_static( 368 - "This lexicon is in a not officially released state. It is subject to change. | A declaration of the profile status of the actor.", 369 - ), 370 - ), 371 - key: Some(::jacquard_common::CowStr::new_static("literal:self")), 372 - record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 373 - description: None, 374 - required: Some( 375 - vec![ 376 - ::jacquard_common::smol_str::SmolStr::new_static("completedOnboarding") 377 - ], 378 - ), 379 - nullable: None, 380 - properties: { 381 - #[allow(unused_mut)] 382 - let mut map = ::alloc::collections::BTreeMap::new(); 383 - map.insert( 384 - ::jacquard_common::smol_str::SmolStr::new_static( 385 - "completedOnboarding", 386 - ), 387 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 388 - description: Some( 389 - ::jacquard_common::CowStr::new_static( 390 - "The onboarding completion status", 391 - ), 392 - ), 393 - format: None, 394 - default: None, 395 - min_length: None, 396 - max_length: None, 397 - min_graphemes: None, 398 - max_graphemes: None, 399 - r#enum: None, 400 - r#const: None, 401 - known_values: None, 402 - }), 403 - ); 404 - map.insert( 405 - ::jacquard_common::smol_str::SmolStr::new_static( 406 - "createdAt", 407 - ), 408 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 409 - description: Some( 410 - ::jacquard_common::CowStr::new_static( 411 - "The timestamp when this status was created", 412 - ), 413 - ), 414 - format: Some( 415 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 416 - ), 417 - default: None, 418 - min_length: None, 419 - max_length: None, 420 - min_graphemes: None, 421 - max_graphemes: None, 422 - r#enum: None, 423 - r#const: None, 424 - known_values: None, 425 - }), 426 - ); 427 - map.insert( 428 - ::jacquard_common::smol_str::SmolStr::new_static( 429 - "updatedAt", 430 - ), 431 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 432 - description: Some( 433 - ::jacquard_common::CowStr::new_static( 434 - "The timestamp when this status was last updated", 435 - ), 436 - ), 437 - format: Some( 438 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 439 - ), 440 - default: None, 441 - min_length: None, 442 - max_length: None, 443 - min_graphemes: None, 444 - max_graphemes: None, 445 - r#enum: None, 446 - r#const: None, 447 - known_values: None, 448 - }), 449 - ); 450 - map 451 - }, 452 - }), 453 - }), 454 - ); 455 - map 456 - }, 457 - } 458 - }
-182
crates/lexicons/src/fm_teal/alpha/actor/search_actors.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.actor.searchActors 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 SearchActors<'a> { 13 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 14 - #[serde(borrow)] 15 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 16 - ///(min: 1, max: 25) 17 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 18 - pub limit: std::option::Option<i64>, 19 - #[serde(borrow)] 20 - pub q: jacquard_common::CowStr<'a>, 21 - } 22 - 23 - pub mod search_actors_state { 24 - 25 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 26 - #[allow(unused)] 27 - use ::core::marker::PhantomData; 28 - mod sealed { 29 - pub trait Sealed {} 30 - } 31 - /// State trait tracking which required fields have been set 32 - pub trait State: sealed::Sealed { 33 - type Q; 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 Q = Unset; 40 - } 41 - ///State transition - sets the `q` field to Set 42 - pub struct SetQ<S: State = Empty>(PhantomData<fn() -> S>); 43 - impl<S: State> sealed::Sealed for SetQ<S> {} 44 - impl<S: State> State for SetQ<S> { 45 - type Q = Set<members::q>; 46 - } 47 - /// Marker types for field names 48 - #[allow(non_camel_case_types)] 49 - pub mod members { 50 - ///Marker type for the `q` field 51 - pub struct q(()); 52 - } 53 - } 54 - 55 - /// Builder for constructing an instance of this type 56 - pub struct SearchActorsBuilder<'a, S: search_actors_state::State> { 57 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 58 - __unsafe_private_named: ( 59 - ::core::option::Option<jacquard_common::CowStr<'a>>, 60 - ::core::option::Option<i64>, 61 - ::core::option::Option<jacquard_common::CowStr<'a>>, 62 - ), 63 - _phantom: ::core::marker::PhantomData<&'a ()>, 64 - } 65 - 66 - impl<'a> SearchActors<'a> { 67 - /// Create a new builder for this type 68 - pub fn new() -> SearchActorsBuilder<'a, search_actors_state::Empty> { 69 - SearchActorsBuilder::new() 70 - } 71 - } 72 - 73 - impl<'a> SearchActorsBuilder<'a, search_actors_state::Empty> { 74 - /// Create a new builder with all fields unset 75 - pub fn new() -> Self { 76 - SearchActorsBuilder { 77 - _phantom_state: ::core::marker::PhantomData, 78 - __unsafe_private_named: (None, None, None), 79 - _phantom: ::core::marker::PhantomData, 80 - } 81 - } 82 - } 83 - 84 - impl<'a, S: search_actors_state::State> SearchActorsBuilder<'a, S> { 85 - /// Set the `cursor` field (optional) 86 - pub fn cursor(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 87 - self.__unsafe_private_named.0 = value.into(); 88 - self 89 - } 90 - /// Set the `cursor` field to an Option value (optional) 91 - pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 92 - self.__unsafe_private_named.0 = value; 93 - self 94 - } 95 - } 96 - 97 - impl<'a, S: search_actors_state::State> SearchActorsBuilder<'a, S> { 98 - /// Set the `limit` field (optional) 99 - pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self { 100 - self.__unsafe_private_named.1 = value.into(); 101 - self 102 - } 103 - /// Set the `limit` field to an Option value (optional) 104 - pub fn maybe_limit(mut self, value: Option<i64>) -> Self { 105 - self.__unsafe_private_named.1 = value; 106 - self 107 - } 108 - } 109 - 110 - impl<'a, S> SearchActorsBuilder<'a, S> 111 - where 112 - S: search_actors_state::State, 113 - S::Q: search_actors_state::IsUnset, 114 - { 115 - /// Set the `q` field (required) 116 - pub fn q( 117 - mut self, 118 - value: impl Into<jacquard_common::CowStr<'a>>, 119 - ) -> SearchActorsBuilder<'a, search_actors_state::SetQ<S>> { 120 - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 121 - SearchActorsBuilder { 122 - _phantom_state: ::core::marker::PhantomData, 123 - __unsafe_private_named: self.__unsafe_private_named, 124 - _phantom: ::core::marker::PhantomData, 125 - } 126 - } 127 - } 128 - 129 - impl<'a, S> SearchActorsBuilder<'a, S> 130 - where 131 - S: search_actors_state::State, 132 - S::Q: search_actors_state::IsSet, 133 - { 134 - /// Build the final struct 135 - pub fn build(self) -> SearchActors<'a> { 136 - SearchActors { 137 - cursor: self.__unsafe_private_named.0, 138 - limit: self.__unsafe_private_named.1, 139 - q: self.__unsafe_private_named.2.unwrap(), 140 - } 141 - } 142 - } 143 - 144 - #[jacquard_derive::lexicon] 145 - #[derive( 146 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 147 - )] 148 - #[serde(rename_all = "camelCase")] 149 - pub struct SearchActorsOutput<'a> { 150 - #[serde(borrow)] 151 - pub actors: Vec<crate::fm_teal::alpha::actor::MiniProfileView<'a>>, 152 - /// Cursor for pagination 153 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 154 - #[serde(borrow)] 155 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 156 - } 157 - 158 - /// Response type for 159 - ///fm.teal.alpha.actor.searchActors 160 - pub struct SearchActorsResponse; 161 - impl jacquard_common::xrpc::XrpcResp for SearchActorsResponse { 162 - const NSID: &'static str = "fm.teal.alpha.actor.searchActors"; 163 - const ENCODING: &'static str = "application/json"; 164 - type Output<'de> = SearchActorsOutput<'de>; 165 - type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 166 - } 167 - 168 - impl<'a> jacquard_common::xrpc::XrpcRequest for SearchActors<'a> { 169 - const NSID: &'static str = "fm.teal.alpha.actor.searchActors"; 170 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 171 - type Response = SearchActorsResponse; 172 - } 173 - 174 - /// Endpoint type for 175 - ///fm.teal.alpha.actor.searchActors 176 - pub struct SearchActorsRequest; 177 - impl jacquard_common::xrpc::XrpcEndpoint for SearchActorsRequest { 178 - const PATH: &'static str = "/xrpc/fm.teal.alpha.actor.searchActors"; 179 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 180 - type Request<'de> = SearchActors<'de>; 181 - type Response = SearchActorsResponse; 182 - }
-343
crates/lexicons/src/fm_teal/alpha/actor/status.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.actor.status 4 - // 5 - // This file was automatically generated from Lexicon schemas. 6 - // Any manual changes will be overwritten on the next regeneration. 7 - 8 - /// This lexicon is in a not officially released state. It is subject to change. | A declaration of the status of the actor. Only one can be shown at a time. If there are multiple, the latest record should be picked and earlier records should be deleted or tombstoned. 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 Status<'a> { 15 - /// The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time. 16 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 17 - pub expiry: std::option::Option<jacquard_common::types::string::Datetime>, 18 - #[serde(borrow)] 19 - pub item: crate::fm_teal::alpha::feed::PlayView<'a>, 20 - /// The unix timestamp of when the item was recorded 21 - pub time: jacquard_common::types::string::Datetime, 22 - } 23 - 24 - pub mod status_state { 25 - 26 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 27 - #[allow(unused)] 28 - use ::core::marker::PhantomData; 29 - mod sealed { 30 - pub trait Sealed {} 31 - } 32 - /// State trait tracking which required fields have been set 33 - pub trait State: sealed::Sealed { 34 - type Time; 35 - type Item; 36 - } 37 - /// Empty state - all required fields are unset 38 - pub struct Empty(()); 39 - impl sealed::Sealed for Empty {} 40 - impl State for Empty { 41 - type Time = Unset; 42 - type Item = Unset; 43 - } 44 - ///State transition - sets the `time` field to Set 45 - pub struct SetTime<S: State = Empty>(PhantomData<fn() -> S>); 46 - impl<S: State> sealed::Sealed for SetTime<S> {} 47 - impl<S: State> State for SetTime<S> { 48 - type Time = Set<members::time>; 49 - type Item = S::Item; 50 - } 51 - ///State transition - sets the `item` field to Set 52 - pub struct SetItem<S: State = Empty>(PhantomData<fn() -> S>); 53 - impl<S: State> sealed::Sealed for SetItem<S> {} 54 - impl<S: State> State for SetItem<S> { 55 - type Time = S::Time; 56 - type Item = Set<members::item>; 57 - } 58 - /// Marker types for field names 59 - #[allow(non_camel_case_types)] 60 - pub mod members { 61 - ///Marker type for the `time` field 62 - pub struct time(()); 63 - ///Marker type for the `item` field 64 - pub struct item(()); 65 - } 66 - } 67 - 68 - /// Builder for constructing an instance of this type 69 - pub struct StatusBuilder<'a, S: status_state::State> { 70 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 71 - __unsafe_private_named: ( 72 - ::core::option::Option<jacquard_common::types::string::Datetime>, 73 - ::core::option::Option<crate::fm_teal::alpha::feed::PlayView<'a>>, 74 - ::core::option::Option<jacquard_common::types::string::Datetime>, 75 - ), 76 - _phantom: ::core::marker::PhantomData<&'a ()>, 77 - } 78 - 79 - impl<'a> Status<'a> { 80 - /// Create a new builder for this type 81 - pub fn new() -> StatusBuilder<'a, status_state::Empty> { 82 - StatusBuilder::new() 83 - } 84 - } 85 - 86 - impl<'a> StatusBuilder<'a, status_state::Empty> { 87 - /// Create a new builder with all fields unset 88 - pub fn new() -> Self { 89 - StatusBuilder { 90 - _phantom_state: ::core::marker::PhantomData, 91 - __unsafe_private_named: (None, None, None), 92 - _phantom: ::core::marker::PhantomData, 93 - } 94 - } 95 - } 96 - 97 - impl<'a, S: status_state::State> StatusBuilder<'a, S> { 98 - /// Set the `expiry` field (optional) 99 - pub fn expiry( 100 - mut self, 101 - value: impl Into<Option<jacquard_common::types::string::Datetime>>, 102 - ) -> Self { 103 - self.__unsafe_private_named.0 = value.into(); 104 - self 105 - } 106 - /// Set the `expiry` field to an Option value (optional) 107 - pub fn maybe_expiry(mut self, value: Option<jacquard_common::types::string::Datetime>) -> Self { 108 - self.__unsafe_private_named.0 = value; 109 - self 110 - } 111 - } 112 - 113 - impl<'a, S> StatusBuilder<'a, S> 114 - where 115 - S: status_state::State, 116 - S::Item: status_state::IsUnset, 117 - { 118 - /// Set the `item` field (required) 119 - pub fn item( 120 - mut self, 121 - value: impl Into<crate::fm_teal::alpha::feed::PlayView<'a>>, 122 - ) -> StatusBuilder<'a, status_state::SetItem<S>> { 123 - self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 124 - StatusBuilder { 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> StatusBuilder<'a, S> 133 - where 134 - S: status_state::State, 135 - S::Time: status_state::IsUnset, 136 - { 137 - /// Set the `time` field (required) 138 - pub fn time( 139 - mut self, 140 - value: impl Into<jacquard_common::types::string::Datetime>, 141 - ) -> StatusBuilder<'a, status_state::SetTime<S>> { 142 - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 143 - StatusBuilder { 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> StatusBuilder<'a, S> 152 - where 153 - S: status_state::State, 154 - S::Time: status_state::IsSet, 155 - S::Item: status_state::IsSet, 156 - { 157 - /// Build the final struct 158 - pub fn build(self) -> Status<'a> { 159 - Status { 160 - expiry: self.__unsafe_private_named.0, 161 - item: self.__unsafe_private_named.1.unwrap(), 162 - time: self.__unsafe_private_named.2.unwrap(), 163 - extra_data: Default::default(), 164 - } 165 - } 166 - /// Build the final struct with custom extra_data 167 - pub fn build_with_data( 168 - self, 169 - extra_data: std::collections::BTreeMap< 170 - jacquard_common::smol_str::SmolStr, 171 - jacquard_common::types::value::Data<'a>, 172 - >, 173 - ) -> Status<'a> { 174 - Status { 175 - expiry: self.__unsafe_private_named.0, 176 - item: self.__unsafe_private_named.1.unwrap(), 177 - time: self.__unsafe_private_named.2.unwrap(), 178 - extra_data: Some(extra_data), 179 - } 180 - } 181 - } 182 - 183 - impl<'a> Status<'a> { 184 - pub fn uri( 185 - uri: impl Into<jacquard_common::CowStr<'a>>, 186 - ) -> Result< 187 - jacquard_common::types::uri::RecordUri<'a, StatusRecord>, 188 - jacquard_common::types::uri::UriError, 189 - > { 190 - jacquard_common::types::uri::RecordUri::try_from_uri( 191 - jacquard_common::types::string::AtUri::new_cow(uri.into())?, 192 - ) 193 - } 194 - } 195 - 196 - /// Typed wrapper for GetRecord response with this collection's record type. 197 - #[derive( 198 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 199 - )] 200 - #[serde(rename_all = "camelCase")] 201 - pub struct StatusGetRecordOutput<'a> { 202 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 203 - #[serde(borrow)] 204 - pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 205 - #[serde(borrow)] 206 - pub uri: jacquard_common::types::string::AtUri<'a>, 207 - #[serde(borrow)] 208 - pub value: Status<'a>, 209 - } 210 - 211 - impl From<StatusGetRecordOutput<'_>> for Status<'_> { 212 - fn from(output: StatusGetRecordOutput<'_>) -> Self { 213 - use jacquard_common::IntoStatic; 214 - output.value.into_static() 215 - } 216 - } 217 - 218 - impl jacquard_common::types::collection::Collection for Status<'_> { 219 - const NSID: &'static str = "fm.teal.alpha.actor.status"; 220 - type Record = StatusRecord; 221 - } 222 - 223 - /// Marker type for deserializing records from this collection. 224 - #[derive(Debug, serde::Serialize, serde::Deserialize)] 225 - pub struct StatusRecord; 226 - impl jacquard_common::xrpc::XrpcResp for StatusRecord { 227 - const NSID: &'static str = "fm.teal.alpha.actor.status"; 228 - const ENCODING: &'static str = "application/json"; 229 - type Output<'de> = StatusGetRecordOutput<'de>; 230 - type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 231 - } 232 - 233 - impl jacquard_common::types::collection::Collection for StatusRecord { 234 - const NSID: &'static str = "fm.teal.alpha.actor.status"; 235 - type Record = StatusRecord; 236 - } 237 - 238 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Status<'a> { 239 - fn nsid() -> &'static str { 240 - "fm.teal.alpha.actor.status" 241 - } 242 - fn def_name() -> &'static str { 243 - "main" 244 - } 245 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 246 - lexicon_doc_fm_teal_alpha_actor_status() 247 - } 248 - fn validate( 249 - &self, 250 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 251 - Ok(()) 252 - } 253 - } 254 - 255 - fn lexicon_doc_fm_teal_alpha_actor_status() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 256 - ::jacquard_lexicon::lexicon::LexiconDoc { 257 - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 258 - id: ::jacquard_common::CowStr::new_static("fm.teal.alpha.actor.status"), 259 - revision: None, 260 - description: None, 261 - defs: { 262 - let mut map = ::alloc::collections::BTreeMap::new(); 263 - map.insert( 264 - ::jacquard_common::smol_str::SmolStr::new_static("main"), 265 - ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 266 - description: Some( 267 - ::jacquard_common::CowStr::new_static( 268 - "This lexicon is in a not officially released state. It is subject to change. | A declaration of the status of the actor. Only one can be shown at a time. If there are multiple, the latest record should be picked and earlier records should be deleted or tombstoned.", 269 - ), 270 - ), 271 - key: Some(::jacquard_common::CowStr::new_static("literal:self")), 272 - record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 273 - description: None, 274 - required: Some( 275 - vec![ 276 - ::jacquard_common::smol_str::SmolStr::new_static("time"), 277 - ::jacquard_common::smol_str::SmolStr::new_static("item") 278 - ], 279 - ), 280 - nullable: None, 281 - properties: { 282 - #[allow(unused_mut)] 283 - let mut map = ::alloc::collections::BTreeMap::new(); 284 - map.insert( 285 - ::jacquard_common::smol_str::SmolStr::new_static("expiry"), 286 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 287 - description: Some( 288 - ::jacquard_common::CowStr::new_static( 289 - "The unix timestamp of the expiry time of the item. If unavailable, default to 10 minutes past the start time.", 290 - ), 291 - ), 292 - format: Some( 293 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 294 - ), 295 - default: None, 296 - min_length: None, 297 - max_length: None, 298 - min_graphemes: None, 299 - max_graphemes: None, 300 - r#enum: None, 301 - r#const: None, 302 - known_values: None, 303 - }), 304 - ); 305 - map.insert( 306 - ::jacquard_common::smol_str::SmolStr::new_static("item"), 307 - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { 308 - description: None, 309 - r#ref: ::jacquard_common::CowStr::new_static( 310 - "fm.teal.alpha.feed.defs#playView", 311 - ), 312 - }), 313 - ); 314 - map.insert( 315 - ::jacquard_common::smol_str::SmolStr::new_static("time"), 316 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 317 - description: Some( 318 - ::jacquard_common::CowStr::new_static( 319 - "The unix timestamp of when the item was recorded", 320 - ), 321 - ), 322 - format: Some( 323 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 324 - ), 325 - default: None, 326 - min_length: None, 327 - max_length: None, 328 - min_graphemes: None, 329 - max_graphemes: None, 330 - r#enum: None, 331 - r#const: None, 332 - known_values: None, 333 - }), 334 - ); 335 - map 336 - }, 337 - }), 338 - }), 339 - ); 340 - map 341 - }, 342 - } 343 - }
-906
crates/lexicons/src/fm_teal/alpha/feed.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.feed.defs 4 - // 5 - // This file was automatically generated from Lexicon schemas. 6 - // Any manual changes will be overwritten on the next regeneration. 7 - 8 - pub mod get_actor_feed; 9 - pub mod get_play; 10 - pub mod play; 11 - 12 - #[jacquard_derive::lexicon] 13 - #[derive( 14 - serde::Serialize, 15 - serde::Deserialize, 16 - Debug, 17 - Clone, 18 - PartialEq, 19 - Eq, 20 - jacquard_derive::IntoStatic, 21 - Default, 22 - )] 23 - #[serde(rename_all = "camelCase")] 24 - pub struct Artist<'a> { 25 - /// The Musicbrainz ID of the artist 26 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 27 - #[serde(borrow)] 28 - pub artist_mb_id: std::option::Option<jacquard_common::CowStr<'a>>, 29 - /// The name of the artist 30 - #[serde(borrow)] 31 - pub artist_name: jacquard_common::CowStr<'a>, 32 - } 33 - 34 - fn lexicon_doc_fm_teal_alpha_feed_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 35 - ::jacquard_lexicon::lexicon::LexiconDoc { 36 - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 37 - id: ::jacquard_common::CowStr::new_static("fm.teal.alpha.feed.defs"), 38 - revision: None, 39 - description: None, 40 - defs: { 41 - let mut map = ::alloc::collections::BTreeMap::new(); 42 - map.insert( 43 - ::jacquard_common::smol_str::SmolStr::new_static("artist"), 44 - ::jacquard_lexicon::lexicon::LexUserType::Object( 45 - ::jacquard_lexicon::lexicon::LexObject { 46 - description: None, 47 - required: Some(vec![::jacquard_common::smol_str::SmolStr::new_static( 48 - "artistName", 49 - )]), 50 - nullable: None, 51 - properties: { 52 - #[allow(unused_mut)] 53 - let mut map = ::alloc::collections::BTreeMap::new(); 54 - map.insert( 55 - ::jacquard_common::smol_str::SmolStr::new_static("artistMbId"), 56 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 57 - ::jacquard_lexicon::lexicon::LexString { 58 - description: Some(::jacquard_common::CowStr::new_static( 59 - "The Musicbrainz ID of the artist", 60 - )), 61 - format: None, 62 - default: None, 63 - min_length: None, 64 - max_length: None, 65 - min_graphemes: None, 66 - max_graphemes: None, 67 - r#enum: None, 68 - r#const: None, 69 - known_values: None, 70 - }, 71 - ), 72 - ); 73 - map.insert( 74 - ::jacquard_common::smol_str::SmolStr::new_static("artistName"), 75 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 76 - ::jacquard_lexicon::lexicon::LexString { 77 - description: Some(::jacquard_common::CowStr::new_static( 78 - "The name of the artist", 79 - )), 80 - format: None, 81 - default: None, 82 - min_length: Some(1usize), 83 - max_length: Some(256usize), 84 - min_graphemes: None, 85 - max_graphemes: Some(2560usize), 86 - r#enum: None, 87 - r#const: None, 88 - known_values: None, 89 - }, 90 - ), 91 - ); 92 - map 93 - }, 94 - }, 95 - ), 96 - ); 97 - map.insert( 98 - ::jacquard_common::smol_str::SmolStr::new_static("playView"), 99 - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { 100 - description: None, 101 - required: Some( 102 - vec![ 103 - ::jacquard_common::smol_str::SmolStr::new_static("trackName"), 104 - ::jacquard_common::smol_str::SmolStr::new_static("artists") 105 - ], 106 - ), 107 - nullable: None, 108 - properties: { 109 - #[allow(unused_mut)] 110 - let mut map = ::alloc::collections::BTreeMap::new(); 111 - map.insert( 112 - ::jacquard_common::smol_str::SmolStr::new_static("artists"), 113 - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 114 - description: Some( 115 - ::jacquard_common::CowStr::new_static( 116 - "Array of artists in order of original appearance.", 117 - ), 118 - ), 119 - items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 120 - description: None, 121 - r#ref: ::jacquard_common::CowStr::new_static("#artist"), 122 - }), 123 - min_length: None, 124 - max_length: None, 125 - }), 126 - ); 127 - map.insert( 128 - ::jacquard_common::smol_str::SmolStr::new_static("duration"), 129 - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 130 - description: None, 131 - default: None, 132 - minimum: None, 133 - maximum: None, 134 - r#enum: None, 135 - r#const: None, 136 - }), 137 - ); 138 - map.insert( 139 - ::jacquard_common::smol_str::SmolStr::new_static("isrc"), 140 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 141 - description: Some( 142 - ::jacquard_common::CowStr::new_static( 143 - "The ISRC code associated with the recording", 144 - ), 145 - ), 146 - format: None, 147 - default: None, 148 - min_length: None, 149 - max_length: None, 150 - min_graphemes: None, 151 - max_graphemes: None, 152 - r#enum: None, 153 - r#const: None, 154 - known_values: None, 155 - }), 156 - ); 157 - map.insert( 158 - ::jacquard_common::smol_str::SmolStr::new_static( 159 - "musicServiceBaseDomain", 160 - ), 161 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 162 - description: Some( 163 - ::jacquard_common::CowStr::new_static( 164 - "The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if not provided.", 165 - ), 166 - ), 167 - format: None, 168 - default: None, 169 - min_length: None, 170 - max_length: None, 171 - min_graphemes: None, 172 - max_graphemes: None, 173 - r#enum: None, 174 - r#const: None, 175 - known_values: None, 176 - }), 177 - ); 178 - map.insert( 179 - ::jacquard_common::smol_str::SmolStr::new_static( 180 - "originUrl", 181 - ), 182 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 183 - description: Some( 184 - ::jacquard_common::CowStr::new_static( 185 - "The URL associated with this track", 186 - ), 187 - ), 188 - format: None, 189 - default: None, 190 - min_length: None, 191 - max_length: None, 192 - min_graphemes: None, 193 - max_graphemes: None, 194 - r#enum: None, 195 - r#const: None, 196 - known_values: None, 197 - }), 198 - ); 199 - map.insert( 200 - ::jacquard_common::smol_str::SmolStr::new_static( 201 - "playedTime", 202 - ), 203 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 204 - description: Some( 205 - ::jacquard_common::CowStr::new_static( 206 - "The unix timestamp of when the track was played", 207 - ), 208 - ), 209 - format: Some( 210 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 211 - ), 212 - default: None, 213 - min_length: None, 214 - max_length: None, 215 - min_graphemes: None, 216 - max_graphemes: None, 217 - r#enum: None, 218 - r#const: None, 219 - known_values: None, 220 - }), 221 - ); 222 - map.insert( 223 - ::jacquard_common::smol_str::SmolStr::new_static( 224 - "recordingMbId", 225 - ), 226 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 227 - description: Some( 228 - ::jacquard_common::CowStr::new_static( 229 - "The Musicbrainz recording ID of the track", 230 - ), 231 - ), 232 - format: None, 233 - default: None, 234 - min_length: None, 235 - max_length: None, 236 - min_graphemes: None, 237 - max_graphemes: None, 238 - r#enum: None, 239 - r#const: None, 240 - known_values: None, 241 - }), 242 - ); 243 - map.insert( 244 - ::jacquard_common::smol_str::SmolStr::new_static( 245 - "releaseMbId", 246 - ), 247 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 248 - description: Some( 249 - ::jacquard_common::CowStr::new_static( 250 - "The Musicbrainz release ID", 251 - ), 252 - ), 253 - format: None, 254 - default: None, 255 - min_length: None, 256 - max_length: None, 257 - min_graphemes: None, 258 - max_graphemes: None, 259 - r#enum: None, 260 - r#const: None, 261 - known_values: None, 262 - }), 263 - ); 264 - map.insert( 265 - ::jacquard_common::smol_str::SmolStr::new_static( 266 - "releaseName", 267 - ), 268 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 269 - description: Some( 270 - ::jacquard_common::CowStr::new_static( 271 - "The name of the release/album", 272 - ), 273 - ), 274 - format: None, 275 - default: None, 276 - min_length: None, 277 - max_length: Some(256usize), 278 - min_graphemes: None, 279 - max_graphemes: Some(2560usize), 280 - r#enum: None, 281 - r#const: None, 282 - known_values: None, 283 - }), 284 - ); 285 - map.insert( 286 - ::jacquard_common::smol_str::SmolStr::new_static( 287 - "submissionClientAgent", 288 - ), 289 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 290 - description: Some( 291 - ::jacquard_common::CowStr::new_static( 292 - "A user-agent style string specifying the user agent. e.g. tealtracker/0.0.1b (Linux; Android 13; SM-A715F). Defaults to 'manual/unknown' if not provided.", 293 - ), 294 - ), 295 - format: None, 296 - default: None, 297 - min_length: None, 298 - max_length: Some(256usize), 299 - min_graphemes: None, 300 - max_graphemes: Some(2560usize), 301 - r#enum: None, 302 - r#const: None, 303 - known_values: None, 304 - }), 305 - ); 306 - map.insert( 307 - ::jacquard_common::smol_str::SmolStr::new_static( 308 - "trackMbId", 309 - ), 310 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 311 - description: Some( 312 - ::jacquard_common::CowStr::new_static( 313 - "The Musicbrainz ID of the track", 314 - ), 315 - ), 316 - format: None, 317 - default: None, 318 - min_length: None, 319 - max_length: None, 320 - min_graphemes: None, 321 - max_graphemes: None, 322 - r#enum: None, 323 - r#const: None, 324 - known_values: None, 325 - }), 326 - ); 327 - map.insert( 328 - ::jacquard_common::smol_str::SmolStr::new_static( 329 - "trackName", 330 - ), 331 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 332 - description: Some( 333 - ::jacquard_common::CowStr::new_static( 334 - "The name of the track", 335 - ), 336 - ), 337 - format: None, 338 - default: None, 339 - min_length: Some(1usize), 340 - max_length: Some(256usize), 341 - min_graphemes: None, 342 - max_graphemes: Some(2560usize), 343 - r#enum: None, 344 - r#const: None, 345 - known_values: None, 346 - }), 347 - ); 348 - map 349 - }, 350 - }), 351 - ); 352 - map 353 - }, 354 - } 355 - } 356 - 357 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Artist<'a> { 358 - fn nsid() -> &'static str { 359 - "fm.teal.alpha.feed.defs" 360 - } 361 - fn def_name() -> &'static str { 362 - "artist" 363 - } 364 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 365 - lexicon_doc_fm_teal_alpha_feed_defs() 366 - } 367 - fn validate( 368 - &self, 369 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 370 - { 371 - let value = &self.artist_name; 372 - #[allow(unused_comparisons)] 373 - if <str>::len(value.as_ref()) > 256usize { 374 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 375 - path: ::jacquard_lexicon::validation::ValidationPath::from_field("artist_name"), 376 - max: 256usize, 377 - actual: <str>::len(value.as_ref()), 378 - }); 379 - } 380 - } 381 - { 382 - let value = &self.artist_name; 383 - #[allow(unused_comparisons)] 384 - if <str>::len(value.as_ref()) < 1usize { 385 - return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { 386 - path: ::jacquard_lexicon::validation::ValidationPath::from_field("artist_name"), 387 - min: 1usize, 388 - actual: <str>::len(value.as_ref()), 389 - }); 390 - } 391 - } 392 - { 393 - let value = &self.artist_name; 394 - { 395 - let count = 396 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 397 - .count(); 398 - if count > 2560usize { 399 - return Err( 400 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 401 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 402 - "artist_name", 403 - ), 404 - max: 2560usize, 405 - actual: count, 406 - }, 407 - ); 408 - } 409 - } 410 - } 411 - Ok(()) 412 - } 413 - } 414 - 415 - #[jacquard_derive::lexicon] 416 - #[derive( 417 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 418 - )] 419 - #[serde(rename_all = "camelCase")] 420 - pub struct PlayView<'a> { 421 - /// Array of artists in order of original appearance. 422 - #[serde(borrow)] 423 - pub artists: Vec<crate::fm_teal::alpha::feed::Artist<'a>>, 424 - /// The length of the track in seconds 425 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 426 - pub duration: std::option::Option<i64>, 427 - /// The ISRC code associated with the recording 428 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 429 - #[serde(borrow)] 430 - pub isrc: std::option::Option<jacquard_common::CowStr<'a>>, 431 - /// The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if not provided. 432 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 433 - #[serde(borrow)] 434 - pub music_service_base_domain: std::option::Option<jacquard_common::CowStr<'a>>, 435 - /// The URL associated with this track 436 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 437 - #[serde(borrow)] 438 - pub origin_url: std::option::Option<jacquard_common::CowStr<'a>>, 439 - /// The unix timestamp of when the track was played 440 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 441 - pub played_time: std::option::Option<jacquard_common::types::string::Datetime>, 442 - /// The Musicbrainz recording ID of the track 443 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 444 - #[serde(borrow)] 445 - pub recording_mb_id: std::option::Option<jacquard_common::CowStr<'a>>, 446 - /// The Musicbrainz release ID 447 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 448 - #[serde(borrow)] 449 - pub release_mb_id: std::option::Option<jacquard_common::CowStr<'a>>, 450 - /// The name of the release/album 451 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 452 - #[serde(borrow)] 453 - pub release_name: std::option::Option<jacquard_common::CowStr<'a>>, 454 - /// A user-agent style string specifying the user agent. e.g. tealtracker/0.0.1b (Linux; Android 13; SM-A715F). Defaults to 'manual/unknown' if not provided. 455 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 456 - #[serde(borrow)] 457 - pub submission_client_agent: std::option::Option<jacquard_common::CowStr<'a>>, 458 - /// The Musicbrainz ID of the track 459 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 460 - #[serde(borrow)] 461 - pub track_mb_id: std::option::Option<jacquard_common::CowStr<'a>>, 462 - /// The name of the track 463 - #[serde(borrow)] 464 - pub track_name: jacquard_common::CowStr<'a>, 465 - } 466 - 467 - pub mod play_view_state { 468 - 469 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 470 - #[allow(unused)] 471 - use ::core::marker::PhantomData; 472 - mod sealed { 473 - pub trait Sealed {} 474 - } 475 - /// State trait tracking which required fields have been set 476 - pub trait State: sealed::Sealed { 477 - type TrackName; 478 - type Artists; 479 - } 480 - /// Empty state - all required fields are unset 481 - pub struct Empty(()); 482 - impl sealed::Sealed for Empty {} 483 - impl State for Empty { 484 - type TrackName = Unset; 485 - type Artists = Unset; 486 - } 487 - ///State transition - sets the `track_name` field to Set 488 - pub struct SetTrackName<S: State = Empty>(PhantomData<fn() -> S>); 489 - impl<S: State> sealed::Sealed for SetTrackName<S> {} 490 - impl<S: State> State for SetTrackName<S> { 491 - type TrackName = Set<members::track_name>; 492 - type Artists = S::Artists; 493 - } 494 - ///State transition - sets the `artists` field to Set 495 - pub struct SetArtists<S: State = Empty>(PhantomData<fn() -> S>); 496 - impl<S: State> sealed::Sealed for SetArtists<S> {} 497 - impl<S: State> State for SetArtists<S> { 498 - type TrackName = S::TrackName; 499 - type Artists = Set<members::artists>; 500 - } 501 - /// Marker types for field names 502 - #[allow(non_camel_case_types)] 503 - pub mod members { 504 - ///Marker type for the `track_name` field 505 - pub struct track_name(()); 506 - ///Marker type for the `artists` field 507 - pub struct artists(()); 508 - } 509 - } 510 - 511 - /// Builder for constructing an instance of this type 512 - pub struct PlayViewBuilder<'a, S: play_view_state::State> { 513 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 514 - __unsafe_private_named: ( 515 - ::core::option::Option<Vec<crate::fm_teal::alpha::feed::Artist<'a>>>, 516 - ::core::option::Option<i64>, 517 - ::core::option::Option<jacquard_common::CowStr<'a>>, 518 - ::core::option::Option<jacquard_common::CowStr<'a>>, 519 - ::core::option::Option<jacquard_common::CowStr<'a>>, 520 - ::core::option::Option<jacquard_common::types::string::Datetime>, 521 - ::core::option::Option<jacquard_common::CowStr<'a>>, 522 - ::core::option::Option<jacquard_common::CowStr<'a>>, 523 - ::core::option::Option<jacquard_common::CowStr<'a>>, 524 - ::core::option::Option<jacquard_common::CowStr<'a>>, 525 - ::core::option::Option<jacquard_common::CowStr<'a>>, 526 - ::core::option::Option<jacquard_common::CowStr<'a>>, 527 - ), 528 - _phantom: ::core::marker::PhantomData<&'a ()>, 529 - } 530 - 531 - impl<'a> PlayView<'a> { 532 - /// Create a new builder for this type 533 - pub fn new() -> PlayViewBuilder<'a, play_view_state::Empty> { 534 - PlayViewBuilder::new() 535 - } 536 - } 537 - 538 - impl<'a> PlayViewBuilder<'a, play_view_state::Empty> { 539 - /// Create a new builder with all fields unset 540 - pub fn new() -> Self { 541 - PlayViewBuilder { 542 - _phantom_state: ::core::marker::PhantomData, 543 - __unsafe_private_named: ( 544 - None, None, None, None, None, None, None, None, None, None, None, None, 545 - ), 546 - _phantom: ::core::marker::PhantomData, 547 - } 548 - } 549 - } 550 - 551 - impl<'a, S> PlayViewBuilder<'a, S> 552 - where 553 - S: play_view_state::State, 554 - S::Artists: play_view_state::IsUnset, 555 - { 556 - /// Set the `artists` field (required) 557 - pub fn artists( 558 - mut self, 559 - value: impl Into<Vec<crate::fm_teal::alpha::feed::Artist<'a>>>, 560 - ) -> PlayViewBuilder<'a, play_view_state::SetArtists<S>> { 561 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 562 - PlayViewBuilder { 563 - _phantom_state: ::core::marker::PhantomData, 564 - __unsafe_private_named: self.__unsafe_private_named, 565 - _phantom: ::core::marker::PhantomData, 566 - } 567 - } 568 - } 569 - 570 - impl<'a, S: play_view_state::State> PlayViewBuilder<'a, S> { 571 - /// Set the `duration` field (optional) 572 - pub fn duration(mut self, value: impl Into<Option<i64>>) -> Self { 573 - self.__unsafe_private_named.1 = value.into(); 574 - self 575 - } 576 - /// Set the `duration` field to an Option value (optional) 577 - pub fn maybe_duration(mut self, value: Option<i64>) -> Self { 578 - self.__unsafe_private_named.1 = value; 579 - self 580 - } 581 - } 582 - 583 - impl<'a, S: play_view_state::State> PlayViewBuilder<'a, S> { 584 - /// Set the `isrc` field (optional) 585 - pub fn isrc(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 586 - self.__unsafe_private_named.2 = value.into(); 587 - self 588 - } 589 - /// Set the `isrc` field to an Option value (optional) 590 - pub fn maybe_isrc(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 591 - self.__unsafe_private_named.2 = value; 592 - self 593 - } 594 - } 595 - 596 - impl<'a, S: play_view_state::State> PlayViewBuilder<'a, S> { 597 - /// Set the `musicServiceBaseDomain` field (optional) 598 - pub fn music_service_base_domain( 599 - mut self, 600 - value: impl Into<Option<jacquard_common::CowStr<'a>>>, 601 - ) -> Self { 602 - self.__unsafe_private_named.3 = value.into(); 603 - self 604 - } 605 - /// Set the `musicServiceBaseDomain` field to an Option value (optional) 606 - pub fn maybe_music_service_base_domain( 607 - mut self, 608 - value: Option<jacquard_common::CowStr<'a>>, 609 - ) -> Self { 610 - self.__unsafe_private_named.3 = value; 611 - self 612 - } 613 - } 614 - 615 - impl<'a, S: play_view_state::State> PlayViewBuilder<'a, S> { 616 - /// Set the `originUrl` field (optional) 617 - pub fn origin_url(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 618 - self.__unsafe_private_named.4 = value.into(); 619 - self 620 - } 621 - /// Set the `originUrl` field to an Option value (optional) 622 - pub fn maybe_origin_url(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 623 - self.__unsafe_private_named.4 = value; 624 - self 625 - } 626 - } 627 - 628 - impl<'a, S: play_view_state::State> PlayViewBuilder<'a, S> { 629 - /// Set the `playedTime` field (optional) 630 - pub fn played_time( 631 - mut self, 632 - value: impl Into<Option<jacquard_common::types::string::Datetime>>, 633 - ) -> Self { 634 - self.__unsafe_private_named.5 = value.into(); 635 - self 636 - } 637 - /// Set the `playedTime` field to an Option value (optional) 638 - pub fn maybe_played_time( 639 - mut self, 640 - value: Option<jacquard_common::types::string::Datetime>, 641 - ) -> Self { 642 - self.__unsafe_private_named.5 = value; 643 - self 644 - } 645 - } 646 - 647 - impl<'a, S: play_view_state::State> PlayViewBuilder<'a, S> { 648 - /// Set the `recordingMbId` field (optional) 649 - pub fn recording_mb_id( 650 - mut self, 651 - value: impl Into<Option<jacquard_common::CowStr<'a>>>, 652 - ) -> Self { 653 - self.__unsafe_private_named.6 = value.into(); 654 - self 655 - } 656 - /// Set the `recordingMbId` field to an Option value (optional) 657 - pub fn maybe_recording_mb_id(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 658 - self.__unsafe_private_named.6 = value; 659 - self 660 - } 661 - } 662 - 663 - impl<'a, S: play_view_state::State> PlayViewBuilder<'a, S> { 664 - /// Set the `releaseMbId` field (optional) 665 - pub fn release_mb_id(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 666 - self.__unsafe_private_named.7 = value.into(); 667 - self 668 - } 669 - /// Set the `releaseMbId` field to an Option value (optional) 670 - pub fn maybe_release_mb_id(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 671 - self.__unsafe_private_named.7 = value; 672 - self 673 - } 674 - } 675 - 676 - impl<'a, S: play_view_state::State> PlayViewBuilder<'a, S> { 677 - /// Set the `releaseName` field (optional) 678 - pub fn release_name(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 679 - self.__unsafe_private_named.8 = value.into(); 680 - self 681 - } 682 - /// Set the `releaseName` field to an Option value (optional) 683 - pub fn maybe_release_name(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 684 - self.__unsafe_private_named.8 = value; 685 - self 686 - } 687 - } 688 - 689 - impl<'a, S: play_view_state::State> PlayViewBuilder<'a, S> { 690 - /// Set the `submissionClientAgent` field (optional) 691 - pub fn submission_client_agent( 692 - mut self, 693 - value: impl Into<Option<jacquard_common::CowStr<'a>>>, 694 - ) -> Self { 695 - self.__unsafe_private_named.9 = value.into(); 696 - self 697 - } 698 - /// Set the `submissionClientAgent` field to an Option value (optional) 699 - pub fn maybe_submission_client_agent( 700 - mut self, 701 - value: Option<jacquard_common::CowStr<'a>>, 702 - ) -> Self { 703 - self.__unsafe_private_named.9 = value; 704 - self 705 - } 706 - } 707 - 708 - impl<'a, S: play_view_state::State> PlayViewBuilder<'a, S> { 709 - /// Set the `trackMbId` field (optional) 710 - pub fn track_mb_id(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 711 - self.__unsafe_private_named.10 = value.into(); 712 - self 713 - } 714 - /// Set the `trackMbId` field to an Option value (optional) 715 - pub fn maybe_track_mb_id(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 716 - self.__unsafe_private_named.10 = value; 717 - self 718 - } 719 - } 720 - 721 - impl<'a, S> PlayViewBuilder<'a, S> 722 - where 723 - S: play_view_state::State, 724 - S::TrackName: play_view_state::IsUnset, 725 - { 726 - /// Set the `trackName` field (required) 727 - pub fn track_name( 728 - mut self, 729 - value: impl Into<jacquard_common::CowStr<'a>>, 730 - ) -> PlayViewBuilder<'a, play_view_state::SetTrackName<S>> { 731 - self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); 732 - PlayViewBuilder { 733 - _phantom_state: ::core::marker::PhantomData, 734 - __unsafe_private_named: self.__unsafe_private_named, 735 - _phantom: ::core::marker::PhantomData, 736 - } 737 - } 738 - } 739 - 740 - impl<'a, S> PlayViewBuilder<'a, S> 741 - where 742 - S: play_view_state::State, 743 - S::TrackName: play_view_state::IsSet, 744 - S::Artists: play_view_state::IsSet, 745 - { 746 - /// Build the final struct 747 - pub fn build(self) -> PlayView<'a> { 748 - PlayView { 749 - artists: self.__unsafe_private_named.0.unwrap(), 750 - duration: self.__unsafe_private_named.1, 751 - isrc: self.__unsafe_private_named.2, 752 - music_service_base_domain: self.__unsafe_private_named.3, 753 - origin_url: self.__unsafe_private_named.4, 754 - played_time: self.__unsafe_private_named.5, 755 - recording_mb_id: self.__unsafe_private_named.6, 756 - release_mb_id: self.__unsafe_private_named.7, 757 - release_name: self.__unsafe_private_named.8, 758 - submission_client_agent: self.__unsafe_private_named.9, 759 - track_mb_id: self.__unsafe_private_named.10, 760 - track_name: self.__unsafe_private_named.11.unwrap(), 761 - extra_data: Default::default(), 762 - } 763 - } 764 - /// Build the final struct with custom extra_data 765 - pub fn build_with_data( 766 - self, 767 - extra_data: std::collections::BTreeMap< 768 - jacquard_common::smol_str::SmolStr, 769 - jacquard_common::types::value::Data<'a>, 770 - >, 771 - ) -> PlayView<'a> { 772 - PlayView { 773 - artists: self.__unsafe_private_named.0.unwrap(), 774 - duration: self.__unsafe_private_named.1, 775 - isrc: self.__unsafe_private_named.2, 776 - music_service_base_domain: self.__unsafe_private_named.3, 777 - origin_url: self.__unsafe_private_named.4, 778 - played_time: self.__unsafe_private_named.5, 779 - recording_mb_id: self.__unsafe_private_named.6, 780 - release_mb_id: self.__unsafe_private_named.7, 781 - release_name: self.__unsafe_private_named.8, 782 - submission_client_agent: self.__unsafe_private_named.9, 783 - track_mb_id: self.__unsafe_private_named.10, 784 - track_name: self.__unsafe_private_named.11.unwrap(), 785 - extra_data: Some(extra_data), 786 - } 787 - } 788 - } 789 - 790 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PlayView<'a> { 791 - fn nsid() -> &'static str { 792 - "fm.teal.alpha.feed.defs" 793 - } 794 - fn def_name() -> &'static str { 795 - "playView" 796 - } 797 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 798 - lexicon_doc_fm_teal_alpha_feed_defs() 799 - } 800 - fn validate( 801 - &self, 802 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 803 - if let Some(ref value) = self.release_name { 804 - #[allow(unused_comparisons)] 805 - if <str>::len(value.as_ref()) > 256usize { 806 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 807 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 808 - "release_name", 809 - ), 810 - max: 256usize, 811 - actual: <str>::len(value.as_ref()), 812 - }); 813 - } 814 - } 815 - if let Some(ref value) = self.release_name { 816 - { 817 - let count = 818 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 819 - .count(); 820 - if count > 2560usize { 821 - return Err( 822 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 823 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 824 - "release_name", 825 - ), 826 - max: 2560usize, 827 - actual: count, 828 - }, 829 - ); 830 - } 831 - } 832 - } 833 - if let Some(ref value) = self.submission_client_agent { 834 - #[allow(unused_comparisons)] 835 - if <str>::len(value.as_ref()) > 256usize { 836 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 837 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 838 - "submission_client_agent", 839 - ), 840 - max: 256usize, 841 - actual: <str>::len(value.as_ref()), 842 - }); 843 - } 844 - } 845 - if let Some(ref value) = self.submission_client_agent { 846 - { 847 - let count = 848 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 849 - .count(); 850 - if count > 2560usize { 851 - return Err( 852 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 853 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 854 - "submission_client_agent", 855 - ), 856 - max: 2560usize, 857 - actual: count, 858 - }, 859 - ); 860 - } 861 - } 862 - } 863 - { 864 - let value = &self.track_name; 865 - #[allow(unused_comparisons)] 866 - if <str>::len(value.as_ref()) > 256usize { 867 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 868 - path: ::jacquard_lexicon::validation::ValidationPath::from_field("track_name"), 869 - max: 256usize, 870 - actual: <str>::len(value.as_ref()), 871 - }); 872 - } 873 - } 874 - { 875 - let value = &self.track_name; 876 - #[allow(unused_comparisons)] 877 - if <str>::len(value.as_ref()) < 1usize { 878 - return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { 879 - path: ::jacquard_lexicon::validation::ValidationPath::from_field("track_name"), 880 - min: 1usize, 881 - actual: <str>::len(value.as_ref()), 882 - }); 883 - } 884 - } 885 - { 886 - let value = &self.track_name; 887 - { 888 - let count = 889 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 890 - .count(); 891 - if count > 2560usize { 892 - return Err( 893 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 894 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 895 - "track_name", 896 - ), 897 - max: 2560usize, 898 - actual: count, 899 - }, 900 - ); 901 - } 902 - } 903 - } 904 - Ok(()) 905 - } 906 - }
-177
crates/lexicons/src/fm_teal/alpha/feed/get_actor_feed.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.feed.getActorFeed 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 GetActorFeed<'a> { 13 - #[serde(borrow)] 14 - pub author_did: jacquard_common::types::ident::AtIdentifier<'a>, 15 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 16 - #[serde(borrow)] 17 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 18 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 19 - pub limit: std::option::Option<i64>, 20 - } 21 - 22 - pub mod get_actor_feed_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 AuthorDid; 33 - } 34 - /// Empty state - all required fields are unset 35 - pub struct Empty(()); 36 - impl sealed::Sealed for Empty {} 37 - impl State for Empty { 38 - type AuthorDid = Unset; 39 - } 40 - ///State transition - sets the `author_did` field to Set 41 - pub struct SetAuthorDid<S: State = Empty>(PhantomData<fn() -> S>); 42 - impl<S: State> sealed::Sealed for SetAuthorDid<S> {} 43 - impl<S: State> State for SetAuthorDid<S> { 44 - type AuthorDid = Set<members::author_did>; 45 - } 46 - /// Marker types for field names 47 - #[allow(non_camel_case_types)] 48 - pub mod members { 49 - ///Marker type for the `author_did` field 50 - pub struct author_did(()); 51 - } 52 - } 53 - 54 - /// Builder for constructing an instance of this type 55 - pub struct GetActorFeedBuilder<'a, S: get_actor_feed_state::State> { 56 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 57 - __unsafe_private_named: ( 58 - ::core::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>, 59 - ::core::option::Option<jacquard_common::CowStr<'a>>, 60 - ::core::option::Option<i64>, 61 - ), 62 - _phantom: ::core::marker::PhantomData<&'a ()>, 63 - } 64 - 65 - impl<'a> GetActorFeed<'a> { 66 - /// Create a new builder for this type 67 - pub fn new() -> GetActorFeedBuilder<'a, get_actor_feed_state::Empty> { 68 - GetActorFeedBuilder::new() 69 - } 70 - } 71 - 72 - impl<'a> GetActorFeedBuilder<'a, get_actor_feed_state::Empty> { 73 - /// Create a new builder with all fields unset 74 - pub fn new() -> Self { 75 - GetActorFeedBuilder { 76 - _phantom_state: ::core::marker::PhantomData, 77 - __unsafe_private_named: (None, None, None), 78 - _phantom: ::core::marker::PhantomData, 79 - } 80 - } 81 - } 82 - 83 - impl<'a, S> GetActorFeedBuilder<'a, S> 84 - where 85 - S: get_actor_feed_state::State, 86 - S::AuthorDid: get_actor_feed_state::IsUnset, 87 - { 88 - /// Set the `authorDID` field (required) 89 - pub fn author_did( 90 - mut self, 91 - value: impl Into<jacquard_common::types::ident::AtIdentifier<'a>>, 92 - ) -> GetActorFeedBuilder<'a, get_actor_feed_state::SetAuthorDid<S>> { 93 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 94 - GetActorFeedBuilder { 95 - _phantom_state: ::core::marker::PhantomData, 96 - __unsafe_private_named: self.__unsafe_private_named, 97 - _phantom: ::core::marker::PhantomData, 98 - } 99 - } 100 - } 101 - 102 - impl<'a, S: get_actor_feed_state::State> GetActorFeedBuilder<'a, S> { 103 - /// Set the `cursor` field (optional) 104 - pub fn cursor(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 105 - self.__unsafe_private_named.1 = value.into(); 106 - self 107 - } 108 - /// Set the `cursor` field to an Option value (optional) 109 - pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 110 - self.__unsafe_private_named.1 = value; 111 - self 112 - } 113 - } 114 - 115 - impl<'a, S: get_actor_feed_state::State> GetActorFeedBuilder<'a, S> { 116 - /// Set the `limit` field (optional) 117 - pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self { 118 - self.__unsafe_private_named.2 = value.into(); 119 - self 120 - } 121 - /// Set the `limit` field to an Option value (optional) 122 - pub fn maybe_limit(mut self, value: Option<i64>) -> Self { 123 - self.__unsafe_private_named.2 = value; 124 - self 125 - } 126 - } 127 - 128 - impl<'a, S> GetActorFeedBuilder<'a, S> 129 - where 130 - S: get_actor_feed_state::State, 131 - S::AuthorDid: get_actor_feed_state::IsSet, 132 - { 133 - /// Build the final struct 134 - pub fn build(self) -> GetActorFeed<'a> { 135 - GetActorFeed { 136 - author_did: self.__unsafe_private_named.0.unwrap(), 137 - cursor: self.__unsafe_private_named.1, 138 - limit: self.__unsafe_private_named.2, 139 - } 140 - } 141 - } 142 - 143 - #[jacquard_derive::lexicon] 144 - #[derive( 145 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 146 - )] 147 - #[serde(rename_all = "camelCase")] 148 - pub struct GetActorFeedOutput<'a> { 149 - #[serde(borrow)] 150 - pub plays: Vec<crate::fm_teal::alpha::feed::PlayView<'a>>, 151 - } 152 - 153 - /// Response type for 154 - ///fm.teal.alpha.feed.getActorFeed 155 - pub struct GetActorFeedResponse; 156 - impl jacquard_common::xrpc::XrpcResp for GetActorFeedResponse { 157 - const NSID: &'static str = "fm.teal.alpha.feed.getActorFeed"; 158 - const ENCODING: &'static str = "application/json"; 159 - type Output<'de> = GetActorFeedOutput<'de>; 160 - type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 161 - } 162 - 163 - impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorFeed<'a> { 164 - const NSID: &'static str = "fm.teal.alpha.feed.getActorFeed"; 165 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 166 - type Response = GetActorFeedResponse; 167 - } 168 - 169 - /// Endpoint type for 170 - ///fm.teal.alpha.feed.getActorFeed 171 - pub struct GetActorFeedRequest; 172 - impl jacquard_common::xrpc::XrpcEndpoint for GetActorFeedRequest { 173 - const PATH: &'static str = "/xrpc/fm.teal.alpha.feed.getActorFeed"; 174 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 175 - type Request<'de> = GetActorFeed<'de>; 176 - type Response = GetActorFeedResponse; 177 - }
-178
crates/lexicons/src/fm_teal/alpha/feed/get_play.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.feed.getPlay 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 GetPlay<'a> { 13 - #[serde(borrow)] 14 - pub author_did: jacquard_common::types::ident::AtIdentifier<'a>, 15 - #[serde(borrow)] 16 - pub rkey: jacquard_common::CowStr<'a>, 17 - } 18 - 19 - pub mod get_play_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 Rkey; 30 - type AuthorDid; 31 - } 32 - /// Empty state - all required fields are unset 33 - pub struct Empty(()); 34 - impl sealed::Sealed for Empty {} 35 - impl State for Empty { 36 - type Rkey = Unset; 37 - type AuthorDid = Unset; 38 - } 39 - ///State transition - sets the `rkey` field to Set 40 - pub struct SetRkey<S: State = Empty>(PhantomData<fn() -> S>); 41 - impl<S: State> sealed::Sealed for SetRkey<S> {} 42 - impl<S: State> State for SetRkey<S> { 43 - type Rkey = Set<members::rkey>; 44 - type AuthorDid = S::AuthorDid; 45 - } 46 - ///State transition - sets the `author_did` field to Set 47 - pub struct SetAuthorDid<S: State = Empty>(PhantomData<fn() -> S>); 48 - impl<S: State> sealed::Sealed for SetAuthorDid<S> {} 49 - impl<S: State> State for SetAuthorDid<S> { 50 - type Rkey = S::Rkey; 51 - type AuthorDid = Set<members::author_did>; 52 - } 53 - /// Marker types for field names 54 - #[allow(non_camel_case_types)] 55 - pub mod members { 56 - ///Marker type for the `rkey` field 57 - pub struct rkey(()); 58 - ///Marker type for the `author_did` field 59 - pub struct author_did(()); 60 - } 61 - } 62 - 63 - /// Builder for constructing an instance of this type 64 - pub struct GetPlayBuilder<'a, S: get_play_state::State> { 65 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 66 - __unsafe_private_named: ( 67 - ::core::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>, 68 - ::core::option::Option<jacquard_common::CowStr<'a>>, 69 - ), 70 - _phantom: ::core::marker::PhantomData<&'a ()>, 71 - } 72 - 73 - impl<'a> GetPlay<'a> { 74 - /// Create a new builder for this type 75 - pub fn new() -> GetPlayBuilder<'a, get_play_state::Empty> { 76 - GetPlayBuilder::new() 77 - } 78 - } 79 - 80 - impl<'a> GetPlayBuilder<'a, get_play_state::Empty> { 81 - /// Create a new builder with all fields unset 82 - pub fn new() -> Self { 83 - GetPlayBuilder { 84 - _phantom_state: ::core::marker::PhantomData, 85 - __unsafe_private_named: (None, None), 86 - _phantom: ::core::marker::PhantomData, 87 - } 88 - } 89 - } 90 - 91 - impl<'a, S> GetPlayBuilder<'a, S> 92 - where 93 - S: get_play_state::State, 94 - S::AuthorDid: get_play_state::IsUnset, 95 - { 96 - /// Set the `authorDID` field (required) 97 - pub fn author_did( 98 - mut self, 99 - value: impl Into<jacquard_common::types::ident::AtIdentifier<'a>>, 100 - ) -> GetPlayBuilder<'a, get_play_state::SetAuthorDid<S>> { 101 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 102 - GetPlayBuilder { 103 - _phantom_state: ::core::marker::PhantomData, 104 - __unsafe_private_named: self.__unsafe_private_named, 105 - _phantom: ::core::marker::PhantomData, 106 - } 107 - } 108 - } 109 - 110 - impl<'a, S> GetPlayBuilder<'a, S> 111 - where 112 - S: get_play_state::State, 113 - S::Rkey: get_play_state::IsUnset, 114 - { 115 - /// Set the `rkey` field (required) 116 - pub fn rkey( 117 - mut self, 118 - value: impl Into<jacquard_common::CowStr<'a>>, 119 - ) -> GetPlayBuilder<'a, get_play_state::SetRkey<S>> { 120 - self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 121 - GetPlayBuilder { 122 - _phantom_state: ::core::marker::PhantomData, 123 - __unsafe_private_named: self.__unsafe_private_named, 124 - _phantom: ::core::marker::PhantomData, 125 - } 126 - } 127 - } 128 - 129 - impl<'a, S> GetPlayBuilder<'a, S> 130 - where 131 - S: get_play_state::State, 132 - S::Rkey: get_play_state::IsSet, 133 - S::AuthorDid: get_play_state::IsSet, 134 - { 135 - /// Build the final struct 136 - pub fn build(self) -> GetPlay<'a> { 137 - GetPlay { 138 - author_did: self.__unsafe_private_named.0.unwrap(), 139 - rkey: self.__unsafe_private_named.1.unwrap(), 140 - } 141 - } 142 - } 143 - 144 - #[jacquard_derive::lexicon] 145 - #[derive( 146 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 147 - )] 148 - #[serde(rename_all = "camelCase")] 149 - pub struct GetPlayOutput<'a> { 150 - #[serde(borrow)] 151 - pub play: crate::fm_teal::alpha::feed::PlayView<'a>, 152 - } 153 - 154 - /// Response type for 155 - ///fm.teal.alpha.feed.getPlay 156 - pub struct GetPlayResponse; 157 - impl jacquard_common::xrpc::XrpcResp for GetPlayResponse { 158 - const NSID: &'static str = "fm.teal.alpha.feed.getPlay"; 159 - const ENCODING: &'static str = "application/json"; 160 - type Output<'de> = GetPlayOutput<'de>; 161 - type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 162 - } 163 - 164 - impl<'a> jacquard_common::xrpc::XrpcRequest for GetPlay<'a> { 165 - const NSID: &'static str = "fm.teal.alpha.feed.getPlay"; 166 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 167 - type Response = GetPlayResponse; 168 - } 169 - 170 - /// Endpoint type for 171 - ///fm.teal.alpha.feed.getPlay 172 - pub struct GetPlayRequest; 173 - impl jacquard_common::xrpc::XrpcEndpoint for GetPlayRequest { 174 - const PATH: &'static str = "/xrpc/fm.teal.alpha.feed.getPlay"; 175 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 176 - type Request<'de> = GetPlay<'de>; 177 - type Response = GetPlayResponse; 178 - }
-1067
crates/lexicons/src/fm_teal/alpha/feed/play.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.feed.play 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 Play<'a> { 14 - /// Array of Musicbrainz artist IDs. Prefer using 'artists'. 15 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 16 - #[serde(borrow)] 17 - pub artist_mb_ids: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 18 - /// Array of artist names in order of original appearance. Prefer using 'artists'. 19 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 20 - #[serde(borrow)] 21 - pub artist_names: std::option::Option<Vec<jacquard_common::CowStr<'a>>>, 22 - /// Array of artists in order of original appearance. 23 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 24 - #[serde(borrow)] 25 - pub artists: std::option::Option<Vec<crate::fm_teal::alpha::feed::Artist<'a>>>, 26 - /// The length of the track in seconds 27 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 28 - pub duration: std::option::Option<i64>, 29 - /// The ISRC code associated with the recording 30 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 31 - #[serde(borrow)] 32 - pub isrc: std::option::Option<jacquard_common::CowStr<'a>>, 33 - /// The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if unavailable or not provided. 34 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 35 - #[serde(borrow)] 36 - pub music_service_base_domain: std::option::Option<jacquard_common::CowStr<'a>>, 37 - /// The URL associated with this track 38 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 39 - #[serde(borrow)] 40 - pub origin_url: std::option::Option<jacquard_common::CowStr<'a>>, 41 - /// The unix timestamp of when the track was played 42 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 43 - pub played_time: std::option::Option<jacquard_common::types::string::Datetime>, 44 - /// The Musicbrainz recording ID of the track 45 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 46 - #[serde(borrow)] 47 - pub recording_mb_id: std::option::Option<jacquard_common::CowStr<'a>>, 48 - /// Distinguishing information for release variants (e.g. 'Deluxe Edition', 'Remastered', '2023 Remaster', 'Special Edition'). Used to differentiate between different versions of the same base release while maintaining grouping capabilities. 49 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 50 - #[serde(borrow)] 51 - pub release_discriminant: std::option::Option<jacquard_common::CowStr<'a>>, 52 - /// The Musicbrainz release ID 53 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 54 - #[serde(borrow)] 55 - pub release_mb_id: std::option::Option<jacquard_common::CowStr<'a>>, 56 - /// The name of the release/album 57 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 58 - #[serde(borrow)] 59 - pub release_name: std::option::Option<jacquard_common::CowStr<'a>>, 60 - /// A metadata string specifying the user agent where the format is `<app-identifier>/<version> (<kernel/OS-base>; <platform/OS-version>; <device-model>)`. If string is provided, only `app-identifier` and `version` are required. `app-identifier` is recommended to be in reverse dns format. Defaults to 'manual/unknown' if unavailable or not provided. 61 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 62 - #[serde(borrow)] 63 - pub submission_client_agent: std::option::Option<jacquard_common::CowStr<'a>>, 64 - /// Distinguishing information for track variants (e.g. 'Acoustic Version', 'Live at Wembley', 'Radio Edit', 'Demo'). Used to differentiate between different versions of the same base track while maintaining grouping capabilities. 65 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 66 - #[serde(borrow)] 67 - pub track_discriminant: std::option::Option<jacquard_common::CowStr<'a>>, 68 - /// The Musicbrainz ID of the track 69 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 70 - #[serde(borrow)] 71 - pub track_mb_id: std::option::Option<jacquard_common::CowStr<'a>>, 72 - /// The name of the track 73 - #[serde(borrow)] 74 - pub track_name: jacquard_common::CowStr<'a>, 75 - } 76 - 77 - pub mod play_state { 78 - 79 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 80 - #[allow(unused)] 81 - use ::core::marker::PhantomData; 82 - mod sealed { 83 - pub trait Sealed {} 84 - } 85 - /// State trait tracking which required fields have been set 86 - pub trait State: sealed::Sealed { 87 - type TrackName; 88 - } 89 - /// Empty state - all required fields are unset 90 - pub struct Empty(()); 91 - impl sealed::Sealed for Empty {} 92 - impl State for Empty { 93 - type TrackName = Unset; 94 - } 95 - ///State transition - sets the `track_name` field to Set 96 - pub struct SetTrackName<S: State = Empty>(PhantomData<fn() -> S>); 97 - impl<S: State> sealed::Sealed for SetTrackName<S> {} 98 - impl<S: State> State for SetTrackName<S> { 99 - type TrackName = Set<members::track_name>; 100 - } 101 - /// Marker types for field names 102 - #[allow(non_camel_case_types)] 103 - pub mod members { 104 - ///Marker type for the `track_name` field 105 - pub struct track_name(()); 106 - } 107 - } 108 - 109 - /// Builder for constructing an instance of this type 110 - pub struct PlayBuilder<'a, S: play_state::State> { 111 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 112 - __unsafe_private_named: ( 113 - ::core::option::Option<Vec<jacquard_common::CowStr<'a>>>, 114 - ::core::option::Option<Vec<jacquard_common::CowStr<'a>>>, 115 - ::core::option::Option<Vec<crate::fm_teal::alpha::feed::Artist<'a>>>, 116 - ::core::option::Option<i64>, 117 - ::core::option::Option<jacquard_common::CowStr<'a>>, 118 - ::core::option::Option<jacquard_common::CowStr<'a>>, 119 - ::core::option::Option<jacquard_common::CowStr<'a>>, 120 - ::core::option::Option<jacquard_common::types::string::Datetime>, 121 - ::core::option::Option<jacquard_common::CowStr<'a>>, 122 - ::core::option::Option<jacquard_common::CowStr<'a>>, 123 - ::core::option::Option<jacquard_common::CowStr<'a>>, 124 - ::core::option::Option<jacquard_common::CowStr<'a>>, 125 - ::core::option::Option<jacquard_common::CowStr<'a>>, 126 - ::core::option::Option<jacquard_common::CowStr<'a>>, 127 - ::core::option::Option<jacquard_common::CowStr<'a>>, 128 - ::core::option::Option<jacquard_common::CowStr<'a>>, 129 - ), 130 - _phantom: ::core::marker::PhantomData<&'a ()>, 131 - } 132 - 133 - impl<'a> Play<'a> { 134 - /// Create a new builder for this type 135 - pub fn new() -> PlayBuilder<'a, play_state::Empty> { 136 - PlayBuilder::new() 137 - } 138 - } 139 - 140 - impl<'a> PlayBuilder<'a, play_state::Empty> { 141 - /// Create a new builder with all fields unset 142 - pub fn new() -> Self { 143 - PlayBuilder { 144 - _phantom_state: ::core::marker::PhantomData, 145 - __unsafe_private_named: ( 146 - None, None, None, None, None, None, None, None, None, None, None, None, None, None, 147 - None, None, 148 - ), 149 - _phantom: ::core::marker::PhantomData, 150 - } 151 - } 152 - } 153 - 154 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 155 - /// Set the `artistMbIds` field (optional) 156 - pub fn artist_mb_ids( 157 - mut self, 158 - value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>, 159 - ) -> Self { 160 - self.__unsafe_private_named.0 = value.into(); 161 - self 162 - } 163 - /// Set the `artistMbIds` field to an Option value (optional) 164 - pub fn maybe_artist_mb_ids(mut self, value: Option<Vec<jacquard_common::CowStr<'a>>>) -> Self { 165 - self.__unsafe_private_named.0 = value; 166 - self 167 - } 168 - } 169 - 170 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 171 - /// Set the `artistNames` field (optional) 172 - pub fn artist_names( 173 - mut self, 174 - value: impl Into<Option<Vec<jacquard_common::CowStr<'a>>>>, 175 - ) -> Self { 176 - self.__unsafe_private_named.1 = value.into(); 177 - self 178 - } 179 - /// Set the `artistNames` field to an Option value (optional) 180 - pub fn maybe_artist_names(mut self, value: Option<Vec<jacquard_common::CowStr<'a>>>) -> Self { 181 - self.__unsafe_private_named.1 = value; 182 - self 183 - } 184 - } 185 - 186 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 187 - /// Set the `artists` field (optional) 188 - pub fn artists( 189 - mut self, 190 - value: impl Into<Option<Vec<crate::fm_teal::alpha::feed::Artist<'a>>>>, 191 - ) -> Self { 192 - self.__unsafe_private_named.2 = value.into(); 193 - self 194 - } 195 - /// Set the `artists` field to an Option value (optional) 196 - pub fn maybe_artists( 197 - mut self, 198 - value: Option<Vec<crate::fm_teal::alpha::feed::Artist<'a>>>, 199 - ) -> Self { 200 - self.__unsafe_private_named.2 = value; 201 - self 202 - } 203 - } 204 - 205 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 206 - /// Set the `duration` field (optional) 207 - pub fn duration(mut self, value: impl Into<Option<i64>>) -> Self { 208 - self.__unsafe_private_named.3 = value.into(); 209 - self 210 - } 211 - /// Set the `duration` field to an Option value (optional) 212 - pub fn maybe_duration(mut self, value: Option<i64>) -> Self { 213 - self.__unsafe_private_named.3 = value; 214 - self 215 - } 216 - } 217 - 218 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 219 - /// Set the `isrc` field (optional) 220 - pub fn isrc(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 221 - self.__unsafe_private_named.4 = value.into(); 222 - self 223 - } 224 - /// Set the `isrc` field to an Option value (optional) 225 - pub fn maybe_isrc(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 226 - self.__unsafe_private_named.4 = value; 227 - self 228 - } 229 - } 230 - 231 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 232 - /// Set the `musicServiceBaseDomain` field (optional) 233 - pub fn music_service_base_domain( 234 - mut self, 235 - value: impl Into<Option<jacquard_common::CowStr<'a>>>, 236 - ) -> Self { 237 - self.__unsafe_private_named.5 = value.into(); 238 - self 239 - } 240 - /// Set the `musicServiceBaseDomain` field to an Option value (optional) 241 - pub fn maybe_music_service_base_domain( 242 - mut self, 243 - value: Option<jacquard_common::CowStr<'a>>, 244 - ) -> Self { 245 - self.__unsafe_private_named.5 = value; 246 - self 247 - } 248 - } 249 - 250 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 251 - /// Set the `originUrl` field (optional) 252 - pub fn origin_url(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 253 - self.__unsafe_private_named.6 = value.into(); 254 - self 255 - } 256 - /// Set the `originUrl` field to an Option value (optional) 257 - pub fn maybe_origin_url(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 258 - self.__unsafe_private_named.6 = value; 259 - self 260 - } 261 - } 262 - 263 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 264 - /// Set the `playedTime` field (optional) 265 - pub fn played_time( 266 - mut self, 267 - value: impl Into<Option<jacquard_common::types::string::Datetime>>, 268 - ) -> Self { 269 - self.__unsafe_private_named.7 = value.into(); 270 - self 271 - } 272 - /// Set the `playedTime` field to an Option value (optional) 273 - pub fn maybe_played_time( 274 - mut self, 275 - value: Option<jacquard_common::types::string::Datetime>, 276 - ) -> Self { 277 - self.__unsafe_private_named.7 = value; 278 - self 279 - } 280 - } 281 - 282 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 283 - /// Set the `recordingMbId` field (optional) 284 - pub fn recording_mb_id( 285 - mut self, 286 - value: impl Into<Option<jacquard_common::CowStr<'a>>>, 287 - ) -> Self { 288 - self.__unsafe_private_named.8 = value.into(); 289 - self 290 - } 291 - /// Set the `recordingMbId` field to an Option value (optional) 292 - pub fn maybe_recording_mb_id(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 293 - self.__unsafe_private_named.8 = value; 294 - self 295 - } 296 - } 297 - 298 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 299 - /// Set the `releaseDiscriminant` field (optional) 300 - pub fn release_discriminant( 301 - mut self, 302 - value: impl Into<Option<jacquard_common::CowStr<'a>>>, 303 - ) -> Self { 304 - self.__unsafe_private_named.9 = value.into(); 305 - self 306 - } 307 - /// Set the `releaseDiscriminant` field to an Option value (optional) 308 - pub fn maybe_release_discriminant( 309 - mut self, 310 - value: Option<jacquard_common::CowStr<'a>>, 311 - ) -> Self { 312 - self.__unsafe_private_named.9 = value; 313 - self 314 - } 315 - } 316 - 317 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 318 - /// Set the `releaseMbId` field (optional) 319 - pub fn release_mb_id(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 320 - self.__unsafe_private_named.10 = value.into(); 321 - self 322 - } 323 - /// Set the `releaseMbId` field to an Option value (optional) 324 - pub fn maybe_release_mb_id(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 325 - self.__unsafe_private_named.10 = value; 326 - self 327 - } 328 - } 329 - 330 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 331 - /// Set the `releaseName` field (optional) 332 - pub fn release_name(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 333 - self.__unsafe_private_named.11 = value.into(); 334 - self 335 - } 336 - /// Set the `releaseName` field to an Option value (optional) 337 - pub fn maybe_release_name(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 338 - self.__unsafe_private_named.11 = value; 339 - self 340 - } 341 - } 342 - 343 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 344 - /// Set the `submissionClientAgent` field (optional) 345 - pub fn submission_client_agent( 346 - mut self, 347 - value: impl Into<Option<jacquard_common::CowStr<'a>>>, 348 - ) -> Self { 349 - self.__unsafe_private_named.12 = value.into(); 350 - self 351 - } 352 - /// Set the `submissionClientAgent` field to an Option value (optional) 353 - pub fn maybe_submission_client_agent( 354 - mut self, 355 - value: Option<jacquard_common::CowStr<'a>>, 356 - ) -> Self { 357 - self.__unsafe_private_named.12 = value; 358 - self 359 - } 360 - } 361 - 362 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 363 - /// Set the `trackDiscriminant` field (optional) 364 - pub fn track_discriminant( 365 - mut self, 366 - value: impl Into<Option<jacquard_common::CowStr<'a>>>, 367 - ) -> Self { 368 - self.__unsafe_private_named.13 = value.into(); 369 - self 370 - } 371 - /// Set the `trackDiscriminant` field to an Option value (optional) 372 - pub fn maybe_track_discriminant(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 373 - self.__unsafe_private_named.13 = value; 374 - self 375 - } 376 - } 377 - 378 - impl<'a, S: play_state::State> PlayBuilder<'a, S> { 379 - /// Set the `trackMbId` field (optional) 380 - pub fn track_mb_id(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 381 - self.__unsafe_private_named.14 = value.into(); 382 - self 383 - } 384 - /// Set the `trackMbId` field to an Option value (optional) 385 - pub fn maybe_track_mb_id(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 386 - self.__unsafe_private_named.14 = value; 387 - self 388 - } 389 - } 390 - 391 - impl<'a, S> PlayBuilder<'a, S> 392 - where 393 - S: play_state::State, 394 - S::TrackName: play_state::IsUnset, 395 - { 396 - /// Set the `trackName` field (required) 397 - pub fn track_name( 398 - mut self, 399 - value: impl Into<jacquard_common::CowStr<'a>>, 400 - ) -> PlayBuilder<'a, play_state::SetTrackName<S>> { 401 - self.__unsafe_private_named.15 = ::core::option::Option::Some(value.into()); 402 - PlayBuilder { 403 - _phantom_state: ::core::marker::PhantomData, 404 - __unsafe_private_named: self.__unsafe_private_named, 405 - _phantom: ::core::marker::PhantomData, 406 - } 407 - } 408 - } 409 - 410 - impl<'a, S> PlayBuilder<'a, S> 411 - where 412 - S: play_state::State, 413 - S::TrackName: play_state::IsSet, 414 - { 415 - /// Build the final struct 416 - pub fn build(self) -> Play<'a> { 417 - Play { 418 - artist_mb_ids: self.__unsafe_private_named.0, 419 - artist_names: self.__unsafe_private_named.1, 420 - artists: self.__unsafe_private_named.2, 421 - duration: self.__unsafe_private_named.3, 422 - isrc: self.__unsafe_private_named.4, 423 - music_service_base_domain: self.__unsafe_private_named.5, 424 - origin_url: self.__unsafe_private_named.6, 425 - played_time: self.__unsafe_private_named.7, 426 - recording_mb_id: self.__unsafe_private_named.8, 427 - release_discriminant: self.__unsafe_private_named.9, 428 - release_mb_id: self.__unsafe_private_named.10, 429 - release_name: self.__unsafe_private_named.11, 430 - submission_client_agent: self.__unsafe_private_named.12, 431 - track_discriminant: self.__unsafe_private_named.13, 432 - track_mb_id: self.__unsafe_private_named.14, 433 - track_name: self.__unsafe_private_named.15.unwrap(), 434 - extra_data: Default::default(), 435 - } 436 - } 437 - /// Build the final struct with custom extra_data 438 - pub fn build_with_data( 439 - self, 440 - extra_data: std::collections::BTreeMap< 441 - jacquard_common::smol_str::SmolStr, 442 - jacquard_common::types::value::Data<'a>, 443 - >, 444 - ) -> Play<'a> { 445 - Play { 446 - artist_mb_ids: self.__unsafe_private_named.0, 447 - artist_names: self.__unsafe_private_named.1, 448 - artists: self.__unsafe_private_named.2, 449 - duration: self.__unsafe_private_named.3, 450 - isrc: self.__unsafe_private_named.4, 451 - music_service_base_domain: self.__unsafe_private_named.5, 452 - origin_url: self.__unsafe_private_named.6, 453 - played_time: self.__unsafe_private_named.7, 454 - recording_mb_id: self.__unsafe_private_named.8, 455 - release_discriminant: self.__unsafe_private_named.9, 456 - release_mb_id: self.__unsafe_private_named.10, 457 - release_name: self.__unsafe_private_named.11, 458 - submission_client_agent: self.__unsafe_private_named.12, 459 - track_discriminant: self.__unsafe_private_named.13, 460 - track_mb_id: self.__unsafe_private_named.14, 461 - track_name: self.__unsafe_private_named.15.unwrap(), 462 - extra_data: Some(extra_data), 463 - } 464 - } 465 - } 466 - 467 - impl<'a> Play<'a> { 468 - pub fn uri( 469 - uri: impl Into<jacquard_common::CowStr<'a>>, 470 - ) -> Result< 471 - jacquard_common::types::uri::RecordUri<'a, PlayRecord>, 472 - jacquard_common::types::uri::UriError, 473 - > { 474 - jacquard_common::types::uri::RecordUri::try_from_uri( 475 - jacquard_common::types::string::AtUri::new_cow(uri.into())?, 476 - ) 477 - } 478 - } 479 - 480 - /// Typed wrapper for GetRecord response with this collection's record type. 481 - #[derive( 482 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 483 - )] 484 - #[serde(rename_all = "camelCase")] 485 - pub struct PlayGetRecordOutput<'a> { 486 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 487 - #[serde(borrow)] 488 - pub cid: std::option::Option<jacquard_common::types::string::Cid<'a>>, 489 - #[serde(borrow)] 490 - pub uri: jacquard_common::types::string::AtUri<'a>, 491 - #[serde(borrow)] 492 - pub value: Play<'a>, 493 - } 494 - 495 - impl From<PlayGetRecordOutput<'_>> for Play<'_> { 496 - fn from(output: PlayGetRecordOutput<'_>) -> Self { 497 - use jacquard_common::IntoStatic; 498 - output.value.into_static() 499 - } 500 - } 501 - 502 - impl jacquard_common::types::collection::Collection for Play<'_> { 503 - const NSID: &'static str = "fm.teal.alpha.feed.play"; 504 - type Record = PlayRecord; 505 - } 506 - 507 - /// Marker type for deserializing records from this collection. 508 - #[derive(Debug, serde::Serialize, serde::Deserialize)] 509 - pub struct PlayRecord; 510 - impl jacquard_common::xrpc::XrpcResp for PlayRecord { 511 - const NSID: &'static str = "fm.teal.alpha.feed.play"; 512 - const ENCODING: &'static str = "application/json"; 513 - type Output<'de> = PlayGetRecordOutput<'de>; 514 - type Err<'de> = jacquard_common::types::collection::RecordError<'de>; 515 - } 516 - 517 - impl jacquard_common::types::collection::Collection for PlayRecord { 518 - const NSID: &'static str = "fm.teal.alpha.feed.play"; 519 - type Record = PlayRecord; 520 - } 521 - 522 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Play<'a> { 523 - fn nsid() -> &'static str { 524 - "fm.teal.alpha.feed.play" 525 - } 526 - fn def_name() -> &'static str { 527 - "main" 528 - } 529 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 530 - lexicon_doc_fm_teal_alpha_feed_play() 531 - } 532 - fn validate( 533 - &self, 534 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 535 - if let Some(ref value) = self.release_discriminant { 536 - #[allow(unused_comparisons)] 537 - if <str>::len(value.as_ref()) > 128usize { 538 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 539 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 540 - "release_discriminant", 541 - ), 542 - max: 128usize, 543 - actual: <str>::len(value.as_ref()), 544 - }); 545 - } 546 - } 547 - if let Some(ref value) = self.release_discriminant { 548 - { 549 - let count = 550 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 551 - .count(); 552 - if count > 1280usize { 553 - return Err( 554 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 555 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 556 - "release_discriminant", 557 - ), 558 - max: 1280usize, 559 - actual: count, 560 - }, 561 - ); 562 - } 563 - } 564 - } 565 - if let Some(ref value) = self.release_name { 566 - #[allow(unused_comparisons)] 567 - if <str>::len(value.as_ref()) > 256usize { 568 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 569 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 570 - "release_name", 571 - ), 572 - max: 256usize, 573 - actual: <str>::len(value.as_ref()), 574 - }); 575 - } 576 - } 577 - if let Some(ref value) = self.release_name { 578 - { 579 - let count = 580 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 581 - .count(); 582 - if count > 2560usize { 583 - return Err( 584 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 585 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 586 - "release_name", 587 - ), 588 - max: 2560usize, 589 - actual: count, 590 - }, 591 - ); 592 - } 593 - } 594 - } 595 - if let Some(ref value) = self.submission_client_agent { 596 - #[allow(unused_comparisons)] 597 - if <str>::len(value.as_ref()) > 256usize { 598 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 599 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 600 - "submission_client_agent", 601 - ), 602 - max: 256usize, 603 - actual: <str>::len(value.as_ref()), 604 - }); 605 - } 606 - } 607 - if let Some(ref value) = self.submission_client_agent { 608 - { 609 - let count = 610 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 611 - .count(); 612 - if count > 2560usize { 613 - return Err( 614 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 615 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 616 - "submission_client_agent", 617 - ), 618 - max: 2560usize, 619 - actual: count, 620 - }, 621 - ); 622 - } 623 - } 624 - } 625 - if let Some(ref value) = self.track_discriminant { 626 - #[allow(unused_comparisons)] 627 - if <str>::len(value.as_ref()) > 128usize { 628 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 629 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 630 - "track_discriminant", 631 - ), 632 - max: 128usize, 633 - actual: <str>::len(value.as_ref()), 634 - }); 635 - } 636 - } 637 - if let Some(ref value) = self.track_discriminant { 638 - { 639 - let count = 640 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 641 - .count(); 642 - if count > 1280usize { 643 - return Err( 644 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 645 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 646 - "track_discriminant", 647 - ), 648 - max: 1280usize, 649 - actual: count, 650 - }, 651 - ); 652 - } 653 - } 654 - } 655 - { 656 - let value = &self.track_name; 657 - #[allow(unused_comparisons)] 658 - if <str>::len(value.as_ref()) > 256usize { 659 - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { 660 - path: ::jacquard_lexicon::validation::ValidationPath::from_field("track_name"), 661 - max: 256usize, 662 - actual: <str>::len(value.as_ref()), 663 - }); 664 - } 665 - } 666 - { 667 - let value = &self.track_name; 668 - #[allow(unused_comparisons)] 669 - if <str>::len(value.as_ref()) < 1usize { 670 - return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { 671 - path: ::jacquard_lexicon::validation::ValidationPath::from_field("track_name"), 672 - min: 1usize, 673 - actual: <str>::len(value.as_ref()), 674 - }); 675 - } 676 - } 677 - { 678 - let value = &self.track_name; 679 - { 680 - let count = 681 - ::unicode_segmentation::UnicodeSegmentation::graphemes(value.as_ref(), true) 682 - .count(); 683 - if count > 2560usize { 684 - return Err( 685 - ::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { 686 - path: ::jacquard_lexicon::validation::ValidationPath::from_field( 687 - "track_name", 688 - ), 689 - max: 2560usize, 690 - actual: count, 691 - }, 692 - ); 693 - } 694 - } 695 - } 696 - Ok(()) 697 - } 698 - } 699 - 700 - fn lexicon_doc_fm_teal_alpha_feed_play() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 701 - ::jacquard_lexicon::lexicon::LexiconDoc { 702 - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 703 - id: ::jacquard_common::CowStr::new_static("fm.teal.alpha.feed.play"), 704 - revision: None, 705 - description: None, 706 - defs: { 707 - let mut map = ::alloc::collections::BTreeMap::new(); 708 - map.insert( 709 - ::jacquard_common::smol_str::SmolStr::new_static("main"), 710 - ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { 711 - description: None, 712 - key: Some(::jacquard_common::CowStr::new_static("tid")), 713 - record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { 714 - description: None, 715 - required: Some( 716 - vec![ 717 - ::jacquard_common::smol_str::SmolStr::new_static("trackName") 718 - ], 719 - ), 720 - nullable: None, 721 - properties: { 722 - #[allow(unused_mut)] 723 - let mut map = ::alloc::collections::BTreeMap::new(); 724 - map.insert( 725 - ::jacquard_common::smol_str::SmolStr::new_static( 726 - "artistMbIds", 727 - ), 728 - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 729 - description: Some( 730 - ::jacquard_common::CowStr::new_static( 731 - "Array of Musicbrainz artist IDs. Prefer using 'artists'.", 732 - ), 733 - ), 734 - items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 735 - description: None, 736 - format: None, 737 - default: None, 738 - min_length: None, 739 - max_length: None, 740 - min_graphemes: None, 741 - max_graphemes: None, 742 - r#enum: None, 743 - r#const: None, 744 - known_values: None, 745 - }), 746 - min_length: None, 747 - max_length: None, 748 - }), 749 - ); 750 - map.insert( 751 - ::jacquard_common::smol_str::SmolStr::new_static( 752 - "artistNames", 753 - ), 754 - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 755 - description: Some( 756 - ::jacquard_common::CowStr::new_static( 757 - "Array of artist names in order of original appearance. Prefer using 'artists'.", 758 - ), 759 - ), 760 - items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { 761 - description: None, 762 - format: None, 763 - default: None, 764 - min_length: Some(1usize), 765 - max_length: Some(256usize), 766 - min_graphemes: None, 767 - max_graphemes: Some(2560usize), 768 - r#enum: None, 769 - r#const: None, 770 - known_values: None, 771 - }), 772 - min_length: None, 773 - max_length: None, 774 - }), 775 - ); 776 - map.insert( 777 - ::jacquard_common::smol_str::SmolStr::new_static("artists"), 778 - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { 779 - description: Some( 780 - ::jacquard_common::CowStr::new_static( 781 - "Array of artists in order of original appearance.", 782 - ), 783 - ), 784 - items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { 785 - description: None, 786 - r#ref: ::jacquard_common::CowStr::new_static( 787 - "fm.teal.alpha.feed.defs#artist", 788 - ), 789 - }), 790 - min_length: None, 791 - max_length: None, 792 - }), 793 - ); 794 - map.insert( 795 - ::jacquard_common::smol_str::SmolStr::new_static( 796 - "duration", 797 - ), 798 - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { 799 - description: None, 800 - default: None, 801 - minimum: None, 802 - maximum: None, 803 - r#enum: None, 804 - r#const: None, 805 - }), 806 - ); 807 - map.insert( 808 - ::jacquard_common::smol_str::SmolStr::new_static("isrc"), 809 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 810 - description: Some( 811 - ::jacquard_common::CowStr::new_static( 812 - "The ISRC code associated with the recording", 813 - ), 814 - ), 815 - format: None, 816 - default: None, 817 - min_length: None, 818 - max_length: None, 819 - min_graphemes: None, 820 - max_graphemes: None, 821 - r#enum: None, 822 - r#const: None, 823 - known_values: None, 824 - }), 825 - ); 826 - map.insert( 827 - ::jacquard_common::smol_str::SmolStr::new_static( 828 - "musicServiceBaseDomain", 829 - ), 830 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 831 - description: Some( 832 - ::jacquard_common::CowStr::new_static( 833 - "The base domain of the music service. e.g. music.apple.com, tidal.com, spotify.com. Defaults to 'local' if unavailable or not provided.", 834 - ), 835 - ), 836 - format: None, 837 - default: None, 838 - min_length: None, 839 - max_length: None, 840 - min_graphemes: None, 841 - max_graphemes: None, 842 - r#enum: None, 843 - r#const: None, 844 - known_values: None, 845 - }), 846 - ); 847 - map.insert( 848 - ::jacquard_common::smol_str::SmolStr::new_static( 849 - "originUrl", 850 - ), 851 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 852 - description: Some( 853 - ::jacquard_common::CowStr::new_static( 854 - "The URL associated with this track", 855 - ), 856 - ), 857 - format: None, 858 - default: None, 859 - min_length: None, 860 - max_length: None, 861 - min_graphemes: None, 862 - max_graphemes: None, 863 - r#enum: None, 864 - r#const: None, 865 - known_values: None, 866 - }), 867 - ); 868 - map.insert( 869 - ::jacquard_common::smol_str::SmolStr::new_static( 870 - "playedTime", 871 - ), 872 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 873 - description: Some( 874 - ::jacquard_common::CowStr::new_static( 875 - "The unix timestamp of when the track was played", 876 - ), 877 - ), 878 - format: Some( 879 - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, 880 - ), 881 - default: None, 882 - min_length: None, 883 - max_length: None, 884 - min_graphemes: None, 885 - max_graphemes: None, 886 - r#enum: None, 887 - r#const: None, 888 - known_values: None, 889 - }), 890 - ); 891 - map.insert( 892 - ::jacquard_common::smol_str::SmolStr::new_static( 893 - "recordingMbId", 894 - ), 895 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 896 - description: Some( 897 - ::jacquard_common::CowStr::new_static( 898 - "The Musicbrainz recording ID of the track", 899 - ), 900 - ), 901 - format: None, 902 - default: None, 903 - min_length: None, 904 - max_length: None, 905 - min_graphemes: None, 906 - max_graphemes: None, 907 - r#enum: None, 908 - r#const: None, 909 - known_values: None, 910 - }), 911 - ); 912 - map.insert( 913 - ::jacquard_common::smol_str::SmolStr::new_static( 914 - "releaseDiscriminant", 915 - ), 916 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 917 - description: Some( 918 - ::jacquard_common::CowStr::new_static( 919 - "Distinguishing information for release variants (e.g. 'Deluxe Edition', 'Remastered', '2023 Remaster', 'Special Edition'). Used to differentiate between different versions of the same base release while maintaining grouping capabilities.", 920 - ), 921 - ), 922 - format: None, 923 - default: None, 924 - min_length: None, 925 - max_length: Some(128usize), 926 - min_graphemes: None, 927 - max_graphemes: Some(1280usize), 928 - r#enum: None, 929 - r#const: None, 930 - known_values: None, 931 - }), 932 - ); 933 - map.insert( 934 - ::jacquard_common::smol_str::SmolStr::new_static( 935 - "releaseMbId", 936 - ), 937 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 938 - description: Some( 939 - ::jacquard_common::CowStr::new_static( 940 - "The Musicbrainz release ID", 941 - ), 942 - ), 943 - format: None, 944 - default: None, 945 - min_length: None, 946 - max_length: None, 947 - min_graphemes: None, 948 - max_graphemes: None, 949 - r#enum: None, 950 - r#const: None, 951 - known_values: None, 952 - }), 953 - ); 954 - map.insert( 955 - ::jacquard_common::smol_str::SmolStr::new_static( 956 - "releaseName", 957 - ), 958 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 959 - description: Some( 960 - ::jacquard_common::CowStr::new_static( 961 - "The name of the release/album", 962 - ), 963 - ), 964 - format: None, 965 - default: None, 966 - min_length: None, 967 - max_length: Some(256usize), 968 - min_graphemes: None, 969 - max_graphemes: Some(2560usize), 970 - r#enum: None, 971 - r#const: None, 972 - known_values: None, 973 - }), 974 - ); 975 - map.insert( 976 - ::jacquard_common::smol_str::SmolStr::new_static( 977 - "submissionClientAgent", 978 - ), 979 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 980 - description: Some( 981 - ::jacquard_common::CowStr::new_static( 982 - "A metadata string specifying the user agent where the format is `<app-identifier>/<version> (<kernel/OS-base>; <platform/OS-version>; <device-model>)`. If string is provided, only `app-identifier` and `version` are required. `app-identifier` is recommended to be in reverse dns format. Defaults to 'manual/unknown' if unavailable or not provided.", 983 - ), 984 - ), 985 - format: None, 986 - default: None, 987 - min_length: None, 988 - max_length: Some(256usize), 989 - min_graphemes: None, 990 - max_graphemes: Some(2560usize), 991 - r#enum: None, 992 - r#const: None, 993 - known_values: None, 994 - }), 995 - ); 996 - map.insert( 997 - ::jacquard_common::smol_str::SmolStr::new_static( 998 - "trackDiscriminant", 999 - ), 1000 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1001 - description: Some( 1002 - ::jacquard_common::CowStr::new_static( 1003 - "Distinguishing information for track variants (e.g. 'Acoustic Version', 'Live at Wembley', 'Radio Edit', 'Demo'). Used to differentiate between different versions of the same base track while maintaining grouping capabilities.", 1004 - ), 1005 - ), 1006 - format: None, 1007 - default: None, 1008 - min_length: None, 1009 - max_length: Some(128usize), 1010 - min_graphemes: None, 1011 - max_graphemes: Some(1280usize), 1012 - r#enum: None, 1013 - r#const: None, 1014 - known_values: None, 1015 - }), 1016 - ); 1017 - map.insert( 1018 - ::jacquard_common::smol_str::SmolStr::new_static( 1019 - "trackMbId", 1020 - ), 1021 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1022 - description: Some( 1023 - ::jacquard_common::CowStr::new_static( 1024 - "The Musicbrainz ID of the track", 1025 - ), 1026 - ), 1027 - format: None, 1028 - default: None, 1029 - min_length: None, 1030 - max_length: None, 1031 - min_graphemes: None, 1032 - max_graphemes: None, 1033 - r#enum: None, 1034 - r#const: None, 1035 - known_values: None, 1036 - }), 1037 - ); 1038 - map.insert( 1039 - ::jacquard_common::smol_str::SmolStr::new_static( 1040 - "trackName", 1041 - ), 1042 - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { 1043 - description: Some( 1044 - ::jacquard_common::CowStr::new_static( 1045 - "The name of the track", 1046 - ), 1047 - ), 1048 - format: None, 1049 - default: None, 1050 - min_length: Some(1usize), 1051 - max_length: Some(256usize), 1052 - min_graphemes: None, 1053 - max_graphemes: Some(2560usize), 1054 - r#enum: None, 1055 - r#const: None, 1056 - known_values: None, 1057 - }), 1058 - ); 1059 - map 1060 - }, 1061 - }), 1062 - }), 1063 - ); 1064 - map 1065 - }, 1066 - } 1067 - }
-865
crates/lexicons/src/fm_teal/alpha/stats.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.stats.defs 4 - // 5 - // This file was automatically generated from Lexicon schemas. 6 - // Any manual changes will be overwritten on the next regeneration. 7 - 8 - pub mod get_latest; 9 - pub mod get_top_artists; 10 - pub mod get_top_releases; 11 - pub mod get_user_top_artists; 12 - pub mod get_user_top_releases; 13 - 14 - #[jacquard_derive::lexicon] 15 - #[derive( 16 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 17 - )] 18 - #[serde(rename_all = "camelCase")] 19 - pub struct ArtistView<'a> { 20 - /// MusicBrainz artist ID 21 - #[serde(borrow)] 22 - pub mbid: jacquard_common::CowStr<'a>, 23 - /// Artist name 24 - #[serde(borrow)] 25 - pub name: jacquard_common::CowStr<'a>, 26 - /// Total number of plays for this artist 27 - pub play_count: i64, 28 - } 29 - 30 - pub mod artist_view_state { 31 - 32 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 33 - #[allow(unused)] 34 - use ::core::marker::PhantomData; 35 - mod sealed { 36 - pub trait Sealed {} 37 - } 38 - /// State trait tracking which required fields have been set 39 - pub trait State: sealed::Sealed { 40 - type Name; 41 - type PlayCount; 42 - type Mbid; 43 - } 44 - /// Empty state - all required fields are unset 45 - pub struct Empty(()); 46 - impl sealed::Sealed for Empty {} 47 - impl State for Empty { 48 - type Name = Unset; 49 - type PlayCount = Unset; 50 - type Mbid = Unset; 51 - } 52 - ///State transition - sets the `name` field to Set 53 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 54 - impl<S: State> sealed::Sealed for SetName<S> {} 55 - impl<S: State> State for SetName<S> { 56 - type Name = Set<members::name>; 57 - type PlayCount = S::PlayCount; 58 - type Mbid = S::Mbid; 59 - } 60 - ///State transition - sets the `play_count` field to Set 61 - pub struct SetPlayCount<S: State = Empty>(PhantomData<fn() -> S>); 62 - impl<S: State> sealed::Sealed for SetPlayCount<S> {} 63 - impl<S: State> State for SetPlayCount<S> { 64 - type Name = S::Name; 65 - type PlayCount = Set<members::play_count>; 66 - type Mbid = S::Mbid; 67 - } 68 - ///State transition - sets the `mbid` field to Set 69 - pub struct SetMbid<S: State = Empty>(PhantomData<fn() -> S>); 70 - impl<S: State> sealed::Sealed for SetMbid<S> {} 71 - impl<S: State> State for SetMbid<S> { 72 - type Name = S::Name; 73 - type PlayCount = S::PlayCount; 74 - type Mbid = Set<members::mbid>; 75 - } 76 - /// Marker types for field names 77 - #[allow(non_camel_case_types)] 78 - pub mod members { 79 - ///Marker type for the `name` field 80 - pub struct name(()); 81 - ///Marker type for the `play_count` field 82 - pub struct play_count(()); 83 - ///Marker type for the `mbid` field 84 - pub struct mbid(()); 85 - } 86 - } 87 - 88 - /// Builder for constructing an instance of this type 89 - pub struct ArtistViewBuilder<'a, S: artist_view_state::State> { 90 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 91 - __unsafe_private_named: ( 92 - ::core::option::Option<jacquard_common::CowStr<'a>>, 93 - ::core::option::Option<jacquard_common::CowStr<'a>>, 94 - ::core::option::Option<i64>, 95 - ), 96 - _phantom: ::core::marker::PhantomData<&'a ()>, 97 - } 98 - 99 - impl<'a> ArtistView<'a> { 100 - /// Create a new builder for this type 101 - pub fn new() -> ArtistViewBuilder<'a, artist_view_state::Empty> { 102 - ArtistViewBuilder::new() 103 - } 104 - } 105 - 106 - impl<'a> ArtistViewBuilder<'a, artist_view_state::Empty> { 107 - /// Create a new builder with all fields unset 108 - pub fn new() -> Self { 109 - ArtistViewBuilder { 110 - _phantom_state: ::core::marker::PhantomData, 111 - __unsafe_private_named: (None, None, None), 112 - _phantom: ::core::marker::PhantomData, 113 - } 114 - } 115 - } 116 - 117 - impl<'a, S> ArtistViewBuilder<'a, S> 118 - where 119 - S: artist_view_state::State, 120 - S::Mbid: artist_view_state::IsUnset, 121 - { 122 - /// Set the `mbid` field (required) 123 - pub fn mbid( 124 - mut self, 125 - value: impl Into<jacquard_common::CowStr<'a>>, 126 - ) -> ArtistViewBuilder<'a, artist_view_state::SetMbid<S>> { 127 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 128 - ArtistViewBuilder { 129 - _phantom_state: ::core::marker::PhantomData, 130 - __unsafe_private_named: self.__unsafe_private_named, 131 - _phantom: ::core::marker::PhantomData, 132 - } 133 - } 134 - } 135 - 136 - impl<'a, S> ArtistViewBuilder<'a, S> 137 - where 138 - S: artist_view_state::State, 139 - S::Name: artist_view_state::IsUnset, 140 - { 141 - /// Set the `name` field (required) 142 - pub fn name( 143 - mut self, 144 - value: impl Into<jacquard_common::CowStr<'a>>, 145 - ) -> ArtistViewBuilder<'a, artist_view_state::SetName<S>> { 146 - self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 147 - ArtistViewBuilder { 148 - _phantom_state: ::core::marker::PhantomData, 149 - __unsafe_private_named: self.__unsafe_private_named, 150 - _phantom: ::core::marker::PhantomData, 151 - } 152 - } 153 - } 154 - 155 - impl<'a, S> ArtistViewBuilder<'a, S> 156 - where 157 - S: artist_view_state::State, 158 - S::PlayCount: artist_view_state::IsUnset, 159 - { 160 - /// Set the `playCount` field (required) 161 - pub fn play_count( 162 - mut self, 163 - value: impl Into<i64>, 164 - ) -> ArtistViewBuilder<'a, artist_view_state::SetPlayCount<S>> { 165 - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 166 - ArtistViewBuilder { 167 - _phantom_state: ::core::marker::PhantomData, 168 - __unsafe_private_named: self.__unsafe_private_named, 169 - _phantom: ::core::marker::PhantomData, 170 - } 171 - } 172 - } 173 - 174 - impl<'a, S> ArtistViewBuilder<'a, S> 175 - where 176 - S: artist_view_state::State, 177 - S::Name: artist_view_state::IsSet, 178 - S::PlayCount: artist_view_state::IsSet, 179 - S::Mbid: artist_view_state::IsSet, 180 - { 181 - /// Build the final struct 182 - pub fn build(self) -> ArtistView<'a> { 183 - ArtistView { 184 - mbid: self.__unsafe_private_named.0.unwrap(), 185 - name: self.__unsafe_private_named.1.unwrap(), 186 - play_count: self.__unsafe_private_named.2.unwrap(), 187 - extra_data: Default::default(), 188 - } 189 - } 190 - /// Build the final struct with custom extra_data 191 - pub fn build_with_data( 192 - self, 193 - extra_data: std::collections::BTreeMap< 194 - jacquard_common::smol_str::SmolStr, 195 - jacquard_common::types::value::Data<'a>, 196 - >, 197 - ) -> ArtistView<'a> { 198 - ArtistView { 199 - mbid: self.__unsafe_private_named.0.unwrap(), 200 - name: self.__unsafe_private_named.1.unwrap(), 201 - play_count: self.__unsafe_private_named.2.unwrap(), 202 - extra_data: Some(extra_data), 203 - } 204 - } 205 - } 206 - 207 - fn lexicon_doc_fm_teal_alpha_stats_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 208 - ::jacquard_lexicon::lexicon::LexiconDoc { 209 - lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, 210 - id: ::jacquard_common::CowStr::new_static("fm.teal.alpha.stats.defs"), 211 - revision: None, 212 - description: None, 213 - defs: { 214 - let mut map = ::alloc::collections::BTreeMap::new(); 215 - map.insert( 216 - ::jacquard_common::smol_str::SmolStr::new_static("artistView"), 217 - ::jacquard_lexicon::lexicon::LexUserType::Object( 218 - ::jacquard_lexicon::lexicon::LexObject { 219 - description: None, 220 - required: Some(vec![ 221 - ::jacquard_common::smol_str::SmolStr::new_static("mbid"), 222 - ::jacquard_common::smol_str::SmolStr::new_static("name"), 223 - ::jacquard_common::smol_str::SmolStr::new_static("playCount"), 224 - ]), 225 - nullable: None, 226 - properties: { 227 - #[allow(unused_mut)] 228 - let mut map = ::alloc::collections::BTreeMap::new(); 229 - map.insert( 230 - ::jacquard_common::smol_str::SmolStr::new_static("mbid"), 231 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 232 - ::jacquard_lexicon::lexicon::LexString { 233 - description: Some(::jacquard_common::CowStr::new_static( 234 - "MusicBrainz artist ID", 235 - )), 236 - format: None, 237 - default: None, 238 - min_length: None, 239 - max_length: None, 240 - min_graphemes: None, 241 - max_graphemes: None, 242 - r#enum: None, 243 - r#const: None, 244 - known_values: None, 245 - }, 246 - ), 247 - ); 248 - map.insert( 249 - ::jacquard_common::smol_str::SmolStr::new_static("name"), 250 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 251 - ::jacquard_lexicon::lexicon::LexString { 252 - description: Some(::jacquard_common::CowStr::new_static( 253 - "Artist name", 254 - )), 255 - format: None, 256 - default: None, 257 - min_length: None, 258 - max_length: None, 259 - min_graphemes: None, 260 - max_graphemes: None, 261 - r#enum: None, 262 - r#const: None, 263 - known_values: None, 264 - }, 265 - ), 266 - ); 267 - map.insert( 268 - ::jacquard_common::smol_str::SmolStr::new_static("playCount"), 269 - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( 270 - ::jacquard_lexicon::lexicon::LexInteger { 271 - description: None, 272 - default: None, 273 - minimum: None, 274 - maximum: None, 275 - r#enum: None, 276 - r#const: None, 277 - }, 278 - ), 279 - ); 280 - map 281 - }, 282 - }, 283 - ), 284 - ); 285 - map.insert( 286 - ::jacquard_common::smol_str::SmolStr::new_static("recordingView"), 287 - ::jacquard_lexicon::lexicon::LexUserType::Object( 288 - ::jacquard_lexicon::lexicon::LexObject { 289 - description: None, 290 - required: Some(vec![ 291 - ::jacquard_common::smol_str::SmolStr::new_static("mbid"), 292 - ::jacquard_common::smol_str::SmolStr::new_static("name"), 293 - ::jacquard_common::smol_str::SmolStr::new_static("playCount"), 294 - ]), 295 - nullable: None, 296 - properties: { 297 - #[allow(unused_mut)] 298 - let mut map = ::alloc::collections::BTreeMap::new(); 299 - map.insert( 300 - ::jacquard_common::smol_str::SmolStr::new_static("mbid"), 301 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 302 - ::jacquard_lexicon::lexicon::LexString { 303 - description: Some(::jacquard_common::CowStr::new_static( 304 - "MusicBrainz recording ID", 305 - )), 306 - format: None, 307 - default: None, 308 - min_length: None, 309 - max_length: None, 310 - min_graphemes: None, 311 - max_graphemes: None, 312 - r#enum: None, 313 - r#const: None, 314 - known_values: None, 315 - }, 316 - ), 317 - ); 318 - map.insert( 319 - ::jacquard_common::smol_str::SmolStr::new_static("name"), 320 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 321 - ::jacquard_lexicon::lexicon::LexString { 322 - description: Some(::jacquard_common::CowStr::new_static( 323 - "Recording/track name", 324 - )), 325 - format: None, 326 - default: None, 327 - min_length: None, 328 - max_length: None, 329 - min_graphemes: None, 330 - max_graphemes: None, 331 - r#enum: None, 332 - r#const: None, 333 - known_values: None, 334 - }, 335 - ), 336 - ); 337 - map.insert( 338 - ::jacquard_common::smol_str::SmolStr::new_static("playCount"), 339 - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( 340 - ::jacquard_lexicon::lexicon::LexInteger { 341 - description: None, 342 - default: None, 343 - minimum: None, 344 - maximum: None, 345 - r#enum: None, 346 - r#const: None, 347 - }, 348 - ), 349 - ); 350 - map 351 - }, 352 - }, 353 - ), 354 - ); 355 - map.insert( 356 - ::jacquard_common::smol_str::SmolStr::new_static("releaseView"), 357 - ::jacquard_lexicon::lexicon::LexUserType::Object( 358 - ::jacquard_lexicon::lexicon::LexObject { 359 - description: None, 360 - required: Some(vec![ 361 - ::jacquard_common::smol_str::SmolStr::new_static("mbid"), 362 - ::jacquard_common::smol_str::SmolStr::new_static("name"), 363 - ::jacquard_common::smol_str::SmolStr::new_static("playCount"), 364 - ]), 365 - nullable: None, 366 - properties: { 367 - #[allow(unused_mut)] 368 - let mut map = ::alloc::collections::BTreeMap::new(); 369 - map.insert( 370 - ::jacquard_common::smol_str::SmolStr::new_static("mbid"), 371 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 372 - ::jacquard_lexicon::lexicon::LexString { 373 - description: Some(::jacquard_common::CowStr::new_static( 374 - "MusicBrainz release ID", 375 - )), 376 - format: None, 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 - ); 388 - map.insert( 389 - ::jacquard_common::smol_str::SmolStr::new_static("name"), 390 - ::jacquard_lexicon::lexicon::LexObjectProperty::String( 391 - ::jacquard_lexicon::lexicon::LexString { 392 - description: Some(::jacquard_common::CowStr::new_static( 393 - "Release/album name", 394 - )), 395 - format: None, 396 - default: None, 397 - min_length: None, 398 - max_length: None, 399 - min_graphemes: None, 400 - max_graphemes: None, 401 - r#enum: None, 402 - r#const: None, 403 - known_values: None, 404 - }, 405 - ), 406 - ); 407 - map.insert( 408 - ::jacquard_common::smol_str::SmolStr::new_static("playCount"), 409 - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( 410 - ::jacquard_lexicon::lexicon::LexInteger { 411 - description: None, 412 - default: None, 413 - minimum: None, 414 - maximum: None, 415 - r#enum: None, 416 - r#const: None, 417 - }, 418 - ), 419 - ); 420 - map 421 - }, 422 - }, 423 - ), 424 - ); 425 - map 426 - }, 427 - } 428 - } 429 - 430 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ArtistView<'a> { 431 - fn nsid() -> &'static str { 432 - "fm.teal.alpha.stats.defs" 433 - } 434 - fn def_name() -> &'static str { 435 - "artistView" 436 - } 437 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 438 - lexicon_doc_fm_teal_alpha_stats_defs() 439 - } 440 - fn validate( 441 - &self, 442 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 443 - Ok(()) 444 - } 445 - } 446 - 447 - #[jacquard_derive::lexicon] 448 - #[derive( 449 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 450 - )] 451 - #[serde(rename_all = "camelCase")] 452 - pub struct RecordingView<'a> { 453 - /// MusicBrainz recording ID 454 - #[serde(borrow)] 455 - pub mbid: jacquard_common::CowStr<'a>, 456 - /// Recording/track name 457 - #[serde(borrow)] 458 - pub name: jacquard_common::CowStr<'a>, 459 - /// Total number of plays for this recording 460 - pub play_count: i64, 461 - } 462 - 463 - pub mod recording_view_state { 464 - 465 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 466 - #[allow(unused)] 467 - use ::core::marker::PhantomData; 468 - mod sealed { 469 - pub trait Sealed {} 470 - } 471 - /// State trait tracking which required fields have been set 472 - pub trait State: sealed::Sealed { 473 - type PlayCount; 474 - type Name; 475 - type Mbid; 476 - } 477 - /// Empty state - all required fields are unset 478 - pub struct Empty(()); 479 - impl sealed::Sealed for Empty {} 480 - impl State for Empty { 481 - type PlayCount = Unset; 482 - type Name = Unset; 483 - type Mbid = Unset; 484 - } 485 - ///State transition - sets the `play_count` field to Set 486 - pub struct SetPlayCount<S: State = Empty>(PhantomData<fn() -> S>); 487 - impl<S: State> sealed::Sealed for SetPlayCount<S> {} 488 - impl<S: State> State for SetPlayCount<S> { 489 - type PlayCount = Set<members::play_count>; 490 - type Name = S::Name; 491 - type Mbid = S::Mbid; 492 - } 493 - ///State transition - sets the `name` field to Set 494 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 495 - impl<S: State> sealed::Sealed for SetName<S> {} 496 - impl<S: State> State for SetName<S> { 497 - type PlayCount = S::PlayCount; 498 - type Name = Set<members::name>; 499 - type Mbid = S::Mbid; 500 - } 501 - ///State transition - sets the `mbid` field to Set 502 - pub struct SetMbid<S: State = Empty>(PhantomData<fn() -> S>); 503 - impl<S: State> sealed::Sealed for SetMbid<S> {} 504 - impl<S: State> State for SetMbid<S> { 505 - type PlayCount = S::PlayCount; 506 - type Name = S::Name; 507 - type Mbid = Set<members::mbid>; 508 - } 509 - /// Marker types for field names 510 - #[allow(non_camel_case_types)] 511 - pub mod members { 512 - ///Marker type for the `play_count` field 513 - pub struct play_count(()); 514 - ///Marker type for the `name` field 515 - pub struct name(()); 516 - ///Marker type for the `mbid` field 517 - pub struct mbid(()); 518 - } 519 - } 520 - 521 - /// Builder for constructing an instance of this type 522 - pub struct RecordingViewBuilder<'a, S: recording_view_state::State> { 523 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 524 - __unsafe_private_named: ( 525 - ::core::option::Option<jacquard_common::CowStr<'a>>, 526 - ::core::option::Option<jacquard_common::CowStr<'a>>, 527 - ::core::option::Option<i64>, 528 - ), 529 - _phantom: ::core::marker::PhantomData<&'a ()>, 530 - } 531 - 532 - impl<'a> RecordingView<'a> { 533 - /// Create a new builder for this type 534 - pub fn new() -> RecordingViewBuilder<'a, recording_view_state::Empty> { 535 - RecordingViewBuilder::new() 536 - } 537 - } 538 - 539 - impl<'a> RecordingViewBuilder<'a, recording_view_state::Empty> { 540 - /// Create a new builder with all fields unset 541 - pub fn new() -> Self { 542 - RecordingViewBuilder { 543 - _phantom_state: ::core::marker::PhantomData, 544 - __unsafe_private_named: (None, None, None), 545 - _phantom: ::core::marker::PhantomData, 546 - } 547 - } 548 - } 549 - 550 - impl<'a, S> RecordingViewBuilder<'a, S> 551 - where 552 - S: recording_view_state::State, 553 - S::Mbid: recording_view_state::IsUnset, 554 - { 555 - /// Set the `mbid` field (required) 556 - pub fn mbid( 557 - mut self, 558 - value: impl Into<jacquard_common::CowStr<'a>>, 559 - ) -> RecordingViewBuilder<'a, recording_view_state::SetMbid<S>> { 560 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 561 - RecordingViewBuilder { 562 - _phantom_state: ::core::marker::PhantomData, 563 - __unsafe_private_named: self.__unsafe_private_named, 564 - _phantom: ::core::marker::PhantomData, 565 - } 566 - } 567 - } 568 - 569 - impl<'a, S> RecordingViewBuilder<'a, S> 570 - where 571 - S: recording_view_state::State, 572 - S::Name: recording_view_state::IsUnset, 573 - { 574 - /// Set the `name` field (required) 575 - pub fn name( 576 - mut self, 577 - value: impl Into<jacquard_common::CowStr<'a>>, 578 - ) -> RecordingViewBuilder<'a, recording_view_state::SetName<S>> { 579 - self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 580 - RecordingViewBuilder { 581 - _phantom_state: ::core::marker::PhantomData, 582 - __unsafe_private_named: self.__unsafe_private_named, 583 - _phantom: ::core::marker::PhantomData, 584 - } 585 - } 586 - } 587 - 588 - impl<'a, S> RecordingViewBuilder<'a, S> 589 - where 590 - S: recording_view_state::State, 591 - S::PlayCount: recording_view_state::IsUnset, 592 - { 593 - /// Set the `playCount` field (required) 594 - pub fn play_count( 595 - mut self, 596 - value: impl Into<i64>, 597 - ) -> RecordingViewBuilder<'a, recording_view_state::SetPlayCount<S>> { 598 - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 599 - RecordingViewBuilder { 600 - _phantom_state: ::core::marker::PhantomData, 601 - __unsafe_private_named: self.__unsafe_private_named, 602 - _phantom: ::core::marker::PhantomData, 603 - } 604 - } 605 - } 606 - 607 - impl<'a, S> RecordingViewBuilder<'a, S> 608 - where 609 - S: recording_view_state::State, 610 - S::PlayCount: recording_view_state::IsSet, 611 - S::Name: recording_view_state::IsSet, 612 - S::Mbid: recording_view_state::IsSet, 613 - { 614 - /// Build the final struct 615 - pub fn build(self) -> RecordingView<'a> { 616 - RecordingView { 617 - mbid: self.__unsafe_private_named.0.unwrap(), 618 - name: self.__unsafe_private_named.1.unwrap(), 619 - play_count: self.__unsafe_private_named.2.unwrap(), 620 - extra_data: Default::default(), 621 - } 622 - } 623 - /// Build the final struct with custom extra_data 624 - pub fn build_with_data( 625 - self, 626 - extra_data: std::collections::BTreeMap< 627 - jacquard_common::smol_str::SmolStr, 628 - jacquard_common::types::value::Data<'a>, 629 - >, 630 - ) -> RecordingView<'a> { 631 - RecordingView { 632 - mbid: self.__unsafe_private_named.0.unwrap(), 633 - name: self.__unsafe_private_named.1.unwrap(), 634 - play_count: self.__unsafe_private_named.2.unwrap(), 635 - extra_data: Some(extra_data), 636 - } 637 - } 638 - } 639 - 640 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RecordingView<'a> { 641 - fn nsid() -> &'static str { 642 - "fm.teal.alpha.stats.defs" 643 - } 644 - fn def_name() -> &'static str { 645 - "recordingView" 646 - } 647 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 648 - lexicon_doc_fm_teal_alpha_stats_defs() 649 - } 650 - fn validate( 651 - &self, 652 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 653 - Ok(()) 654 - } 655 - } 656 - 657 - #[jacquard_derive::lexicon] 658 - #[derive( 659 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 660 - )] 661 - #[serde(rename_all = "camelCase")] 662 - pub struct ReleaseView<'a> { 663 - /// MusicBrainz release ID 664 - #[serde(borrow)] 665 - pub mbid: jacquard_common::CowStr<'a>, 666 - /// Release/album name 667 - #[serde(borrow)] 668 - pub name: jacquard_common::CowStr<'a>, 669 - /// Total number of plays for this release 670 - pub play_count: i64, 671 - } 672 - 673 - pub mod release_view_state { 674 - 675 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 676 - #[allow(unused)] 677 - use ::core::marker::PhantomData; 678 - mod sealed { 679 - pub trait Sealed {} 680 - } 681 - /// State trait tracking which required fields have been set 682 - pub trait State: sealed::Sealed { 683 - type Name; 684 - type PlayCount; 685 - type Mbid; 686 - } 687 - /// Empty state - all required fields are unset 688 - pub struct Empty(()); 689 - impl sealed::Sealed for Empty {} 690 - impl State for Empty { 691 - type Name = Unset; 692 - type PlayCount = Unset; 693 - type Mbid = Unset; 694 - } 695 - ///State transition - sets the `name` field to Set 696 - pub struct SetName<S: State = Empty>(PhantomData<fn() -> S>); 697 - impl<S: State> sealed::Sealed for SetName<S> {} 698 - impl<S: State> State for SetName<S> { 699 - type Name = Set<members::name>; 700 - type PlayCount = S::PlayCount; 701 - type Mbid = S::Mbid; 702 - } 703 - ///State transition - sets the `play_count` field to Set 704 - pub struct SetPlayCount<S: State = Empty>(PhantomData<fn() -> S>); 705 - impl<S: State> sealed::Sealed for SetPlayCount<S> {} 706 - impl<S: State> State for SetPlayCount<S> { 707 - type Name = S::Name; 708 - type PlayCount = Set<members::play_count>; 709 - type Mbid = S::Mbid; 710 - } 711 - ///State transition - sets the `mbid` field to Set 712 - pub struct SetMbid<S: State = Empty>(PhantomData<fn() -> S>); 713 - impl<S: State> sealed::Sealed for SetMbid<S> {} 714 - impl<S: State> State for SetMbid<S> { 715 - type Name = S::Name; 716 - type PlayCount = S::PlayCount; 717 - type Mbid = Set<members::mbid>; 718 - } 719 - /// Marker types for field names 720 - #[allow(non_camel_case_types)] 721 - pub mod members { 722 - ///Marker type for the `name` field 723 - pub struct name(()); 724 - ///Marker type for the `play_count` field 725 - pub struct play_count(()); 726 - ///Marker type for the `mbid` field 727 - pub struct mbid(()); 728 - } 729 - } 730 - 731 - /// Builder for constructing an instance of this type 732 - pub struct ReleaseViewBuilder<'a, S: release_view_state::State> { 733 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 734 - __unsafe_private_named: ( 735 - ::core::option::Option<jacquard_common::CowStr<'a>>, 736 - ::core::option::Option<jacquard_common::CowStr<'a>>, 737 - ::core::option::Option<i64>, 738 - ), 739 - _phantom: ::core::marker::PhantomData<&'a ()>, 740 - } 741 - 742 - impl<'a> ReleaseView<'a> { 743 - /// Create a new builder for this type 744 - pub fn new() -> ReleaseViewBuilder<'a, release_view_state::Empty> { 745 - ReleaseViewBuilder::new() 746 - } 747 - } 748 - 749 - impl<'a> ReleaseViewBuilder<'a, release_view_state::Empty> { 750 - /// Create a new builder with all fields unset 751 - pub fn new() -> Self { 752 - ReleaseViewBuilder { 753 - _phantom_state: ::core::marker::PhantomData, 754 - __unsafe_private_named: (None, None, None), 755 - _phantom: ::core::marker::PhantomData, 756 - } 757 - } 758 - } 759 - 760 - impl<'a, S> ReleaseViewBuilder<'a, S> 761 - where 762 - S: release_view_state::State, 763 - S::Mbid: release_view_state::IsUnset, 764 - { 765 - /// Set the `mbid` field (required) 766 - pub fn mbid( 767 - mut self, 768 - value: impl Into<jacquard_common::CowStr<'a>>, 769 - ) -> ReleaseViewBuilder<'a, release_view_state::SetMbid<S>> { 770 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 771 - ReleaseViewBuilder { 772 - _phantom_state: ::core::marker::PhantomData, 773 - __unsafe_private_named: self.__unsafe_private_named, 774 - _phantom: ::core::marker::PhantomData, 775 - } 776 - } 777 - } 778 - 779 - impl<'a, S> ReleaseViewBuilder<'a, S> 780 - where 781 - S: release_view_state::State, 782 - S::Name: release_view_state::IsUnset, 783 - { 784 - /// Set the `name` field (required) 785 - pub fn name( 786 - mut self, 787 - value: impl Into<jacquard_common::CowStr<'a>>, 788 - ) -> ReleaseViewBuilder<'a, release_view_state::SetName<S>> { 789 - self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); 790 - ReleaseViewBuilder { 791 - _phantom_state: ::core::marker::PhantomData, 792 - __unsafe_private_named: self.__unsafe_private_named, 793 - _phantom: ::core::marker::PhantomData, 794 - } 795 - } 796 - } 797 - 798 - impl<'a, S> ReleaseViewBuilder<'a, S> 799 - where 800 - S: release_view_state::State, 801 - S::PlayCount: release_view_state::IsUnset, 802 - { 803 - /// Set the `playCount` field (required) 804 - pub fn play_count( 805 - mut self, 806 - value: impl Into<i64>, 807 - ) -> ReleaseViewBuilder<'a, release_view_state::SetPlayCount<S>> { 808 - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); 809 - ReleaseViewBuilder { 810 - _phantom_state: ::core::marker::PhantomData, 811 - __unsafe_private_named: self.__unsafe_private_named, 812 - _phantom: ::core::marker::PhantomData, 813 - } 814 - } 815 - } 816 - 817 - impl<'a, S> ReleaseViewBuilder<'a, S> 818 - where 819 - S: release_view_state::State, 820 - S::Name: release_view_state::IsSet, 821 - S::PlayCount: release_view_state::IsSet, 822 - S::Mbid: release_view_state::IsSet, 823 - { 824 - /// Build the final struct 825 - pub fn build(self) -> ReleaseView<'a> { 826 - ReleaseView { 827 - mbid: self.__unsafe_private_named.0.unwrap(), 828 - name: self.__unsafe_private_named.1.unwrap(), 829 - play_count: self.__unsafe_private_named.2.unwrap(), 830 - extra_data: Default::default(), 831 - } 832 - } 833 - /// Build the final struct with custom extra_data 834 - pub fn build_with_data( 835 - self, 836 - extra_data: std::collections::BTreeMap< 837 - jacquard_common::smol_str::SmolStr, 838 - jacquard_common::types::value::Data<'a>, 839 - >, 840 - ) -> ReleaseView<'a> { 841 - ReleaseView { 842 - mbid: self.__unsafe_private_named.0.unwrap(), 843 - name: self.__unsafe_private_named.1.unwrap(), 844 - play_count: self.__unsafe_private_named.2.unwrap(), 845 - extra_data: Some(extra_data), 846 - } 847 - } 848 - } 849 - 850 - impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReleaseView<'a> { 851 - fn nsid() -> &'static str { 852 - "fm.teal.alpha.stats.defs" 853 - } 854 - fn def_name() -> &'static str { 855 - "releaseView" 856 - } 857 - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { 858 - lexicon_doc_fm_teal_alpha_stats_defs() 859 - } 860 - fn validate( 861 - &self, 862 - ) -> ::core::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { 863 - Ok(()) 864 - } 865 - }
-119
crates/lexicons/src/fm_teal/alpha/stats/get_latest.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.stats.getLatest 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 GetLatest { 13 - ///(default: 50, min: 1, max: 100) 14 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 15 - pub limit: std::option::Option<i64>, 16 - } 17 - 18 - pub mod get_latest_state { 19 - 20 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 21 - #[allow(unused)] 22 - use ::core::marker::PhantomData; 23 - mod sealed { 24 - pub trait Sealed {} 25 - } 26 - /// State trait tracking which required fields have been set 27 - pub trait State: sealed::Sealed {} 28 - /// Empty state - all required fields are unset 29 - pub struct Empty(()); 30 - impl sealed::Sealed for Empty {} 31 - impl State for Empty {} 32 - /// Marker types for field names 33 - #[allow(non_camel_case_types)] 34 - pub mod members {} 35 - } 36 - 37 - /// Builder for constructing an instance of this type 38 - pub struct GetLatestBuilder<S: get_latest_state::State> { 39 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 40 - __unsafe_private_named: (::core::option::Option<i64>,), 41 - } 42 - 43 - impl GetLatest { 44 - /// Create a new builder for this type 45 - pub fn new() -> GetLatestBuilder<get_latest_state::Empty> { 46 - GetLatestBuilder::new() 47 - } 48 - } 49 - 50 - impl GetLatestBuilder<get_latest_state::Empty> { 51 - /// Create a new builder with all fields unset 52 - pub fn new() -> Self { 53 - GetLatestBuilder { 54 - _phantom_state: ::core::marker::PhantomData, 55 - __unsafe_private_named: (None,), 56 - } 57 - } 58 - } 59 - 60 - impl<S: get_latest_state::State> GetLatestBuilder<S> { 61 - /// Set the `limit` field (optional) 62 - pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self { 63 - self.__unsafe_private_named.0 = value.into(); 64 - self 65 - } 66 - /// Set the `limit` field to an Option value (optional) 67 - pub fn maybe_limit(mut self, value: Option<i64>) -> Self { 68 - self.__unsafe_private_named.0 = value; 69 - self 70 - } 71 - } 72 - 73 - impl<S> GetLatestBuilder<S> 74 - where 75 - S: get_latest_state::State, 76 - { 77 - /// Build the final struct 78 - pub fn build(self) -> GetLatest { 79 - GetLatest { 80 - limit: self.__unsafe_private_named.0, 81 - } 82 - } 83 - } 84 - 85 - #[jacquard_derive::lexicon] 86 - #[derive( 87 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 88 - )] 89 - #[serde(rename_all = "camelCase")] 90 - pub struct GetLatestOutput<'a> { 91 - #[serde(borrow)] 92 - pub plays: Vec<crate::fm_teal::alpha::feed::PlayView<'a>>, 93 - } 94 - 95 - /// Response type for 96 - ///fm.teal.alpha.stats.getLatest 97 - pub struct GetLatestResponse; 98 - impl jacquard_common::xrpc::XrpcResp for GetLatestResponse { 99 - const NSID: &'static str = "fm.teal.alpha.stats.getLatest"; 100 - const ENCODING: &'static str = "application/json"; 101 - type Output<'de> = GetLatestOutput<'de>; 102 - type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 103 - } 104 - 105 - impl jacquard_common::xrpc::XrpcRequest for GetLatest { 106 - const NSID: &'static str = "fm.teal.alpha.stats.getLatest"; 107 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 108 - type Response = GetLatestResponse; 109 - } 110 - 111 - /// Endpoint type for 112 - ///fm.teal.alpha.stats.getLatest 113 - pub struct GetLatestRequest; 114 - impl jacquard_common::xrpc::XrpcEndpoint for GetLatestRequest { 115 - const PATH: &'static str = "/xrpc/fm.teal.alpha.stats.getLatest"; 116 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 117 - type Request<'de> = GetLatest; 118 - type Response = GetLatestResponse; 119 - }
-164
crates/lexicons/src/fm_teal/alpha/stats/get_top_artists.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.stats.getTopArtists 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 GetTopArtists<'a> { 13 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 14 - #[serde(borrow)] 15 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 16 - ///(default: 50, min: 1, max: 100) 17 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 18 - pub limit: std::option::Option<i64>, 19 - ///(default: "all") 20 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 21 - #[serde(borrow)] 22 - pub period: std::option::Option<jacquard_common::CowStr<'a>>, 23 - } 24 - 25 - pub mod get_top_artists_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 - /// Empty state - all required fields are unset 36 - pub struct Empty(()); 37 - impl sealed::Sealed for Empty {} 38 - impl State for Empty {} 39 - /// Marker types for field names 40 - #[allow(non_camel_case_types)] 41 - pub mod members {} 42 - } 43 - 44 - /// Builder for constructing an instance of this type 45 - pub struct GetTopArtistsBuilder<'a, S: get_top_artists_state::State> { 46 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 47 - __unsafe_private_named: ( 48 - ::core::option::Option<jacquard_common::CowStr<'a>>, 49 - ::core::option::Option<i64>, 50 - ::core::option::Option<jacquard_common::CowStr<'a>>, 51 - ), 52 - _phantom: ::core::marker::PhantomData<&'a ()>, 53 - } 54 - 55 - impl<'a> GetTopArtists<'a> { 56 - /// Create a new builder for this type 57 - pub fn new() -> GetTopArtistsBuilder<'a, get_top_artists_state::Empty> { 58 - GetTopArtistsBuilder::new() 59 - } 60 - } 61 - 62 - impl<'a> GetTopArtistsBuilder<'a, get_top_artists_state::Empty> { 63 - /// Create a new builder with all fields unset 64 - pub fn new() -> Self { 65 - GetTopArtistsBuilder { 66 - _phantom_state: ::core::marker::PhantomData, 67 - __unsafe_private_named: (None, None, None), 68 - _phantom: ::core::marker::PhantomData, 69 - } 70 - } 71 - } 72 - 73 - impl<'a, S: get_top_artists_state::State> GetTopArtistsBuilder<'a, S> { 74 - /// Set the `cursor` field (optional) 75 - pub fn cursor(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 76 - self.__unsafe_private_named.0 = value.into(); 77 - self 78 - } 79 - /// Set the `cursor` field to an Option value (optional) 80 - pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 81 - self.__unsafe_private_named.0 = value; 82 - self 83 - } 84 - } 85 - 86 - impl<'a, S: get_top_artists_state::State> GetTopArtistsBuilder<'a, S> { 87 - /// Set the `limit` field (optional) 88 - pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self { 89 - self.__unsafe_private_named.1 = value.into(); 90 - self 91 - } 92 - /// Set the `limit` field to an Option value (optional) 93 - pub fn maybe_limit(mut self, value: Option<i64>) -> Self { 94 - self.__unsafe_private_named.1 = value; 95 - self 96 - } 97 - } 98 - 99 - impl<'a, S: get_top_artists_state::State> GetTopArtistsBuilder<'a, S> { 100 - /// Set the `period` field (optional) 101 - pub fn period(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 102 - self.__unsafe_private_named.2 = value.into(); 103 - self 104 - } 105 - /// Set the `period` field to an Option value (optional) 106 - pub fn maybe_period(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 107 - self.__unsafe_private_named.2 = value; 108 - self 109 - } 110 - } 111 - 112 - impl<'a, S> GetTopArtistsBuilder<'a, S> 113 - where 114 - S: get_top_artists_state::State, 115 - { 116 - /// Build the final struct 117 - pub fn build(self) -> GetTopArtists<'a> { 118 - GetTopArtists { 119 - cursor: self.__unsafe_private_named.0, 120 - limit: self.__unsafe_private_named.1, 121 - period: self.__unsafe_private_named.2, 122 - } 123 - } 124 - } 125 - 126 - #[jacquard_derive::lexicon] 127 - #[derive( 128 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 129 - )] 130 - #[serde(rename_all = "camelCase")] 131 - pub struct GetTopArtistsOutput<'a> { 132 - #[serde(borrow)] 133 - pub artists: Vec<crate::fm_teal::alpha::stats::ArtistView<'a>>, 134 - /// Next page cursor 135 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 136 - #[serde(borrow)] 137 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 138 - } 139 - 140 - /// Response type for 141 - ///fm.teal.alpha.stats.getTopArtists 142 - pub struct GetTopArtistsResponse; 143 - impl jacquard_common::xrpc::XrpcResp for GetTopArtistsResponse { 144 - const NSID: &'static str = "fm.teal.alpha.stats.getTopArtists"; 145 - const ENCODING: &'static str = "application/json"; 146 - type Output<'de> = GetTopArtistsOutput<'de>; 147 - type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 148 - } 149 - 150 - impl<'a> jacquard_common::xrpc::XrpcRequest for GetTopArtists<'a> { 151 - const NSID: &'static str = "fm.teal.alpha.stats.getTopArtists"; 152 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 153 - type Response = GetTopArtistsResponse; 154 - } 155 - 156 - /// Endpoint type for 157 - ///fm.teal.alpha.stats.getTopArtists 158 - pub struct GetTopArtistsRequest; 159 - impl jacquard_common::xrpc::XrpcEndpoint for GetTopArtistsRequest { 160 - const PATH: &'static str = "/xrpc/fm.teal.alpha.stats.getTopArtists"; 161 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 162 - type Request<'de> = GetTopArtists<'de>; 163 - type Response = GetTopArtistsResponse; 164 - }
-164
crates/lexicons/src/fm_teal/alpha/stats/get_top_releases.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.stats.getTopReleases 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 GetTopReleases<'a> { 13 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 14 - #[serde(borrow)] 15 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 16 - ///(default: 50, min: 1, max: 100) 17 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 18 - pub limit: std::option::Option<i64>, 19 - ///(default: "all") 20 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 21 - #[serde(borrow)] 22 - pub period: std::option::Option<jacquard_common::CowStr<'a>>, 23 - } 24 - 25 - pub mod get_top_releases_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 - /// Empty state - all required fields are unset 36 - pub struct Empty(()); 37 - impl sealed::Sealed for Empty {} 38 - impl State for Empty {} 39 - /// Marker types for field names 40 - #[allow(non_camel_case_types)] 41 - pub mod members {} 42 - } 43 - 44 - /// Builder for constructing an instance of this type 45 - pub struct GetTopReleasesBuilder<'a, S: get_top_releases_state::State> { 46 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 47 - __unsafe_private_named: ( 48 - ::core::option::Option<jacquard_common::CowStr<'a>>, 49 - ::core::option::Option<i64>, 50 - ::core::option::Option<jacquard_common::CowStr<'a>>, 51 - ), 52 - _phantom: ::core::marker::PhantomData<&'a ()>, 53 - } 54 - 55 - impl<'a> GetTopReleases<'a> { 56 - /// Create a new builder for this type 57 - pub fn new() -> GetTopReleasesBuilder<'a, get_top_releases_state::Empty> { 58 - GetTopReleasesBuilder::new() 59 - } 60 - } 61 - 62 - impl<'a> GetTopReleasesBuilder<'a, get_top_releases_state::Empty> { 63 - /// Create a new builder with all fields unset 64 - pub fn new() -> Self { 65 - GetTopReleasesBuilder { 66 - _phantom_state: ::core::marker::PhantomData, 67 - __unsafe_private_named: (None, None, None), 68 - _phantom: ::core::marker::PhantomData, 69 - } 70 - } 71 - } 72 - 73 - impl<'a, S: get_top_releases_state::State> GetTopReleasesBuilder<'a, S> { 74 - /// Set the `cursor` field (optional) 75 - pub fn cursor(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 76 - self.__unsafe_private_named.0 = value.into(); 77 - self 78 - } 79 - /// Set the `cursor` field to an Option value (optional) 80 - pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 81 - self.__unsafe_private_named.0 = value; 82 - self 83 - } 84 - } 85 - 86 - impl<'a, S: get_top_releases_state::State> GetTopReleasesBuilder<'a, S> { 87 - /// Set the `limit` field (optional) 88 - pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self { 89 - self.__unsafe_private_named.1 = value.into(); 90 - self 91 - } 92 - /// Set the `limit` field to an Option value (optional) 93 - pub fn maybe_limit(mut self, value: Option<i64>) -> Self { 94 - self.__unsafe_private_named.1 = value; 95 - self 96 - } 97 - } 98 - 99 - impl<'a, S: get_top_releases_state::State> GetTopReleasesBuilder<'a, S> { 100 - /// Set the `period` field (optional) 101 - pub fn period(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 102 - self.__unsafe_private_named.2 = value.into(); 103 - self 104 - } 105 - /// Set the `period` field to an Option value (optional) 106 - pub fn maybe_period(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 107 - self.__unsafe_private_named.2 = value; 108 - self 109 - } 110 - } 111 - 112 - impl<'a, S> GetTopReleasesBuilder<'a, S> 113 - where 114 - S: get_top_releases_state::State, 115 - { 116 - /// Build the final struct 117 - pub fn build(self) -> GetTopReleases<'a> { 118 - GetTopReleases { 119 - cursor: self.__unsafe_private_named.0, 120 - limit: self.__unsafe_private_named.1, 121 - period: self.__unsafe_private_named.2, 122 - } 123 - } 124 - } 125 - 126 - #[jacquard_derive::lexicon] 127 - #[derive( 128 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 129 - )] 130 - #[serde(rename_all = "camelCase")] 131 - pub struct GetTopReleasesOutput<'a> { 132 - /// Next page cursor 133 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 134 - #[serde(borrow)] 135 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 136 - #[serde(borrow)] 137 - pub releases: Vec<crate::fm_teal::alpha::stats::ReleaseView<'a>>, 138 - } 139 - 140 - /// Response type for 141 - ///fm.teal.alpha.stats.getTopReleases 142 - pub struct GetTopReleasesResponse; 143 - impl jacquard_common::xrpc::XrpcResp for GetTopReleasesResponse { 144 - const NSID: &'static str = "fm.teal.alpha.stats.getTopReleases"; 145 - const ENCODING: &'static str = "application/json"; 146 - type Output<'de> = GetTopReleasesOutput<'de>; 147 - type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 148 - } 149 - 150 - impl<'a> jacquard_common::xrpc::XrpcRequest for GetTopReleases<'a> { 151 - const NSID: &'static str = "fm.teal.alpha.stats.getTopReleases"; 152 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 153 - type Response = GetTopReleasesResponse; 154 - } 155 - 156 - /// Endpoint type for 157 - ///fm.teal.alpha.stats.getTopReleases 158 - pub struct GetTopReleasesRequest; 159 - impl jacquard_common::xrpc::XrpcEndpoint for GetTopReleasesRequest { 160 - const PATH: &'static str = "/xrpc/fm.teal.alpha.stats.getTopReleases"; 161 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 162 - type Request<'de> = GetTopReleases<'de>; 163 - type Response = GetTopReleasesResponse; 164 - }
-201
crates/lexicons/src/fm_teal/alpha/stats/get_user_top_artists.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.stats.getUserTopArtists 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 GetUserTopArtists<'a> { 13 - #[serde(borrow)] 14 - pub actor: jacquard_common::types::ident::AtIdentifier<'a>, 15 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 16 - #[serde(borrow)] 17 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 18 - ///(default: 50, min: 1, max: 100) 19 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 20 - pub limit: std::option::Option<i64>, 21 - ///(default: "30days") 22 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 - #[serde(borrow)] 24 - pub period: std::option::Option<jacquard_common::CowStr<'a>>, 25 - } 26 - 27 - pub mod get_user_top_artists_state { 28 - 29 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 30 - #[allow(unused)] 31 - use ::core::marker::PhantomData; 32 - mod sealed { 33 - pub trait Sealed {} 34 - } 35 - /// State trait tracking which required fields have been set 36 - pub trait State: sealed::Sealed { 37 - type Actor; 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 Actor = Unset; 44 - } 45 - ///State transition - sets the `actor` field to Set 46 - pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 47 - impl<S: State> sealed::Sealed for SetActor<S> {} 48 - impl<S: State> State for SetActor<S> { 49 - type Actor = Set<members::actor>; 50 - } 51 - /// Marker types for field names 52 - #[allow(non_camel_case_types)] 53 - pub mod members { 54 - ///Marker type for the `actor` field 55 - pub struct actor(()); 56 - } 57 - } 58 - 59 - /// Builder for constructing an instance of this type 60 - pub struct GetUserTopArtistsBuilder<'a, S: get_user_top_artists_state::State> { 61 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 62 - __unsafe_private_named: ( 63 - ::core::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>, 64 - ::core::option::Option<jacquard_common::CowStr<'a>>, 65 - ::core::option::Option<i64>, 66 - ::core::option::Option<jacquard_common::CowStr<'a>>, 67 - ), 68 - _phantom: ::core::marker::PhantomData<&'a ()>, 69 - } 70 - 71 - impl<'a> GetUserTopArtists<'a> { 72 - /// Create a new builder for this type 73 - pub fn new() -> GetUserTopArtistsBuilder<'a, get_user_top_artists_state::Empty> { 74 - GetUserTopArtistsBuilder::new() 75 - } 76 - } 77 - 78 - impl<'a> GetUserTopArtistsBuilder<'a, get_user_top_artists_state::Empty> { 79 - /// Create a new builder with all fields unset 80 - pub fn new() -> Self { 81 - GetUserTopArtistsBuilder { 82 - _phantom_state: ::core::marker::PhantomData, 83 - __unsafe_private_named: (None, None, None, None), 84 - _phantom: ::core::marker::PhantomData, 85 - } 86 - } 87 - } 88 - 89 - impl<'a, S> GetUserTopArtistsBuilder<'a, S> 90 - where 91 - S: get_user_top_artists_state::State, 92 - S::Actor: get_user_top_artists_state::IsUnset, 93 - { 94 - /// Set the `actor` field (required) 95 - pub fn actor( 96 - mut self, 97 - value: impl Into<jacquard_common::types::ident::AtIdentifier<'a>>, 98 - ) -> GetUserTopArtistsBuilder<'a, get_user_top_artists_state::SetActor<S>> { 99 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 100 - GetUserTopArtistsBuilder { 101 - _phantom_state: ::core::marker::PhantomData, 102 - __unsafe_private_named: self.__unsafe_private_named, 103 - _phantom: ::core::marker::PhantomData, 104 - } 105 - } 106 - } 107 - 108 - impl<'a, S: get_user_top_artists_state::State> GetUserTopArtistsBuilder<'a, S> { 109 - /// Set the `cursor` field (optional) 110 - pub fn cursor(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 111 - self.__unsafe_private_named.1 = value.into(); 112 - self 113 - } 114 - /// Set the `cursor` field to an Option value (optional) 115 - pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 116 - self.__unsafe_private_named.1 = value; 117 - self 118 - } 119 - } 120 - 121 - impl<'a, S: get_user_top_artists_state::State> GetUserTopArtistsBuilder<'a, S> { 122 - /// Set the `limit` field (optional) 123 - pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self { 124 - self.__unsafe_private_named.2 = value.into(); 125 - self 126 - } 127 - /// Set the `limit` field to an Option value (optional) 128 - pub fn maybe_limit(mut self, value: Option<i64>) -> Self { 129 - self.__unsafe_private_named.2 = value; 130 - self 131 - } 132 - } 133 - 134 - impl<'a, S: get_user_top_artists_state::State> GetUserTopArtistsBuilder<'a, S> { 135 - /// Set the `period` field (optional) 136 - pub fn period(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 137 - self.__unsafe_private_named.3 = value.into(); 138 - self 139 - } 140 - /// Set the `period` field to an Option value (optional) 141 - pub fn maybe_period(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 142 - self.__unsafe_private_named.3 = value; 143 - self 144 - } 145 - } 146 - 147 - impl<'a, S> GetUserTopArtistsBuilder<'a, S> 148 - where 149 - S: get_user_top_artists_state::State, 150 - S::Actor: get_user_top_artists_state::IsSet, 151 - { 152 - /// Build the final struct 153 - pub fn build(self) -> GetUserTopArtists<'a> { 154 - GetUserTopArtists { 155 - actor: self.__unsafe_private_named.0.unwrap(), 156 - cursor: self.__unsafe_private_named.1, 157 - limit: self.__unsafe_private_named.2, 158 - period: self.__unsafe_private_named.3, 159 - } 160 - } 161 - } 162 - 163 - #[jacquard_derive::lexicon] 164 - #[derive( 165 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 166 - )] 167 - #[serde(rename_all = "camelCase")] 168 - pub struct GetUserTopArtistsOutput<'a> { 169 - #[serde(borrow)] 170 - pub artists: Vec<crate::fm_teal::alpha::stats::ArtistView<'a>>, 171 - /// Next page cursor 172 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 173 - #[serde(borrow)] 174 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 175 - } 176 - 177 - /// Response type for 178 - ///fm.teal.alpha.stats.getUserTopArtists 179 - pub struct GetUserTopArtistsResponse; 180 - impl jacquard_common::xrpc::XrpcResp for GetUserTopArtistsResponse { 181 - const NSID: &'static str = "fm.teal.alpha.stats.getUserTopArtists"; 182 - const ENCODING: &'static str = "application/json"; 183 - type Output<'de> = GetUserTopArtistsOutput<'de>; 184 - type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 185 - } 186 - 187 - impl<'a> jacquard_common::xrpc::XrpcRequest for GetUserTopArtists<'a> { 188 - const NSID: &'static str = "fm.teal.alpha.stats.getUserTopArtists"; 189 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 190 - type Response = GetUserTopArtistsResponse; 191 - } 192 - 193 - /// Endpoint type for 194 - ///fm.teal.alpha.stats.getUserTopArtists 195 - pub struct GetUserTopArtistsRequest; 196 - impl jacquard_common::xrpc::XrpcEndpoint for GetUserTopArtistsRequest { 197 - const PATH: &'static str = "/xrpc/fm.teal.alpha.stats.getUserTopArtists"; 198 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 199 - type Request<'de> = GetUserTopArtists<'de>; 200 - type Response = GetUserTopArtistsResponse; 201 - }
-201
crates/lexicons/src/fm_teal/alpha/stats/get_user_top_releases.rs
··· 1 - // @generated by jacquard-lexicon. DO NOT EDIT. 2 - // 3 - // Lexicon: fm.teal.alpha.stats.getUserTopReleases 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 GetUserTopReleases<'a> { 13 - #[serde(borrow)] 14 - pub actor: jacquard_common::types::ident::AtIdentifier<'a>, 15 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 16 - #[serde(borrow)] 17 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 18 - ///(default: 50, min: 1, max: 100) 19 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 20 - pub limit: std::option::Option<i64>, 21 - ///(default: "30days") 22 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 23 - #[serde(borrow)] 24 - pub period: std::option::Option<jacquard_common::CowStr<'a>>, 25 - } 26 - 27 - pub mod get_user_top_releases_state { 28 - 29 - pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; 30 - #[allow(unused)] 31 - use ::core::marker::PhantomData; 32 - mod sealed { 33 - pub trait Sealed {} 34 - } 35 - /// State trait tracking which required fields have been set 36 - pub trait State: sealed::Sealed { 37 - type Actor; 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 Actor = Unset; 44 - } 45 - ///State transition - sets the `actor` field to Set 46 - pub struct SetActor<S: State = Empty>(PhantomData<fn() -> S>); 47 - impl<S: State> sealed::Sealed for SetActor<S> {} 48 - impl<S: State> State for SetActor<S> { 49 - type Actor = Set<members::actor>; 50 - } 51 - /// Marker types for field names 52 - #[allow(non_camel_case_types)] 53 - pub mod members { 54 - ///Marker type for the `actor` field 55 - pub struct actor(()); 56 - } 57 - } 58 - 59 - /// Builder for constructing an instance of this type 60 - pub struct GetUserTopReleasesBuilder<'a, S: get_user_top_releases_state::State> { 61 - _phantom_state: ::core::marker::PhantomData<fn() -> S>, 62 - __unsafe_private_named: ( 63 - ::core::option::Option<jacquard_common::types::ident::AtIdentifier<'a>>, 64 - ::core::option::Option<jacquard_common::CowStr<'a>>, 65 - ::core::option::Option<i64>, 66 - ::core::option::Option<jacquard_common::CowStr<'a>>, 67 - ), 68 - _phantom: ::core::marker::PhantomData<&'a ()>, 69 - } 70 - 71 - impl<'a> GetUserTopReleases<'a> { 72 - /// Create a new builder for this type 73 - pub fn new() -> GetUserTopReleasesBuilder<'a, get_user_top_releases_state::Empty> { 74 - GetUserTopReleasesBuilder::new() 75 - } 76 - } 77 - 78 - impl<'a> GetUserTopReleasesBuilder<'a, get_user_top_releases_state::Empty> { 79 - /// Create a new builder with all fields unset 80 - pub fn new() -> Self { 81 - GetUserTopReleasesBuilder { 82 - _phantom_state: ::core::marker::PhantomData, 83 - __unsafe_private_named: (None, None, None, None), 84 - _phantom: ::core::marker::PhantomData, 85 - } 86 - } 87 - } 88 - 89 - impl<'a, S> GetUserTopReleasesBuilder<'a, S> 90 - where 91 - S: get_user_top_releases_state::State, 92 - S::Actor: get_user_top_releases_state::IsUnset, 93 - { 94 - /// Set the `actor` field (required) 95 - pub fn actor( 96 - mut self, 97 - value: impl Into<jacquard_common::types::ident::AtIdentifier<'a>>, 98 - ) -> GetUserTopReleasesBuilder<'a, get_user_top_releases_state::SetActor<S>> { 99 - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); 100 - GetUserTopReleasesBuilder { 101 - _phantom_state: ::core::marker::PhantomData, 102 - __unsafe_private_named: self.__unsafe_private_named, 103 - _phantom: ::core::marker::PhantomData, 104 - } 105 - } 106 - } 107 - 108 - impl<'a, S: get_user_top_releases_state::State> GetUserTopReleasesBuilder<'a, S> { 109 - /// Set the `cursor` field (optional) 110 - pub fn cursor(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 111 - self.__unsafe_private_named.1 = value.into(); 112 - self 113 - } 114 - /// Set the `cursor` field to an Option value (optional) 115 - pub fn maybe_cursor(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 116 - self.__unsafe_private_named.1 = value; 117 - self 118 - } 119 - } 120 - 121 - impl<'a, S: get_user_top_releases_state::State> GetUserTopReleasesBuilder<'a, S> { 122 - /// Set the `limit` field (optional) 123 - pub fn limit(mut self, value: impl Into<Option<i64>>) -> Self { 124 - self.__unsafe_private_named.2 = value.into(); 125 - self 126 - } 127 - /// Set the `limit` field to an Option value (optional) 128 - pub fn maybe_limit(mut self, value: Option<i64>) -> Self { 129 - self.__unsafe_private_named.2 = value; 130 - self 131 - } 132 - } 133 - 134 - impl<'a, S: get_user_top_releases_state::State> GetUserTopReleasesBuilder<'a, S> { 135 - /// Set the `period` field (optional) 136 - pub fn period(mut self, value: impl Into<Option<jacquard_common::CowStr<'a>>>) -> Self { 137 - self.__unsafe_private_named.3 = value.into(); 138 - self 139 - } 140 - /// Set the `period` field to an Option value (optional) 141 - pub fn maybe_period(mut self, value: Option<jacquard_common::CowStr<'a>>) -> Self { 142 - self.__unsafe_private_named.3 = value; 143 - self 144 - } 145 - } 146 - 147 - impl<'a, S> GetUserTopReleasesBuilder<'a, S> 148 - where 149 - S: get_user_top_releases_state::State, 150 - S::Actor: get_user_top_releases_state::IsSet, 151 - { 152 - /// Build the final struct 153 - pub fn build(self) -> GetUserTopReleases<'a> { 154 - GetUserTopReleases { 155 - actor: self.__unsafe_private_named.0.unwrap(), 156 - cursor: self.__unsafe_private_named.1, 157 - limit: self.__unsafe_private_named.2, 158 - period: self.__unsafe_private_named.3, 159 - } 160 - } 161 - } 162 - 163 - #[jacquard_derive::lexicon] 164 - #[derive( 165 - serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, 166 - )] 167 - #[serde(rename_all = "camelCase")] 168 - pub struct GetUserTopReleasesOutput<'a> { 169 - /// Next page cursor 170 - #[serde(skip_serializing_if = "std::option::Option::is_none")] 171 - #[serde(borrow)] 172 - pub cursor: std::option::Option<jacquard_common::CowStr<'a>>, 173 - #[serde(borrow)] 174 - pub releases: Vec<crate::fm_teal::alpha::stats::ReleaseView<'a>>, 175 - } 176 - 177 - /// Response type for 178 - ///fm.teal.alpha.stats.getUserTopReleases 179 - pub struct GetUserTopReleasesResponse; 180 - impl jacquard_common::xrpc::XrpcResp for GetUserTopReleasesResponse { 181 - const NSID: &'static str = "fm.teal.alpha.stats.getUserTopReleases"; 182 - const ENCODING: &'static str = "application/json"; 183 - type Output<'de> = GetUserTopReleasesOutput<'de>; 184 - type Err<'de> = jacquard_common::xrpc::GenericError<'de>; 185 - } 186 - 187 - impl<'a> jacquard_common::xrpc::XrpcRequest for GetUserTopReleases<'a> { 188 - const NSID: &'static str = "fm.teal.alpha.stats.getUserTopReleases"; 189 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 190 - type Response = GetUserTopReleasesResponse; 191 - } 192 - 193 - /// Endpoint type for 194 - ///fm.teal.alpha.stats.getUserTopReleases 195 - pub struct GetUserTopReleasesRequest; 196 - impl jacquard_common::xrpc::XrpcEndpoint for GetUserTopReleasesRequest { 197 - const PATH: &'static str = "/xrpc/fm.teal.alpha.stats.getUserTopReleases"; 198 - const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; 199 - type Request<'de> = GetUserTopReleases<'de>; 200 - type Response = GetUserTopReleasesResponse; 201 - }
-10
crates/lexicons/src/lib.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 - extern crate alloc; 7 - pub mod builder_types; 8 - 9 - #[cfg(feature = "fm_teal")] 10 - pub mod fm_teal;
-10
lexicons.kdl
··· 1 - output { 2 - lexicons "crates/lexicons/lexicons" 3 - codegen "crates/lexicons/src" 4 - cargo-toml "crates/lexicons/Cargo.toml" 5 - } 6 - 7 - source "teal-fm" type="git" priority=100 { 8 - repo "https://github.com/teal-fm/teal" 9 - pattern "lexicons/fm.teal.alpha/**/*.json" 10 - }
+1 -1
src/scrobble.rs
··· 3 3 use jacquard::client::{Agent, AgentSessionExt}; 4 4 use jacquard::smol_str::ToSmolStr; 5 5 use jacquard::{CowStr, types::string::Datetime}; 6 - use onyx_lexicons::fm_teal::alpha::feed::{Artist, play::Play}; 6 + use jacquard_api::fm_teal::alpha::feed::{Artist, play::Play}; 7 7 8 8 use crate::{ 9 9 LogFormat,