diff --git a/crates/weaver-api/lexicons/sh_weaver_actor_defs.json b/crates/weaver-api/lexicons/sh_weaver_actor_defs.json index 18bb350..10888d7 100644 --- a/crates/weaver-api/lexicons/sh_weaver_actor_defs.json +++ b/crates/weaver-api/lexicons/sh_weaver_actor_defs.json @@ -32,6 +32,18 @@ "inner" ], "properties": { + "collaborationCount": { + "type": "integer" + }, + "entryCount": { + "type": "integer" + }, + "followerCount": { + "type": "integer" + }, + "followingCount": { + "type": "integer" + }, "inner": { "type": "union", "refs": [ @@ -39,6 +51,13 @@ "app.bsky.actor.defs#profileViewDetailed", "#tangledProfileView" ] + }, + "notebookCount": { + "type": "integer" + }, + "viewer": { + "type": "ref", + "ref": "#viewerState" } } }, @@ -48,6 +67,12 @@ "inner" ], "properties": { + "followerCount": { + "type": "integer" + }, + "followingCount": { + "type": "integer" + }, "inner": { "type": "union", "refs": [ @@ -55,6 +80,10 @@ "app.bsky.actor.defs#profileViewBasic", "#tangledProfileView" ] + }, + "viewer": { + "type": "ref", + "ref": "#viewerStateBasic" } } }, @@ -218,6 +247,25 @@ }, "maxLength": 5 }, + "subscribedNotebook": { + "type": "object", + "description": "A notebook the viewer subscribes to without a global follow.", + "required": [ + "uri" + ], + "properties": { + "path": { + "type": "string" + }, + "title": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, "tangledProfileView": { "type": "object", "required": [ @@ -288,6 +336,82 @@ "maxLength": 2 } } + }, + "viewerState": { + "type": "object", + "description": "Viewer's relationship state with an actor (detailed version).", + "properties": { + "blocked": { + "type": "string", + "format": "at-uri" + }, + "blockedBy": { + "type": "boolean" + }, + "followRequested": { + "type": "string", + "format": "at-uri" + }, + "followRequestedBy": { + "type": "string", + "format": "at-uri" + }, + "followedBy": { + "type": "string", + "format": "at-uri" + }, + "following": { + "type": "string", + "format": "at-uri" + }, + "muted": { + "type": "string", + "format": "at-uri" + }, + "subscribedNotebooks": { + "type": "array", + "items": { + "type": "ref", + "ref": "#subscribedNotebook" + } + } + } + }, + "viewerStateBasic": { + "type": "object", + "description": "Viewer's relationship state with an actor (basic version).", + "properties": { + "blocked": { + "type": "string", + "format": "at-uri" + }, + "blockedBy": { + "type": "boolean" + }, + "followRequested": { + "type": "string", + "format": "at-uri" + }, + "followRequestedBy": { + "type": "string", + "format": "at-uri" + }, + "followedBy": { + "type": "string", + "format": "at-uri" + }, + "following": { + "type": "string", + "format": "at-uri" + }, + "muted": { + "type": "string", + "format": "at-uri" + }, + "subscribedNotebookCount": { + "type": "integer" + } + } } } } \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_actor_getActorEntries.json b/crates/weaver-api/lexicons/sh_weaver_actor_getActorEntries.json new file mode 100644 index 0000000..3d61c32 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_actor_getActorEntries.json @@ -0,0 +1,56 @@ +{ + "lexicon": 1, + "id": "sh.weaver.actor.getActorEntries", + "defs": { + "main": { + "type": "query", + "description": "Get all entries for an actor, optionally including collaborations.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "includeCollaborations": { + "type": "boolean", + "default": false + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "entries" + ], + "properties": { + "cursor": { + "type": "string" + }, + "entries": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#entryView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_actor_getActorNotebooks.json b/crates/weaver-api/lexicons/sh_weaver_actor_getActorNotebooks.json new file mode 100644 index 0000000..ad369ed --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_actor_getActorNotebooks.json @@ -0,0 +1,56 @@ +{ + "lexicon": 1, + "id": "sh.weaver.actor.getActorNotebooks", + "defs": { + "main": { + "type": "query", + "description": "Get all notebooks for an actor, optionally including collaborations.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "includeCollaborations": { + "type": "boolean", + "default": false + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "notebooks" + ], + "properties": { + "cursor": { + "type": "string" + }, + "notebooks": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_actor_getSuggestedAuthors.json b/crates/weaver-api/lexicons/sh_weaver_actor_getSuggestedAuthors.json new file mode 100644 index 0000000..29673ae --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_actor_getSuggestedAuthors.json @@ -0,0 +1,69 @@ +{ + "lexicon": 1, + "id": "sh.weaver.actor.getSuggestedAuthors", + "defs": { + "main": { + "type": "query", + "description": "Get author recommendations for the authenticated user.", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 50 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "authors" + ], + "properties": { + "authors": { + "type": "array", + "items": { + "type": "object", + "required": [ + "author", + "reason" + ], + "properties": { + "author": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileView" + }, + "mutualFollows": { + "type": "array", + "description": "People you follow who also follow this author.", + "items": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "maxLength": 3 + }, + "notebookCount": { + "type": "integer" + }, + "reason": { + "type": "string", + "knownValues": [ + "similar-to-followed", + "writes-similar-content", + "popular-in-tags-you-read", + "followed-by-people-you-follow" + ] + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_actor_searchActors.json b/crates/weaver-api/lexicons/sh_weaver_actor_searchActors.json new file mode 100644 index 0000000..972c8b3 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_actor_searchActors.json @@ -0,0 +1,54 @@ +{ + "lexicon": 1, + "id": "sh.weaver.actor.searchActors", + "defs": { + "main": { + "type": "query", + "description": "Find actors matching search criteria.", + "parameters": { + "type": "params", + "required": [ + "q" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 100 + }, + "q": { + "type": "string", + "description": "Search query - matches handle, display name, description.", + "minLength": 1, + "maxLength": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actors" + ], + "properties": { + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileView" + } + }, + "cursor": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_actor_searchActorsTypeahead.json b/crates/weaver-api/lexicons/sh_weaver_actor_searchActorsTypeahead.json new file mode 100644 index 0000000..3571898 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_actor_searchActorsTypeahead.json @@ -0,0 +1,48 @@ +{ + "lexicon": 1, + "id": "sh.weaver.actor.searchActorsTypeahead", + "defs": { + "main": { + "type": "query", + "description": "Fast typeahead search for actors (handle/display name prefix matching).", + "parameters": { + "type": "params", + "required": [ + "q" + ], + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 25 + }, + "q": { + "type": "string", + "description": "Search query prefix.", + "minLength": 1, + "maxLength": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "actors" + ], + "properties": { + "actors": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_collab_defs.json b/crates/weaver-api/lexicons/sh_weaver_collab_defs.json index f273a93..5020bb6 100644 --- a/crates/weaver-api/lexicons/sh_weaver_collab_defs.json +++ b/crates/weaver-api/lexicons/sh_weaver_collab_defs.json @@ -6,13 +6,322 @@ "type": "token", "description": "Collaboration scoped to a chapter." }, + "collaborationStateView": { + "type": "object", + "description": "Full state of a collaboration relationship including version reconciliation. Tracks both current and former collaborators.", + "required": [ + "resource", + "status", + "participants" + ], + "properties": { + "canonicalUri": { + "type": "string", + "description": "The 'canonical' version URI (usually owner's)", + "format": "at-uri" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "firstCollaboratorAddedAt": { + "type": "string", + "format": "datetime" + }, + "formerParticipants": { + "type": "array", + "description": "People who used to collaborate but relationship ended", + "items": { + "type": "ref", + "ref": "#formerCollaboratorView" + } + }, + "hasDivergence": { + "type": "boolean" + }, + "hasFormerCollaborators": { + "type": "boolean" + }, + "hasOrphanedVersions": { + "type": "boolean", + "description": "Published versions from former collaborators still exist" + }, + "lastSyncedAt": { + "type": "string", + "format": "datetime" + }, + "participants": { + "type": "array", + "description": "Current active + invited participants", + "items": { + "type": "ref", + "ref": "#participantStateView" + } + }, + "publishedVersions": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#publishedVersionView" + } + }, + "resource": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "status": { + "type": "string", + "description": "active=normal, broken=all invites revoked/expired, diverged=versions differ, reconciled=was diverged but resolved", + "knownValues": [ + "active", + "broken", + "diverged", + "reconciled" + ] + } + } + }, "entry": { "type": "token", "description": "Collaboration scoped to a single entry." }, + "formerCollaboratorView": { + "type": "object", + "description": "Lightweight view for 'this person used to collaborate but doesn't anymore'.", + "required": [ + "user", + "wasActiveFrom", + "wasActiveUntil", + "endReason" + ], + "properties": { + "contributionCount": { + "type": "integer", + "description": "Number of diffs they created while active" + }, + "endReason": { + "type": "string", + "knownValues": [ + "voluntary_leave", + "invite_revoked", + "invite_expired", + "owner_deleted_resource" + ] + }, + "hasPublishedVersion": { + "type": "boolean" + }, + "publishedVersionUri": { + "type": "string", + "format": "at-uri" + }, + "user": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "wasActiveFrom": { + "type": "string", + "format": "datetime" + }, + "wasActiveUntil": { + "type": "string", + "format": "datetime" + } + } + }, + "inviteView": { + "type": "object", + "description": "Hydrated view of a collaboration invite with status.", + "required": [ + "uri", + "cid", + "inviter", + "invitee", + "resource", + "createdAt", + "status" + ], + "properties": { + "acceptUri": { + "type": "string", + "format": "at-uri" + }, + "acceptedAt": { + "type": "string", + "format": "datetime" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "expiresAt": { + "type": "string", + "format": "datetime" + }, + "invitee": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "inviter": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "message": { + "type": "string" + }, + "resource": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "resourceTitle": { + "type": "string" + }, + "scope": { + "type": "string", + "knownValues": [ + "notebook", + "entry", + "chapter" + ] + }, + "status": { + "type": "string", + "knownValues": [ + "pending", + "accepted", + "expired", + "revoked" + ] + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, "notebook": { "type": "token", "description": "Collaboration scoped to an entire notebook." + }, + "participantStateView": { + "type": "object", + "description": "Individual participant's state in a collaboration. Distinguishes 'was collaborator' vs 'never was'.", + "required": [ + "user", + "role", + "status" + ], + "properties": { + "acceptUri": { + "type": "string", + "description": "If they accepted (even if later broken)", + "format": "at-uri" + }, + "endReason": { + "type": "string", + "description": "Why the relationship ended, if applicable", + "knownValues": [ + "voluntary_leave", + "invite_revoked", + "invite_expired", + "owner_deleted_resource" + ] + }, + "firstEditAt": { + "type": "string", + "description": "When they first contributed", + "format": "datetime" + }, + "inviteUri": { + "type": "string", + "format": "at-uri" + }, + "lastEditAt": { + "type": "string", + "format": "datetime" + }, + "publishedVersion": { + "type": "ref", + "description": "Their published copy if any", + "ref": "com.atproto.repo.strongRef" + }, + "relationshipEndedAt": { + "type": "string", + "description": "When left/removed/expired", + "format": "datetime" + }, + "role": { + "type": "string", + "knownValues": [ + "owner", + "collaborator", + "former_collaborator" + ] + }, + "status": { + "type": "string", + "description": "active=can edit, invited=pending, left=voluntarily departed, removed=invite revoked, expired=invite timed out", + "knownValues": [ + "active", + "invited", + "left", + "removed", + "expired" + ] + }, + "user": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "wasCollaborator": { + "type": "boolean", + "description": "True if they ever had active collaboration status" + } + } + }, + "sessionView": { + "type": "object", + "description": "Active real-time collaboration session.", + "required": [ + "uri", + "user", + "resource", + "nodeId", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "expiresAt": { + "type": "string", + "format": "datetime" + }, + "nodeId": { + "type": "string" + }, + "relayUrl": { + "type": "string", + "format": "uri" + }, + "resource": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "user": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + } + } } } } \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_collab_getCollaborationState.json b/crates/weaver-api/lexicons/sh_weaver_collab_getCollaborationState.json new file mode 100644 index 0000000..fc4fc41 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_collab_getCollaborationState.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "sh.weaver.collab.getCollaborationState", + "defs": { + "main": { + "type": "query", + "description": "Get full collaboration state for a resource, including all participants and published versions.", + "parameters": { + "type": "params", + "required": [ + "resource" + ], + "properties": { + "resource": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "sh.weaver.collab.defs#collaborationStateView" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_collab_getInvites.json b/crates/weaver-api/lexicons/sh_weaver_collab_getInvites.json new file mode 100644 index 0000000..c725762 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_collab_getInvites.json @@ -0,0 +1,71 @@ +{ + "lexicon": 1, + "id": "sh.weaver.collab.getInvites", + "defs": { + "main": { + "type": "query", + "description": "Get collaboration invites for an actor (sent, received, or both).", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "direction": { + "type": "string", + "default": "all", + "knownValues": [ + "sent", + "received", + "all" + ] + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "status": { + "type": "string", + "default": "all", + "knownValues": [ + "pending", + "accepted", + "expired", + "all" + ] + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "invites" + ], + "properties": { + "cursor": { + "type": "string" + }, + "invites": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.collab.defs#inviteView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_collab_getResourceParticipants.json b/crates/weaver-api/lexicons/sh_weaver_collab_getResourceParticipants.json new file mode 100644 index 0000000..de2add6 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_collab_getResourceParticipants.json @@ -0,0 +1,48 @@ +{ + "lexicon": 1, + "id": "sh.weaver.collab.getResourceParticipants", + "defs": { + "main": { + "type": "query", + "description": "Get all participants (owner + collaborators) for a resource.", + "parameters": { + "type": "params", + "required": [ + "resource" + ], + "properties": { + "resource": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "owner", + "participants" + ], + "properties": { + "owner": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "participants": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + } + }, + "viewerCanEdit": { + "type": "boolean" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_collab_getResourceSessions.json b/crates/weaver-api/lexicons/sh_weaver_collab_getResourceSessions.json new file mode 100644 index 0000000..c5c0720 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_collab_getResourceSessions.json @@ -0,0 +1,40 @@ +{ + "lexicon": 1, + "id": "sh.weaver.collab.getResourceSessions", + "defs": { + "main": { + "type": "query", + "description": "Get active real-time collaboration sessions for a resource.", + "parameters": { + "type": "params", + "required": [ + "resource" + ], + "properties": { + "resource": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "sessions" + ], + "properties": { + "sessions": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.collab.defs#sessionView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_edit_defs.json b/crates/weaver-api/lexicons/sh_weaver_edit_defs.json index 7ef52e5..161f3a7 100644 --- a/crates/weaver-api/lexicons/sh_weaver_edit_defs.json +++ b/crates/weaver-api/lexicons/sh_weaver_edit_defs.json @@ -30,6 +30,133 @@ } } }, + "editBranchView": { + "type": "object", + "description": "A branch/fork in edit history (for when collaborators diverge).", + "required": [ + "head", + "author", + "length", + "lastUpdated" + ], + "properties": { + "author": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "divergesFrom": { + "type": "ref", + "description": "Common ancestor if this is a fork", + "ref": "com.atproto.repo.strongRef" + }, + "head": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "isMerged": { + "type": "boolean" + }, + "lastUpdated": { + "type": "string", + "format": "datetime" + }, + "length": { + "type": "integer", + "description": "Number of diffs in this branch" + }, + "root": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + }, + "editHistoryEntry": { + "type": "object", + "description": "Summary of an edit (root or diff) for history queries.", + "required": [ + "uri", + "cid", + "author", + "createdAt", + "type" + ], + "properties": { + "author": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "createdAt": { + "type": "string", + "format": "datetime" + }, + "hasInlineDiff": { + "type": "boolean" + }, + "prevRef": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "rootRef": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + }, + "snapshotCid": { + "type": "string", + "format": "cid" + }, + "type": { + "type": "string", + "knownValues": [ + "root", + "diff" + ] + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "editTreeView": { + "type": "object", + "description": "Full tree structure showing all branches for a resource.", + "required": [ + "resource", + "branches" + ], + "properties": { + "branches": { + "type": "array", + "items": { + "type": "ref", + "ref": "#editBranchView" + } + }, + "conflictPoints": { + "type": "array", + "description": "Diffs where branches diverge", + "items": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + }, + "hasConflicts": { + "type": "boolean" + }, + "mainBranch": { + "type": "ref", + "ref": "#editBranchView" + }, + "resource": { + "type": "ref", + "ref": "com.atproto.repo.strongRef" + } + } + }, "entryRef": { "type": "object", "required": [ diff --git a/crates/weaver-api/lexicons/sh_weaver_edit_getBranch.json b/crates/weaver-api/lexicons/sh_weaver_edit_getBranch.json new file mode 100644 index 0000000..4ef6ed0 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_edit_getBranch.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.getBranch", + "defs": { + "main": { + "type": "query", + "description": "Get edit history for a specific branch, identified by its head.", + "parameters": { + "type": "params", + "required": [ + "head" + ], + "properties": { + "afterRkey": { + "type": "string", + "description": "Only diffs after this rkey" + }, + "cursor": { + "type": "string" + }, + "head": { + "type": "string", + "description": "AT-URI of the branch head (latest diff)", + "format": "at-uri" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "branch", + "diffs" + ], + "properties": { + "branch": { + "type": "ref", + "ref": "sh.weaver.edit.defs#editBranchView" + }, + "cursor": { + "type": "string" + }, + "diffs": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.edit.defs#editHistoryEntry" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_edit_getEditHistory.json b/crates/weaver-api/lexicons/sh_weaver_edit_getEditHistory.json new file mode 100644 index 0000000..6b5f8eb --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_edit_getEditHistory.json @@ -0,0 +1,64 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.getEditHistory", + "defs": { + "main": { + "type": "query", + "description": "Get edit history (roots and diffs) for a resource.", + "parameters": { + "type": "params", + "required": [ + "resource" + ], + "properties": { + "afterRkey": { + "type": "string", + "description": "Only diffs after this rkey (incremental sync)" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "resource": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "roots", + "diffs" + ], + "properties": { + "cursor": { + "type": "string" + }, + "diffs": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.edit.defs#editHistoryEntry" + } + }, + "roots": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.edit.defs#editHistoryEntry" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_edit_getEditTree.json b/crates/weaver-api/lexicons/sh_weaver_edit_getEditTree.json new file mode 100644 index 0000000..9259a22 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_edit_getEditTree.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "sh.weaver.edit.getEditTree", + "defs": { + "main": { + "type": "query", + "description": "Get the edit tree structure showing all branches and forks.", + "parameters": { + "type": "params", + "required": [ + "resource" + ], + "properties": { + "resource": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "sh.weaver.edit.defs#editTreeView" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getActorBookmarks.json b/crates/weaver-api/lexicons/sh_weaver_graph_getActorBookmarks.json new file mode 100644 index 0000000..acfc54f --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getActorBookmarks.json @@ -0,0 +1,71 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getActorBookmarks", + "defs": { + "main": { + "type": "query", + "description": "Get resources an actor has bookmarked.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "bookmarks" + ], + "properties": { + "bookmarks": { + "type": "array", + "items": { + "type": "object", + "required": [ + "subject", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "note": { + "type": "string" + }, + "subject": { + "type": "union", + "refs": [ + "sh.weaver.notebook.defs#notebookView", + "sh.weaver.notebook.defs#entryView" + ] + } + } + } + }, + "cursor": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getActorLikes.json b/crates/weaver-api/lexicons/sh_weaver_graph_getActorLikes.json new file mode 100644 index 0000000..896d45f --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getActorLikes.json @@ -0,0 +1,68 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getActorLikes", + "defs": { + "main": { + "type": "query", + "description": "Get resources an actor has liked.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "likes" + ], + "properties": { + "cursor": { + "type": "string" + }, + "likes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "subject", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "subject": { + "type": "union", + "refs": [ + "sh.weaver.notebook.defs#notebookView", + "sh.weaver.notebook.defs#entryView" + ] + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getActorLists.json b/crates/weaver-api/lexicons/sh_weaver_graph_getActorLists.json new file mode 100644 index 0000000..bf2b162 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getActorLists.json @@ -0,0 +1,56 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getActorLists", + "defs": { + "main": { + "type": "query", + "description": "Get lists created by an actor.", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "purpose": { + "type": "string", + "description": "Filter by list purpose." + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "lists" + ], + "properties": { + "cursor": { + "type": "string" + }, + "lists": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.graph.defs#listView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getActorSubscriptions.json b/crates/weaver-api/lexicons/sh_weaver_graph_getActorSubscriptions.json new file mode 100644 index 0000000..4168e2b --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getActorSubscriptions.json @@ -0,0 +1,73 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getActorSubscriptions", + "defs": { + "main": { + "type": "query", + "description": "Get notebooks an actor is subscribed to (accepted subscriptions only).", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subscriptions" + ], + "properties": { + "cursor": { + "type": "string" + }, + "subscriptions": { + "type": "array", + "items": { + "type": "object", + "required": [ + "notebook", + "subscribedAt" + ], + "properties": { + "hasUpdates": { + "type": "boolean", + "description": "True if notebook has new content since last visit." + }, + "newEntryCount": { + "type": "integer", + "description": "Number of new entries since last visit." + }, + "notebook": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + }, + "subscribedAt": { + "type": "string", + "format": "datetime" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getBookmarkedBy.json b/crates/weaver-api/lexicons/sh_weaver_graph_getBookmarkedBy.json new file mode 100644 index 0000000..497b73f --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getBookmarkedBy.json @@ -0,0 +1,74 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getBookmarkedBy", + "defs": { + "main": { + "type": "query", + "description": "Get users who bookmarked a resource.", + "parameters": { + "type": "params", + "required": [ + "subject" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "subject": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uri", + "bookmarks" + ], + "properties": { + "bookmarks": { + "type": "array", + "items": { + "type": "object", + "required": [ + "actor", + "createdAt" + ], + "properties": { + "actor": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "createdAt": { + "type": "string", + "format": "datetime" + } + } + } + }, + "cid": { + "type": "string", + "format": "cid" + }, + "cursor": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getFollowers.json b/crates/weaver-api/lexicons/sh_weaver_graph_getFollowers.json new file mode 100644 index 0000000..d3a3143 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getFollowers.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getFollowers", + "defs": { + "main": { + "type": "query", + "description": "Get followers of an actor (accepted follows only).", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subject", + "followers" + ], + "properties": { + "cursor": { + "type": "string" + }, + "followers": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + } + }, + "subject": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getFollowing.json b/crates/weaver-api/lexicons/sh_weaver_graph_getFollowing.json new file mode 100644 index 0000000..9608d41 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getFollowing.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getFollowing", + "defs": { + "main": { + "type": "query", + "description": "Get actors that an actor follows (accepted follows only).", + "parameters": { + "type": "params", + "required": [ + "actor" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "subject", + "following" + ], + "properties": { + "cursor": { + "type": "string" + }, + "following": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + } + }, + "subject": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getLikedBy.json b/crates/weaver-api/lexicons/sh_weaver_graph_getLikedBy.json new file mode 100644 index 0000000..b8f2040 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getLikedBy.json @@ -0,0 +1,74 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getLikedBy", + "defs": { + "main": { + "type": "query", + "description": "Get users who liked a resource.", + "parameters": { + "type": "params", + "required": [ + "subject" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "subject": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "uri", + "likes" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "cursor": { + "type": "string" + }, + "likes": { + "type": "array", + "items": { + "type": "object", + "required": [ + "actor", + "createdAt" + ], + "properties": { + "actor": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "createdAt": { + "type": "string", + "format": "datetime" + } + } + } + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getList.json b/crates/weaver-api/lexicons/sh_weaver_graph_getList.json new file mode 100644 index 0000000..9cb0159 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getList.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getList", + "defs": { + "main": { + "type": "query", + "description": "Get a list with its items.", + "parameters": { + "type": "params", + "required": [ + "list" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "list": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "list", + "items" + ], + "properties": { + "cursor": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.graph.defs#listItemView" + } + }, + "list": { + "type": "ref", + "ref": "sh.weaver.graph.defs#listView" + } + } + } + }, + "errors": [ + { + "name": "ListNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getPopularTags.json b/crates/weaver-api/lexicons/sh_weaver_graph_getPopularTags.json new file mode 100644 index 0000000..89b27f0 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getPopularTags.json @@ -0,0 +1,45 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getPopularTags", + "defs": { + "main": { + "type": "query", + "description": "Get most-used tags overall.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "tags" + ], + "properties": { + "cursor": { + "type": "string" + }, + "tags": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.graph.defs#tagView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getResourceTags.json b/crates/weaver-api/lexicons/sh_weaver_graph_getResourceTags.json new file mode 100644 index 0000000..d4aebc2 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getResourceTags.json @@ -0,0 +1,29 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getResourceTags", + "defs": { + "main": { + "type": "query", + "description": "Get all tags for a resource (author + community), grouped by source.", + "parameters": { + "type": "params", + "required": [ + "resource" + ], + "properties": { + "resource": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "ref", + "ref": "sh.weaver.graph.defs#resourceTagsView" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getSubscribers.json b/crates/weaver-api/lexicons/sh_weaver_graph_getSubscribers.json new file mode 100644 index 0000000..9fe8c6e --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getSubscribers.json @@ -0,0 +1,57 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getSubscribers", + "defs": { + "main": { + "type": "query", + "description": "Get subscribers to a notebook (accepted subscriptions only).", + "parameters": { + "type": "params", + "required": [ + "notebook" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "notebook": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "notebook", + "subscribers" + ], + "properties": { + "cursor": { + "type": "string" + }, + "notebook": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + }, + "subscribers": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getTagSuggestions.json b/crates/weaver-api/lexicons/sh_weaver_graph_getTagSuggestions.json new file mode 100644 index 0000000..d462e20 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getTagSuggestions.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getTagSuggestions", + "defs": { + "main": { + "type": "query", + "description": "Get tag suggestions for autocomplete or based on existing tags.", + "parameters": { + "type": "params", + "properties": { + "existingTags": { + "type": "array", + "description": "Tags already on the resource, to suggest related tags.", + "items": { + "type": "string" + }, + "maxLength": 20 + }, + "limit": { + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 50 + }, + "query": { + "type": "string", + "description": "Partial tag for autocomplete.", + "maxLength": 128 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "suggestions" + ], + "properties": { + "suggestions": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.graph.defs#tagView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getTaggedResources.json b/crates/weaver-api/lexicons/sh_weaver_graph_getTaggedResources.json new file mode 100644 index 0000000..b8de52d --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getTaggedResources.json @@ -0,0 +1,87 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getTaggedResources", + "defs": { + "main": { + "type": "query", + "description": "Get notebooks and entries tagged with a specific tag.", + "parameters": { + "type": "params", + "required": [ + "tag" + ], + "properties": { + "cursor": { + "type": "string" + }, + "includeAuthorTags": { + "type": "boolean", + "description": "Include resources where author applied this tag.", + "default": true + }, + "includeCommunityTags": { + "type": "boolean", + "description": "Include resources where community applied this tag.", + "default": true + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "resourceType": { + "type": "string", + "default": "all", + "knownValues": [ + "notebook", + "entry", + "all" + ] + }, + "sort": { + "type": "string", + "default": "recent", + "knownValues": [ + "recent", + "popular" + ] + }, + "tag": { + "type": "string", + "minLength": 1, + "maxLength": 128 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "resources" + ], + "properties": { + "cursor": { + "type": "string" + }, + "resources": { + "type": "array", + "items": { + "type": "union", + "refs": [ + "sh.weaver.notebook.defs#notebookView", + "sh.weaver.notebook.defs#entryView" + ] + } + }, + "tag": { + "type": "ref", + "ref": "sh.weaver.graph.defs#tagView" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_getTrendingTags.json b/crates/weaver-api/lexicons/sh_weaver_graph_getTrendingTags.json new file mode 100644 index 0000000..42ef5e7 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_getTrendingTags.json @@ -0,0 +1,39 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.getTrendingTags", + "defs": { + "main": { + "type": "query", + "description": "Get trending tags based on recent usage.", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "tags" + ], + "properties": { + "tags": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.graph.defs#tagView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_graph_tag.json b/crates/weaver-api/lexicons/sh_weaver_graph_tag.json new file mode 100644 index 0000000..1176e41 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_graph_tag.json @@ -0,0 +1,36 @@ +{ + "lexicon": 1, + "id": "sh.weaver.graph.tag", + "defs": { + "main": { + "type": "record", + "description": "Apply a community tag to a notebook or entry. Can be created by readers, authors, or bots for categorization and discovery.", + "key": "tid", + "record": { + "type": "object", + "required": [ + "subject", + "tag", + "createdAt" + ], + "properties": { + "createdAt": { + "type": "string", + "format": "datetime" + }, + "subject": { + "type": "ref", + "description": "The notebook or entry being tagged.", + "ref": "com.atproto.repo.strongRef" + }, + "tag": { + "type": "string", + "description": "The tag value (e.g., 'enemies-to-lovers', 'slow-burn', 'found-family').", + "minLength": 1, + "maxLength": 128 + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_book.json b/crates/weaver-api/lexicons/sh_weaver_notebook_book.json index a79baf8..f9fb7df 100644 --- a/crates/weaver-api/lexicons/sh_weaver_notebook_book.json +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_book.json @@ -20,6 +20,10 @@ "ref": "sh.weaver.actor.defs#author" } }, + "contentWarnings": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#contentWarnings" + }, "createdAt": { "type": "string", "description": "Client-declared timestamp when this was originally created.", @@ -36,6 +40,14 @@ "type": "ref", "ref": "sh.weaver.notebook.defs#path" }, + "publishGlobal": { + "type": "boolean", + "description": "Notebook opts into accessiblity by path only without identity scoping. Path must be globally unique." + }, + "rating": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#contentRating" + }, "tags": { "type": "ref", "ref": "sh.weaver.notebook.defs#tags" diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_chapter.json b/crates/weaver-api/lexicons/sh_weaver_notebook_chapter.json index 7f38bc3..4e08d7a 100644 --- a/crates/weaver-api/lexicons/sh_weaver_notebook_chapter.json +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_chapter.json @@ -21,6 +21,10 @@ "ref": "sh.weaver.actor.defs#author" } }, + "contentWarnings": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#contentWarnings" + }, "createdAt": { "type": "string", "description": "Client-declared timestamp when this was originally created.", @@ -38,6 +42,10 @@ "description": "The notebook this chapter belongs to.", "ref": "com.atproto.repo.strongRef" }, + "rating": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#contentRating" + }, "tags": { "type": "ref", "ref": "sh.weaver.notebook.defs#tags" diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json b/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json index 6a76272..6088416 100644 --- a/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_defs.json @@ -59,6 +59,82 @@ } } }, + "chapterEntryView": { + "type": "object", + "description": "An entry within a chapter context.", + "required": [ + "entry", + "index" + ], + "properties": { + "entry": { + "type": "ref", + "ref": "#entryView" + }, + "index": { + "type": "integer" + }, + "next": { + "type": "ref", + "ref": "#bookEntryRef" + }, + "prev": { + "type": "ref", + "ref": "#bookEntryRef" + } + } + }, + "chapterView": { + "type": "object", + "description": "Hydrated view of a chapter.", + "required": [ + "uri", + "cid", + "notebook", + "authors", + "record", + "indexedAt" + ], + "properties": { + "authors": { + "type": "array", + "items": { + "type": "ref", + "ref": "#authorListView" + } + }, + "cid": { + "type": "string", + "format": "cid" + }, + "entryCount": { + "type": "integer" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "notebook": { + "type": "ref", + "ref": "#notebookView" + }, + "record": { + "type": "unknown" + }, + "tags": { + "type": "ref", + "ref": "#tags" + }, + "title": { + "type": "ref", + "ref": "#title" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, "contentFormat": { "type": "object", "description": "The format of the content. This is used to determine how to render the content.", @@ -76,6 +152,42 @@ } } }, + "contentRating": { + "type": "string", + "description": "Author-applied content rating.", + "knownValues": [ + "general", + "teen", + "mature", + "explicit" + ] + }, + "contentWarning": { + "type": "string", + "description": "Author-applied content warning.", + "knownValues": [ + "violence", + "graphic-violence", + "death", + "major-character-death", + "sexual-content", + "explicit-sexual-content", + "language", + "substance-use", + "self-harm", + "abuse", + "disturbing-imagery" + ] + }, + "contentWarnings": { + "type": "array", + "description": "Author-applied content warnings.", + "items": { + "type": "ref", + "ref": "#contentWarning" + }, + "maxLength": 10 + }, "entryView": { "type": "object", "required": [ @@ -93,6 +205,9 @@ "ref": "#authorListView" } }, + "bookmarkCount": { + "type": "integer" + }, "cid": { "type": "string", "format": "cid" @@ -101,6 +216,9 @@ "type": "string", "format": "datetime" }, + "likeCount": { + "type": "integer" + }, "path": { "type": "ref", "ref": "#path" @@ -127,9 +245,71 @@ "uri": { "type": "string", "format": "at-uri" + }, + "viewerBookmark": { + "type": "string", + "format": "at-uri" + }, + "viewerLike": { + "type": "string", + "format": "at-uri" + }, + "viewerReadingProgress": { + "type": "ref", + "ref": "#readingProgress" } } }, + "feedEntryView": { + "type": "object", + "description": "Entry with feed-specific context (discovery reason, notebook context).", + "required": [ + "entry" + ], + "properties": { + "entry": { + "type": "ref", + "ref": "#entryView" + }, + "notebookContext": { + "type": "ref", + "ref": "#feedNotebookContext" + }, + "reason": { + "type": "ref", + "ref": "#feedReason" + } + } + }, + "feedNotebookContext": { + "type": "object", + "description": "Minimal notebook context for feed display.", + "required": [ + "uri", + "title" + ], + "properties": { + "path": { + "type": "string" + }, + "title": { + "type": "string" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "feedReason": { + "type": "union", + "description": "Why this entry appeared in the feed.", + "refs": [ + "#reasonLike", + "#reasonBookmark", + "#reasonSubscription" + ] + }, "notebookView": { "type": "object", "required": [ @@ -147,14 +327,23 @@ "ref": "#authorListView" } }, + "bookmarkCount": { + "type": "integer" + }, "cid": { "type": "string", "format": "cid" }, + "entryCount": { + "type": "integer" + }, "indexedAt": { "type": "string", "format": "datetime" }, + "likeCount": { + "type": "integer" + }, "path": { "type": "ref", "ref": "#path" @@ -166,6 +355,68 @@ "record": { "type": "unknown" }, + "subscriberCount": { + "type": "integer" + }, + "tags": { + "type": "ref", + "ref": "#tags" + }, + "title": { + "type": "ref", + "ref": "#title" + }, + "uri": { + "type": "string", + "format": "at-uri" + }, + "viewerBookmark": { + "type": "string", + "format": "at-uri" + }, + "viewerLike": { + "type": "string", + "format": "at-uri" + }, + "viewerReadingProgress": { + "type": "ref", + "ref": "#readingProgress" + }, + "viewerSubscription": { + "type": "string", + "format": "at-uri" + } + } + }, + "pageView": { + "type": "object", + "description": "Hydrated view of a page (entries displayed together).", + "required": [ + "uri", + "cid", + "notebook", + "record", + "indexedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "entryCount": { + "type": "integer" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "notebook": { + "type": "ref", + "ref": "#notebookView" + }, + "record": { + "type": "unknown" + }, "tags": { "type": "ref", "ref": "#tags" @@ -244,6 +495,130 @@ } } }, + "publishedVersionView": { + "type": "object", + "description": "A published version of an entry in a collaborator's repo.", + "required": [ + "uri", + "cid", + "publisher", + "publishedAt" + ], + "properties": { + "cid": { + "type": "string", + "format": "cid" + }, + "divergedFrom": { + "type": "ref", + "description": "If content differs, the version it diverged from", + "ref": "com.atproto.repo.strongRef" + }, + "isCanonical": { + "type": "boolean", + "description": "True if this is the 'primary' version (owner's repo)" + }, + "publishedAt": { + "type": "string", + "format": "datetime" + }, + "publisher": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "readingProgress": { + "type": "object", + "description": "Viewer's reading progress (appview-side state, not a record).", + "properties": { + "currentEntry": { + "type": "string", + "description": "Last entry the viewer was reading.", + "format": "at-uri" + }, + "finishedAt": { + "type": "string", + "format": "datetime" + }, + "lastReadAt": { + "type": "string", + "format": "datetime" + }, + "percentComplete": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "startedAt": { + "type": "string", + "format": "datetime" + }, + "status": { + "type": "string", + "knownValues": [ + "reading", + "finished", + "abandoned", + "want-to-read" + ] + } + } + }, + "reasonBookmark": { + "type": "object", + "required": [ + "by", + "indexedAt" + ], + "properties": { + "by": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + } + } + }, + "reasonLike": { + "type": "object", + "required": [ + "by", + "indexedAt" + ], + "properties": { + "by": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + } + } + }, + "reasonSubscription": { + "type": "object", + "required": [ + "indexedAt" + ], + "properties": { + "indexedAt": { + "type": "string", + "format": "datetime" + } + } + }, "renderedView": { "type": "object", "description": "View of a rendered and cached notebook entry", diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_entry.json b/crates/weaver-api/lexicons/sh_weaver_notebook_entry.json index e0974e1..2a23fb1 100644 --- a/crates/weaver-api/lexicons/sh_weaver_notebook_entry.json +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_entry.json @@ -26,6 +26,10 @@ "type": "string", "description": "The content of the notebook entry. This should be some flavor of Markdown." }, + "contentWarnings": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#contentWarnings" + }, "createdAt": { "type": "string", "description": "Client-declared timestamp when this was originally created.", @@ -64,6 +68,10 @@ "type": "ref", "ref": "sh.weaver.notebook.defs#path" }, + "rating": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#contentRating" + }, "tags": { "type": "ref", "ref": "sh.weaver.notebook.defs#tags" diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getChapter.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getChapter.json new file mode 100644 index 0000000..0e7a1bc --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getChapter.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getChapter", + "defs": { + "main": { + "type": "query", + "description": "Get a chapter with its entries.", + "parameters": { + "type": "params", + "required": [ + "chapter" + ], + "properties": { + "chapter": { + "type": "string", + "format": "at-uri" + }, + "entryCursor": { + "type": "string" + }, + "entryLimit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "chapter", + "entries" + ], + "properties": { + "chapter": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#chapterView" + }, + "entries": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#chapterEntryView" + } + }, + "entryCursor": { + "type": "string" + } + } + } + }, + "errors": [ + { + "name": "ChapterNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getContinueReading.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getContinueReading.json new file mode 100644 index 0000000..8d20405 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getContinueReading.json @@ -0,0 +1,66 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getContinueReading", + "defs": { + "main": { + "type": "query", + "description": "Get notebooks the user is currently reading, sorted by most recent activity.", + "parameters": { + "type": "params", + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 20 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "items" + ], + "properties": { + "items": { + "type": "array", + "items": { + "type": "object", + "required": [ + "notebook", + "progress", + "nextEntry" + ], + "properties": { + "currentEntry": { + "type": "ref", + "description": "Where the user left off.", + "ref": "sh.weaver.notebook.defs#entryView" + }, + "entriesRemaining": { + "type": "integer" + }, + "nextEntry": { + "type": "ref", + "description": "The next entry to read (if any).", + "ref": "sh.weaver.notebook.defs#entryView" + }, + "notebook": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + }, + "progress": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#readingProgress" + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getEntryDetail.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getEntryDetail.json new file mode 100644 index 0000000..cf005c9 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getEntryDetail.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getEntryDetail", + "defs": { + "main": { + "type": "query", + "description": "Get an entry with its containing notebooks in a single call.", + "parameters": { + "type": "params", + "required": [ + "entry" + ], + "properties": { + "entry": { + "type": "string", + "format": "at-uri" + }, + "notebookContext": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "entry", + "record", + "notebookCount" + ], + "properties": { + "entry": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#entryView" + }, + "notebookCount": { + "type": "integer" + }, + "notebooks": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + }, + "maxLength": 10 + }, + "record": { + "type": "unknown" + } + } + } + }, + "errors": [ + { + "name": "EntryNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getEntryFeed.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getEntryFeed.json new file mode 100644 index 0000000..0f490cd --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getEntryFeed.json @@ -0,0 +1,65 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getEntryFeed", + "defs": { + "main": { + "type": "query", + "description": "Get a feed of entries with optional algorithm and tag filtering.", + "parameters": { + "type": "params", + "properties": { + "algorithm": { + "type": "string", + "default": "chronological", + "knownValues": [ + "chronological", + "popular" + ] + }, + "cursor": { + "type": "string" + }, + "feed": { + "type": "string", + "description": "Optional custom feed generator URI", + "format": "at-uri" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "maxLength": 10 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "feed" + ], + "properties": { + "cursor": { + "type": "string" + }, + "feed": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#feedEntryView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getNotebookChapters.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getNotebookChapters.json new file mode 100644 index 0000000..52c13d6 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getNotebookChapters.json @@ -0,0 +1,52 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getNotebookChapters", + "defs": { + "main": { + "type": "query", + "description": "Get all chapters for a notebook.", + "parameters": { + "type": "params", + "required": [ + "notebook" + ], + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "notebook": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "chapters" + ], + "properties": { + "chapters": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#chapterView" + } + }, + "cursor": { + "type": "string" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getNotebookDetail.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getNotebookDetail.json new file mode 100644 index 0000000..7f96495 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getNotebookDetail.json @@ -0,0 +1,62 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getNotebookDetail", + "defs": { + "main": { + "type": "query", + "description": "Get a notebook with its entries in a single call.", + "parameters": { + "type": "params", + "required": [ + "notebook" + ], + "properties": { + "entryCursor": { + "type": "string" + }, + "entryLimit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "notebook": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "notebook", + "entries" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#bookEntryView" + } + }, + "entryCursor": { + "type": "string" + }, + "notebook": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + } + } + } + }, + "errors": [ + { + "name": "NotebookNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getNotebookFeed.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getNotebookFeed.json new file mode 100644 index 0000000..73b2326 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getNotebookFeed.json @@ -0,0 +1,65 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getNotebookFeed", + "defs": { + "main": { + "type": "query", + "description": "Get a feed of notebooks with optional algorithm and tag filtering.", + "parameters": { + "type": "params", + "properties": { + "algorithm": { + "type": "string", + "default": "chronological", + "knownValues": [ + "chronological", + "popular" + ] + }, + "cursor": { + "type": "string" + }, + "feed": { + "type": "string", + "description": "Optional custom feed generator URI", + "format": "at-uri" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "maxLength": 10 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "notebooks" + ], + "properties": { + "cursor": { + "type": "string" + }, + "notebooks": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getPage.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getPage.json new file mode 100644 index 0000000..56162f2 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getPage.json @@ -0,0 +1,50 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getPage", + "defs": { + "main": { + "type": "query", + "description": "Get a page with its entries (all entries, since pages display together).", + "parameters": { + "type": "params", + "required": [ + "page" + ], + "properties": { + "page": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "page", + "entries" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#entryView" + } + }, + "page": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#pageView" + } + } + } + }, + "errors": [ + { + "name": "PageNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getPublishedVersions.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getPublishedVersions.json new file mode 100644 index 0000000..138d2bd --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getPublishedVersions.json @@ -0,0 +1,72 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getPublishedVersions", + "defs": { + "main": { + "type": "query", + "description": "Get all published versions of an entry (same rkey in collaborator repos).", + "parameters": { + "type": "params", + "required": [ + "entry" + ], + "properties": { + "entry": { + "type": "string", + "format": "at-uri" + }, + "includeContent": { + "type": "boolean", + "description": "Include full entry record in response", + "default": false + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "versions" + ], + "properties": { + "canonical": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#publishedVersionView" + }, + "hasDivergence": { + "type": "boolean" + }, + "records": { + "type": "array", + "description": "Full entry records if includeContent=true", + "items": { + "type": "object", + "required": [ + "uri", + "record" + ], + "properties": { + "record": { + "type": "unknown" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + } + }, + "versions": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#publishedVersionView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getReadingHistory.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getReadingHistory.json new file mode 100644 index 0000000..3e8d978 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getReadingHistory.json @@ -0,0 +1,79 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getReadingHistory", + "defs": { + "main": { + "type": "query", + "description": "Get the authenticated user's reading history.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "status": { + "type": "string", + "description": "Filter by reading status.", + "default": "all", + "knownValues": [ + "reading", + "finished", + "abandoned", + "want-to-read", + "all" + ] + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "history" + ], + "properties": { + "cursor": { + "type": "string" + }, + "history": { + "type": "array", + "items": { + "type": "ref", + "ref": "#readingHistoryItem" + } + } + } + } + } + }, + "readingHistoryItem": { + "type": "object", + "required": [ + "notebook", + "progress" + ], + "properties": { + "currentEntry": { + "type": "ref", + "description": "The entry the user was last reading.", + "ref": "sh.weaver.notebook.defs#entryView" + }, + "notebook": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + }, + "progress": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#readingProgress" + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_getSimilarNotebooks.json b/crates/weaver-api/lexicons/sh_weaver_notebook_getSimilarNotebooks.json new file mode 100644 index 0000000..6a0a8df --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_getSimilarNotebooks.json @@ -0,0 +1,66 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.getSimilarNotebooks", + "defs": { + "main": { + "type": "query", + "description": "Get notebooks similar to a given notebook (by tags, author, readers who also liked, etc).", + "parameters": { + "type": "params", + "required": [ + "notebook" + ], + "properties": { + "limit": { + "type": "integer", + "default": 10, + "minimum": 1, + "maximum": 50 + }, + "notebook": { + "type": "string", + "format": "at-uri" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "notebooks" + ], + "properties": { + "notebooks": { + "type": "array", + "items": { + "type": "object", + "required": [ + "notebook" + ], + "properties": { + "notebook": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + }, + "readersAlsoLiked": { + "type": "boolean" + }, + "sameAuthor": { + "type": "boolean" + }, + "sharedTags": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_resolveEntry.json b/crates/weaver-api/lexicons/sh_weaver_notebook_resolveEntry.json new file mode 100644 index 0000000..da1a9e6 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_resolveEntry.json @@ -0,0 +1,71 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.resolveEntry", + "defs": { + "main": { + "type": "query", + "description": "Resolve an entry by actor + notebook + entry title/path.", + "parameters": { + "type": "params", + "required": [ + "actor", + "notebook", + "entry" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "entry": { + "type": "string", + "maxLength": 300 + }, + "notebook": { + "type": "string", + "maxLength": 300 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "entry", + "record", + "notebookCount" + ], + "properties": { + "entry": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#entryView" + }, + "notebookCount": { + "type": "integer" + }, + "notebooks": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + }, + "maxLength": 10 + }, + "record": { + "type": "unknown" + } + } + } + }, + "errors": [ + { + "name": "NotebookNotFound" + }, + { + "name": "EntryNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_resolveNotebook.json b/crates/weaver-api/lexicons/sh_weaver_notebook_resolveNotebook.json new file mode 100644 index 0000000..4e29193 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_resolveNotebook.json @@ -0,0 +1,67 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.resolveNotebook", + "defs": { + "main": { + "type": "query", + "description": "Resolve a notebook by actor + title/path, returns full detail.", + "parameters": { + "type": "params", + "required": [ + "actor", + "name" + ], + "properties": { + "actor": { + "type": "string", + "format": "at-identifier" + }, + "entryCursor": { + "type": "string" + }, + "entryLimit": { + "type": "integer", + "default": 50, + "minimum": 1, + "maximum": 100 + }, + "name": { + "type": "string", + "maxLength": 300 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "notebook", + "entries" + ], + "properties": { + "entries": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#bookEntryView" + } + }, + "entryCursor": { + "type": "string" + }, + "notebook": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + } + } + } + }, + "errors": [ + { + "name": "NotebookNotFound" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_resolveVersionConflict.json b/crates/weaver-api/lexicons/sh_weaver_notebook_resolveVersionConflict.json new file mode 100644 index 0000000..0be61d9 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_resolveVersionConflict.json @@ -0,0 +1,60 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.resolveVersionConflict", + "defs": { + "main": { + "type": "query", + "description": "Given multiple URIs that might refer to the same collaborative entry, resolve to canonical version.", + "parameters": { + "type": "params", + "required": [ + "uris" + ], + "properties": { + "uris": { + "type": "array", + "items": { + "type": "string", + "format": "at-uri" + }, + "minLength": 1, + "maxLength": 20 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "canonical", + "related" + ], + "properties": { + "canonical": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#publishedVersionView" + }, + "collaborationState": { + "type": "ref", + "ref": "sh.weaver.collab.defs#collaborationStateView" + }, + "related": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#publishedVersionView" + } + } + } + } + }, + "errors": [ + { + "description": "The URIs don't appear to be related versions", + "name": "NoRelatedVersions" + } + ] + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_searchEntries.json b/crates/weaver-api/lexicons/sh_weaver_notebook_searchEntries.json new file mode 100644 index 0000000..dc3dac2 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_searchEntries.json @@ -0,0 +1,64 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.searchEntries", + "defs": { + "main": { + "type": "query", + "description": "Full-text search for entries with optional author and tag filtering.", + "parameters": { + "type": "params", + "required": [ + "q" + ], + "properties": { + "author": { + "type": "string", + "format": "at-identifier" + }, + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 25, + "minimum": 1, + "maximum": 100 + }, + "q": { + "type": "string", + "minLength": 1, + "maxLength": 500 + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "maxLength": 10 + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "entries" + ], + "properties": { + "cursor": { + "type": "string" + }, + "entries": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#entryView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notebook_updateReadingProgress.json b/crates/weaver-api/lexicons/sh_weaver_notebook_updateReadingProgress.json new file mode 100644 index 0000000..a1d91ed --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notebook_updateReadingProgress.json @@ -0,0 +1,59 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notebook.updateReadingProgress", + "defs": { + "main": { + "type": "procedure", + "description": "Update reading progress for a notebook (appview-side state).", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "notebook" + ], + "properties": { + "currentEntry": { + "type": "string", + "description": "The entry the user is currently on.", + "format": "at-uri" + }, + "notebook": { + "type": "string", + "format": "at-uri" + }, + "percentComplete": { + "type": "integer", + "minimum": 0, + "maximum": 100 + }, + "status": { + "type": "string", + "knownValues": [ + "reading", + "finished", + "abandoned", + "want-to-read" + ] + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "progress" + ], + "properties": { + "progress": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#readingProgress" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notification_defs.json b/crates/weaver-api/lexicons/sh_weaver_notification_defs.json new file mode 100644 index 0000000..f4e5c8e --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notification_defs.json @@ -0,0 +1,148 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notification.defs", + "defs": { + "notification": { + "type": "object", + "description": "A notification for a user.", + "required": [ + "uri", + "cid", + "author", + "reason", + "isRead", + "indexedAt" + ], + "properties": { + "author": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "cid": { + "type": "string", + "format": "cid" + }, + "indexedAt": { + "type": "string", + "format": "datetime" + }, + "isRead": { + "type": "boolean" + }, + "reason": { + "type": "ref", + "ref": "#notificationReason" + }, + "reasonSubject": { + "type": "string", + "description": "The subject of the notification (entry, notebook, etc).", + "format": "at-uri" + }, + "record": { + "type": "unknown" + }, + "uri": { + "type": "string", + "format": "at-uri" + } + } + }, + "notificationGroup": { + "type": "object", + "description": "Grouped notifications (e.g., '5 people liked your entry').", + "required": [ + "reason", + "subject", + "count", + "actors", + "mostRecentAt" + ], + "properties": { + "actors": { + "type": "array", + "description": "Most recent actors (up to 5).", + "items": { + "type": "ref", + "ref": "sh.weaver.actor.defs#profileViewBasic" + }, + "maxLength": 5 + }, + "count": { + "type": "integer" + }, + "isRead": { + "type": "boolean" + }, + "mostRecentAt": { + "type": "string", + "format": "datetime" + }, + "reason": { + "type": "ref", + "ref": "#notificationReason" + }, + "subject": { + "type": "union", + "refs": [ + "sh.weaver.notebook.defs#notebookView", + "sh.weaver.notebook.defs#entryView" + ] + } + } + }, + "notificationReason": { + "type": "string", + "description": "Why this notification was generated.", + "knownValues": [ + "like", + "bookmark", + "follow", + "followAccept", + "subscribe", + "subscribeAccept", + "collaborationInvite", + "collaborationAccept", + "newEntry", + "entryUpdate", + "mention", + "tag", + "comment" + ] + }, + "subscriptionUpdateView": { + "type": "object", + "description": "New content from a notebook subscription.", + "required": [ + "notebook", + "newEntries", + "updatedAt" + ], + "properties": { + "newEntries": { + "type": "array", + "description": "New entries since last check.", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#entryView" + } + }, + "notebook": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#notebookView" + }, + "updatedAt": { + "type": "string", + "format": "datetime" + }, + "updatedEntries": { + "type": "array", + "description": "Entries that were updated.", + "items": { + "type": "ref", + "ref": "sh.weaver.notebook.defs#entryView" + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notification_getSubscriptionUpdates.json b/crates/weaver-api/lexicons/sh_weaver_notification_getSubscriptionUpdates.json new file mode 100644 index 0000000..ff4ca70 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notification_getSubscriptionUpdates.json @@ -0,0 +1,50 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notification.getSubscriptionUpdates", + "defs": { + "main": { + "type": "query", + "description": "Get new/updated content from notebooks the user subscribes to.", + "parameters": { + "type": "params", + "properties": { + "cursor": { + "type": "string" + }, + "limit": { + "type": "integer", + "default": 20, + "minimum": 1, + "maximum": 50 + }, + "since": { + "type": "string", + "description": "Only show updates since this timestamp.", + "format": "datetime" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "updates" + ], + "properties": { + "cursor": { + "type": "string" + }, + "updates": { + "type": "array", + "items": { + "type": "ref", + "ref": "sh.weaver.notification.defs#subscriptionUpdateView" + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notification_getUnreadCount.json b/crates/weaver-api/lexicons/sh_weaver_notification_getUnreadCount.json new file mode 100644 index 0000000..14eae42 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notification_getUnreadCount.json @@ -0,0 +1,34 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notification.getUnreadCount", + "defs": { + "main": { + "type": "query", + "description": "Get count of unread notifications for the authenticated user.", + "parameters": { + "type": "params", + "properties": { + "seenAt": { + "type": "string", + "description": "Count notifications after this timestamp.", + "format": "datetime" + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "count" + ], + "properties": { + "count": { + "type": "integer" + } + } + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/lexicons/sh_weaver_notification_updateSeen.json b/crates/weaver-api/lexicons/sh_weaver_notification_updateSeen.json new file mode 100644 index 0000000..1dabe10 --- /dev/null +++ b/crates/weaver-api/lexicons/sh_weaver_notification_updateSeen.json @@ -0,0 +1,32 @@ +{ + "lexicon": 1, + "id": "sh.weaver.notification.updateSeen", + "defs": { + "main": { + "type": "procedure", + "description": "Mark notifications as seen up to a given timestamp.", + "input": { + "encoding": "application/json", + "schema": { + "type": "object", + "required": [ + "seenAt" + ], + "properties": { + "seenAt": { + "type": "string", + "format": "datetime" + } + } + } + }, + "output": { + "encoding": "application/json", + "schema": { + "type": "object", + "properties": {} + } + } + } + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/app_bsky/actor.rs b/crates/weaver-api/src/app_bsky/actor.rs index 50b2400..51730b7 100644 --- a/crates/weaver-api/src/app_bsky/actor.rs +++ b/crates/weaver-api/src/app_bsky/actor.rs @@ -4016,37 +4016,37 @@ pub mod nux_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; type Completed; + type Id; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; type Completed = Unset; - } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type Completed = S::Completed; + type Id = Unset; } ///State transition - sets the `completed` field to Set pub struct SetCompleted(PhantomData S>); impl sealed::Sealed for SetCompleted {} impl State for SetCompleted { - type Id = S::Id; type Completed = Set; + type Id = S::Id; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type Completed = S::Completed; + type Id = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `id` field - pub struct id(()); ///Marker type for the `completed` field pub struct completed(()); + ///Marker type for the `id` field + pub struct id(()); } } @@ -4156,8 +4156,8 @@ where impl<'a, S> NuxBuilder<'a, S> where S: nux_state::State, - S::Id: nux_state::IsSet, S::Completed: nux_state::IsSet, + S::Id: nux_state::IsSet, { /// Build the final struct pub fn build(self) -> Nux<'a> { @@ -4600,37 +4600,37 @@ pub mod profile_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Handle; type Did; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Handle = Unset; type Did = Unset; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type Handle = Set; - type Did = S::Did; + type Handle = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Handle = S::Handle; type Did = Set; + type Handle = S::Handle; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Did = S::Did; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -4955,8 +4955,8 @@ impl<'a, S: profile_view_state::State> ProfileViewBuilder<'a, S> { impl<'a, S> ProfileViewBuilder<'a, S> where S: profile_view_state::State, - S::Handle: profile_view_state::IsSet, S::Did: profile_view_state::IsSet, + S::Handle: profile_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ProfileView<'a> { @@ -5141,37 +5141,37 @@ pub mod profile_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Handle; type Did; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Handle = Unset; type Did = Unset; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type Handle = Set; - type Did = S::Did; + type Handle = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Handle = S::Handle; type Did = Set; + type Handle = S::Handle; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Did = S::Did; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -5454,8 +5454,8 @@ impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { impl<'a, S> ProfileViewBasicBuilder<'a, S> where S: profile_view_basic_state::State, - S::Handle: profile_view_basic_state::IsSet, S::Did: profile_view_basic_state::IsSet, + S::Handle: profile_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> ProfileViewBasic<'a> { @@ -6290,67 +6290,67 @@ pub mod saved_feed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Pinned; type Id; - type Type; type Value; - type Pinned; + type Type; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Pinned = Unset; type Id = Unset; - type Type = Unset; type Value = Unset; - type Pinned = Unset; + type Type = Unset; + } + ///State transition - sets the `pinned` field to Set + pub struct SetPinned(PhantomData S>); + impl sealed::Sealed for SetPinned {} + impl State for SetPinned { + type Pinned = Set; + type Id = S::Id; + type Value = S::Value; + type Type = S::Type; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type Id = Set; - type Type = S::Type; - type Value = S::Value; type Pinned = S::Pinned; - } - ///State transition - sets the `type` field to Set - pub struct SetType(PhantomData S>); - impl sealed::Sealed for SetType {} - impl State for SetType { - type Id = S::Id; - type Type = Set; + type Id = Set; type Value = S::Value; - type Pinned = S::Pinned; + type Type = S::Type; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { + type Pinned = S::Pinned; type Id = S::Id; - type Type = S::Type; type Value = Set; - type Pinned = S::Pinned; + type Type = S::Type; } - ///State transition - sets the `pinned` field to Set - pub struct SetPinned(PhantomData S>); - impl sealed::Sealed for SetPinned {} - impl State for SetPinned { + ///State transition - sets the `type` field to Set + pub struct SetType(PhantomData S>); + impl sealed::Sealed for SetType {} + impl State for SetType { + type Pinned = S::Pinned; type Id = S::Id; - type Type = S::Type; type Value = S::Value; - type Pinned = Set; + type Type = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `pinned` field + pub struct pinned(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `type` field - pub struct r#type(()); ///Marker type for the `value` field pub struct value(()); - ///Marker type for the `pinned` field - pub struct pinned(()); + ///Marker type for the `type` field + pub struct r#type(()); } } @@ -6463,10 +6463,10 @@ where impl<'a, S> SavedFeedBuilder<'a, S> where S: saved_feed_state::State, + S::Pinned: saved_feed_state::IsSet, S::Id: saved_feed_state::IsSet, - S::Type: saved_feed_state::IsSet, S::Value: saved_feed_state::IsSet, - S::Pinned: saved_feed_state::IsSet, + S::Type: saved_feed_state::IsSet, { /// Build the final struct pub fn build(self) -> SavedFeed<'a> { @@ -6543,37 +6543,37 @@ pub mod saved_feeds_pref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Saved; type Pinned; + type Saved; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Saved = Unset; type Pinned = Unset; - } - ///State transition - sets the `saved` field to Set - pub struct SetSaved(PhantomData S>); - impl sealed::Sealed for SetSaved {} - impl State for SetSaved { - type Saved = Set; - type Pinned = S::Pinned; + type Saved = Unset; } ///State transition - sets the `pinned` field to Set pub struct SetPinned(PhantomData S>); impl sealed::Sealed for SetPinned {} impl State for SetPinned { - type Saved = S::Saved; type Pinned = Set; + type Saved = S::Saved; + } + ///State transition - sets the `saved` field to Set + pub struct SetSaved(PhantomData S>); + impl sealed::Sealed for SetSaved {} + impl State for SetSaved { + type Pinned = S::Pinned; + type Saved = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `saved` field - pub struct saved(()); ///Marker type for the `pinned` field pub struct pinned(()); + ///Marker type for the `saved` field + pub struct saved(()); } } @@ -6660,8 +6660,8 @@ impl<'a, S: saved_feeds_pref_state::State> SavedFeedsPrefBuilder<'a, S> { impl<'a, S> SavedFeedsPrefBuilder<'a, S> where S: saved_feeds_pref_state::State, - S::Saved: saved_feeds_pref_state::IsSet, S::Pinned: saved_feeds_pref_state::IsSet, + S::Saved: saved_feeds_pref_state::IsSet, { /// Build the final struct pub fn build(self) -> SavedFeedsPref<'a> { @@ -7197,50 +7197,50 @@ pub mod verification_state_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Verifications; - type TrustedVerifierStatus; type VerifiedStatus; + type TrustedVerifierStatus; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Verifications = Unset; - type TrustedVerifierStatus = Unset; type VerifiedStatus = Unset; + type TrustedVerifierStatus = Unset; } ///State transition - sets the `verifications` field to Set pub struct SetVerifications(PhantomData S>); impl sealed::Sealed for SetVerifications {} impl State for SetVerifications { type Verifications = Set; - type TrustedVerifierStatus = S::TrustedVerifierStatus; - type VerifiedStatus = S::VerifiedStatus; - } - ///State transition - sets the `trusted_verifier_status` field to Set - pub struct SetTrustedVerifierStatus(PhantomData S>); - impl sealed::Sealed for SetTrustedVerifierStatus {} - impl State for SetTrustedVerifierStatus { - type Verifications = S::Verifications; - type TrustedVerifierStatus = Set; type VerifiedStatus = S::VerifiedStatus; + type TrustedVerifierStatus = S::TrustedVerifierStatus; } ///State transition - sets the `verified_status` field to Set pub struct SetVerifiedStatus(PhantomData S>); impl sealed::Sealed for SetVerifiedStatus {} impl State for SetVerifiedStatus { type Verifications = S::Verifications; - type TrustedVerifierStatus = S::TrustedVerifierStatus; type VerifiedStatus = Set; + type TrustedVerifierStatus = S::TrustedVerifierStatus; + } + ///State transition - sets the `trusted_verifier_status` field to Set + pub struct SetTrustedVerifierStatus(PhantomData S>); + impl sealed::Sealed for SetTrustedVerifierStatus {} + impl State for SetTrustedVerifierStatus { + type Verifications = S::Verifications; + type VerifiedStatus = S::VerifiedStatus; + type TrustedVerifierStatus = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `verifications` field pub struct verifications(()); - ///Marker type for the `trusted_verifier_status` field - pub struct trusted_verifier_status(()); ///Marker type for the `verified_status` field pub struct verified_status(()); + ///Marker type for the `trusted_verifier_status` field + pub struct trusted_verifier_status(()); } } @@ -7337,8 +7337,8 @@ impl<'a, S> VerificationStateBuilder<'a, S> where S: verification_state_state::State, S::Verifications: verification_state_state::IsSet, - S::TrustedVerifierStatus: verification_state_state::IsSet, S::VerifiedStatus: verification_state_state::IsSet, + S::TrustedVerifierStatus: verification_state_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationState<'a> { @@ -7420,8 +7420,8 @@ pub mod verification_view_state { pub trait State: sealed::Sealed { type CreatedAt; type Uri; - type Issuer; type IsValid; + type Issuer; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -7429,8 +7429,8 @@ pub mod verification_view_state { impl State for Empty { type CreatedAt = Unset; type Uri = Unset; - type Issuer = Unset; type IsValid = Unset; + type Issuer = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); @@ -7438,8 +7438,8 @@ pub mod verification_view_state { impl State for SetCreatedAt { type CreatedAt = Set; type Uri = S::Uri; - type Issuer = S::Issuer; type IsValid = S::IsValid; + type Issuer = S::Issuer; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); @@ -7447,17 +7447,8 @@ pub mod verification_view_state { impl State for SetUri { type CreatedAt = S::CreatedAt; type Uri = Set; - type Issuer = S::Issuer; - type IsValid = S::IsValid; - } - ///State transition - sets the `issuer` field to Set - pub struct SetIssuer(PhantomData S>); - impl sealed::Sealed for SetIssuer {} - impl State for SetIssuer { - type CreatedAt = S::CreatedAt; - type Uri = S::Uri; - type Issuer = Set; type IsValid = S::IsValid; + type Issuer = S::Issuer; } ///State transition - sets the `is_valid` field to Set pub struct SetIsValid(PhantomData S>); @@ -7465,8 +7456,17 @@ pub mod verification_view_state { impl State for SetIsValid { type CreatedAt = S::CreatedAt; type Uri = S::Uri; - type Issuer = S::Issuer; type IsValid = Set; + type Issuer = S::Issuer; + } + ///State transition - sets the `issuer` field to Set + pub struct SetIssuer(PhantomData S>); + impl sealed::Sealed for SetIssuer {} + impl State for SetIssuer { + type CreatedAt = S::CreatedAt; + type Uri = S::Uri; + type IsValid = S::IsValid; + type Issuer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -7475,10 +7475,10 @@ pub mod verification_view_state { pub struct created_at(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `issuer` field - pub struct issuer(()); ///Marker type for the `is_valid` field pub struct is_valid(()); + ///Marker type for the `issuer` field + pub struct issuer(()); } } @@ -7593,8 +7593,8 @@ where S: verification_view_state::State, S::CreatedAt: verification_view_state::IsSet, S::Uri: verification_view_state::IsSet, - S::Issuer: verification_view_state::IsSet, S::IsValid: verification_view_state::IsSet, + S::Issuer: verification_view_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationView<'a> { diff --git a/crates/weaver-api/src/app_bsky/actor/status.rs b/crates/weaver-api/src/app_bsky/actor/status.rs index 468ba6c..1d27df6 100644 --- a/crates/weaver-api/src/app_bsky/actor/status.rs +++ b/crates/weaver-api/src/app_bsky/actor/status.rs @@ -59,37 +59,37 @@ pub mod status_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Status; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Status = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Status = S::Status; + type CreatedAt = Unset; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type CreatedAt = S::CreatedAt; type Status = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Status = S::Status; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `status` field pub struct status(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -196,8 +196,8 @@ where impl<'a, S> StatusBuilder<'a, S> where S: status_state::State, - S::CreatedAt: status_state::IsSet, S::Status: status_state::IsSet, + S::CreatedAt: status_state::IsSet, { /// Build the final struct pub fn build(self) -> Status<'a> { diff --git a/crates/weaver-api/src/app_bsky/ageassurance.rs b/crates/weaver-api/src/app_bsky/ageassurance.rs index 77c56fe..f355b19 100644 --- a/crates/weaver-api/src/app_bsky/ageassurance.rs +++ b/crates/weaver-api/src/app_bsky/ageassurance.rs @@ -1500,37 +1500,37 @@ pub mod config_region_rule_if_account_newer_than_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Date; type Access; + type Date; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Date = Unset; type Access = Unset; - } - ///State transition - sets the `date` field to Set - pub struct SetDate(PhantomData S>); - impl sealed::Sealed for SetDate {} - impl State for SetDate { - type Date = Set; - type Access = S::Access; + type Date = Unset; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type Date = S::Date; type Access = Set; + type Date = S::Date; + } + ///State transition - sets the `date` field to Set + pub struct SetDate(PhantomData S>); + impl sealed::Sealed for SetDate {} + impl State for SetDate { + type Access = S::Access; + type Date = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `date` field - pub struct date(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `date` field + pub struct date(()); } } @@ -1620,8 +1620,8 @@ where impl<'a, S> ConfigRegionRuleIfAccountNewerThanBuilder<'a, S> where S: config_region_rule_if_account_newer_than_state::State, - S::Date: config_region_rule_if_account_newer_than_state::IsSet, S::Access: config_region_rule_if_account_newer_than_state::IsSet, + S::Date: config_region_rule_if_account_newer_than_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfAccountNewerThan<'a> { @@ -2082,37 +2082,37 @@ pub mod config_region_rule_if_assured_under_age_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Age; type Access; + type Age; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Age = Unset; type Access = Unset; - } - ///State transition - sets the `age` field to Set - pub struct SetAge(PhantomData S>); - impl sealed::Sealed for SetAge {} - impl State for SetAge { - type Age = Set; - type Access = S::Access; + type Age = Unset; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type Age = S::Age; type Access = Set; + type Age = S::Age; + } + ///State transition - sets the `age` field to Set + pub struct SetAge(PhantomData S>); + impl sealed::Sealed for SetAge {} + impl State for SetAge { + type Access = S::Access; + type Age = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `age` field - pub struct age(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `age` field + pub struct age(()); } } @@ -2202,8 +2202,8 @@ where impl<'a, S> ConfigRegionRuleIfAssuredUnderAgeBuilder<'a, S> where S: config_region_rule_if_assured_under_age_state::State, - S::Age: config_region_rule_if_assured_under_age_state::IsSet, S::Access: config_region_rule_if_assured_under_age_state::IsSet, + S::Age: config_region_rule_if_assured_under_age_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfAssuredUnderAge<'a> { @@ -2470,37 +2470,37 @@ pub mod config_region_rule_if_declared_under_age_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Access; type Age; + type Access; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Access = Unset; type Age = Unset; - } - ///State transition - sets the `access` field to Set - pub struct SetAccess(PhantomData S>); - impl sealed::Sealed for SetAccess {} - impl State for SetAccess { - type Access = Set; - type Age = S::Age; + type Access = Unset; } ///State transition - sets the `age` field to Set pub struct SetAge(PhantomData S>); impl sealed::Sealed for SetAge {} impl State for SetAge { - type Access = S::Access; type Age = Set; + type Access = S::Access; + } + ///State transition - sets the `access` field to Set + pub struct SetAccess(PhantomData S>); + impl sealed::Sealed for SetAccess {} + impl State for SetAccess { + type Age = S::Age; + type Access = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `access` field - pub struct access(()); ///Marker type for the `age` field pub struct age(()); + ///Marker type for the `access` field + pub struct access(()); } } @@ -2590,8 +2590,8 @@ where impl<'a, S> ConfigRegionRuleIfDeclaredUnderAgeBuilder<'a, S> where S: config_region_rule_if_declared_under_age_state::State, - S::Access: config_region_rule_if_declared_under_age_state::IsSet, S::Age: config_region_rule_if_declared_under_age_state::IsSet, + S::Access: config_region_rule_if_declared_under_age_state::IsSet, { /// Build the final struct pub fn build(self) -> ConfigRegionRuleIfDeclaredUnderAge<'a> { @@ -2698,85 +2698,85 @@ pub mod event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; + type Status; type Access; - type AttemptId; type CountryCode; - type Status; + type CreatedAt; + type AttemptId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; + type Status = Unset; type Access = Unset; - type AttemptId = Unset; type CountryCode = Unset; - type Status = Unset; + type CreatedAt = Unset; + type AttemptId = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type Status = Set; type Access = S::Access; - type AttemptId = S::AttemptId; type CountryCode = S::CountryCode; - type Status = S::Status; + type CreatedAt = S::CreatedAt; + type AttemptId = S::AttemptId; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type CreatedAt = S::CreatedAt; + type Status = S::Status; type Access = Set; - type AttemptId = S::AttemptId; type CountryCode = S::CountryCode; - type Status = S::Status; - } - ///State transition - sets the `attempt_id` field to Set - pub struct SetAttemptId(PhantomData S>); - impl sealed::Sealed for SetAttemptId {} - impl State for SetAttemptId { type CreatedAt = S::CreatedAt; - type Access = S::Access; - type AttemptId = Set; - type CountryCode = S::CountryCode; - type Status = S::Status; + type AttemptId = S::AttemptId; } ///State transition - sets the `country_code` field to Set pub struct SetCountryCode(PhantomData S>); impl sealed::Sealed for SetCountryCode {} impl State for SetCountryCode { - type CreatedAt = S::CreatedAt; + type Status = S::Status; type Access = S::Access; - type AttemptId = S::AttemptId; type CountryCode = Set; - type Status = S::Status; - } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { type CreatedAt = S::CreatedAt; + type AttemptId = S::AttemptId; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Status = S::Status; type Access = S::Access; + type CountryCode = S::CountryCode; + type CreatedAt = Set; type AttemptId = S::AttemptId; + } + ///State transition - sets the `attempt_id` field to Set + pub struct SetAttemptId(PhantomData S>); + impl sealed::Sealed for SetAttemptId {} + impl State for SetAttemptId { + type Status = S::Status; + type Access = S::Access; type CountryCode = S::CountryCode; - type Status = Set; + type CreatedAt = S::CreatedAt; + type AttemptId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); + ///Marker type for the `status` field + pub struct status(()); ///Marker type for the `access` field pub struct access(()); - ///Marker type for the `attempt_id` field - pub struct attempt_id(()); ///Marker type for the `country_code` field pub struct country_code(()); - ///Marker type for the `status` field - pub struct status(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `attempt_id` field + pub struct attempt_id(()); } } @@ -3032,11 +3032,11 @@ where impl<'a, S> EventBuilder<'a, S> where S: event_state::State, - S::CreatedAt: event_state::IsSet, + S::Status: event_state::IsSet, S::Access: event_state::IsSet, - S::AttemptId: event_state::IsSet, S::CountryCode: event_state::IsSet, - S::Status: event_state::IsSet, + S::CreatedAt: event_state::IsSet, + S::AttemptId: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { @@ -3129,37 +3129,37 @@ pub mod state_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Status; type Access; + type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Status = Unset; type Access = Unset; - } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { - type Status = Set; - type Access = S::Access; + type Status = Unset; } ///State transition - sets the `access` field to Set pub struct SetAccess(PhantomData S>); impl sealed::Sealed for SetAccess {} impl State for SetAccess { - type Status = S::Status; type Access = Set; + type Status = S::Status; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type Access = S::Access; + type Status = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `status` field - pub struct status(()); ///Marker type for the `access` field pub struct access(()); + ///Marker type for the `status` field + pub struct status(()); } } @@ -3252,8 +3252,8 @@ where impl<'a, S> StateBuilder<'a, S> where S: state_state::State, - S::Status: state_state::IsSet, S::Access: state_state::IsSet, + S::Status: state_state::IsSet, { /// Build the final struct pub fn build(self) -> State<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed.rs b/crates/weaver-api/src/app_bsky/embed.rs index 27ec288..edfa136 100644 --- a/crates/weaver-api/src/app_bsky/embed.rs +++ b/crates/weaver-api/src/app_bsky/embed.rs @@ -38,37 +38,37 @@ pub mod aspect_ratio_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Height; type Width; + type Height; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Height = Unset; type Width = Unset; - } - ///State transition - sets the `height` field to Set - pub struct SetHeight(PhantomData S>); - impl sealed::Sealed for SetHeight {} - impl State for SetHeight { - type Height = Set; - type Width = S::Width; + type Height = Unset; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData S>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type Height = S::Height; type Width = Set; + type Height = S::Height; + } + ///State transition - sets the `height` field to Set + pub struct SetHeight(PhantomData S>); + impl sealed::Sealed for SetHeight {} + impl State for SetHeight { + type Width = S::Width; + type Height = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `height` field - pub struct height(()); ///Marker type for the `width` field pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); } } @@ -138,8 +138,8 @@ where impl<'a, S> AspectRatioBuilder<'a, S> where S: aspect_ratio_state::State, - S::Height: aspect_ratio_state::IsSet, S::Width: aspect_ratio_state::IsSet, + S::Height: aspect_ratio_state::IsSet, { /// Build the final struct pub fn build(self) -> AspectRatio<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/external.rs b/crates/weaver-api/src/app_bsky/embed/external.rs index cea205e..0dc245f 100644 --- a/crates/weaver-api/src/app_bsky/embed/external.rs +++ b/crates/weaver-api/src/app_bsky/embed/external.rs @@ -38,51 +38,51 @@ pub mod external_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Title; type Description; type Uri; - type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Title = Unset; type Description = Unset; type Uri = Unset; - type Title = Unset; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Title = Set; + type Description = S::Description; + type Uri = S::Uri; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData S>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { + type Title = S::Title; type Description = Set; type Uri = S::Uri; - type Title = S::Title; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Description = S::Description; - type Uri = Set; type Title = S::Title; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { type Description = S::Description; - type Uri = S::Uri; - type Title = Set; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `title` field + pub struct title(()); ///Marker type for the `description` field pub struct description(()); ///Marker type for the `uri` field pub struct uri(()); - ///Marker type for the `title` field - pub struct title(()); } } @@ -195,9 +195,9 @@ where impl<'a, S> ExternalBuilder<'a, S> where S: external_state::State, + S::Title: external_state::IsSet, S::Description: external_state::IsSet, S::Uri: external_state::IsSet, - S::Title: external_state::IsSet, { /// Build the final struct pub fn build(self) -> External<'a> { @@ -784,51 +784,51 @@ pub mod view_external_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Description; type Uri; type Title; + type Description; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Description = Unset; type Uri = Unset; type Title = Unset; - } - ///State transition - sets the `description` field to Set - pub struct SetDescription(PhantomData S>); - impl sealed::Sealed for SetDescription {} - impl State for SetDescription { - type Description = Set; - type Uri = S::Uri; - type Title = S::Title; + type Description = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Description = S::Description; type Uri = Set; type Title = S::Title; + type Description = S::Description; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData S>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { - type Description = S::Description; type Uri = S::Uri; type Title = Set; + type Description = S::Description; + } + ///State transition - sets the `description` field to Set + pub struct SetDescription(PhantomData S>); + impl sealed::Sealed for SetDescription {} + impl State for SetDescription { + type Uri = S::Uri; + type Title = S::Title; + type Description = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `description` field - pub struct description(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `title` field pub struct title(()); + ///Marker type for the `description` field + pub struct description(()); } } @@ -941,9 +941,9 @@ where impl<'a, S> ViewExternalBuilder<'a, S> where S: view_external_state::State, - S::Description: view_external_state::IsSet, S::Uri: view_external_state::IsSet, S::Title: view_external_state::IsSet, + S::Description: view_external_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewExternal<'a> { diff --git a/crates/weaver-api/src/app_bsky/embed/images.rs b/crates/weaver-api/src/app_bsky/embed/images.rs index a9e20d5..091af05 100644 --- a/crates/weaver-api/src/app_bsky/embed/images.rs +++ b/crates/weaver-api/src/app_bsky/embed/images.rs @@ -37,37 +37,37 @@ pub mod image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Image; type Alt; + type Image; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Image = Unset; type Alt = Unset; - } - ///State transition - sets the `image` field to Set - pub struct SetImage(PhantomData S>); - impl sealed::Sealed for SetImage {} - impl State for SetImage { - type Image = Set; - type Alt = S::Alt; + type Image = Unset; } ///State transition - sets the `alt` field to Set pub struct SetAlt(PhantomData S>); impl sealed::Sealed for SetAlt {} impl State for SetAlt { - type Image = S::Image; type Alt = Set; + type Image = S::Image; + } + ///State transition - sets the `image` field to Set + pub struct SetImage(PhantomData S>); + impl sealed::Sealed for SetImage {} + impl State for SetImage { + type Alt = S::Alt; + type Image = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `image` field - pub struct image(()); ///Marker type for the `alt` field pub struct alt(()); + ///Marker type for the `image` field + pub struct image(()); } } @@ -160,8 +160,8 @@ where impl<'a, S> ImageBuilder<'a, S> where S: image_state::State, - S::Image: image_state::IsSet, S::Alt: image_state::IsSet, + S::Image: image_state::IsSet, { /// Build the final struct pub fn build(self) -> Image<'a> { @@ -760,49 +760,49 @@ pub mod view_image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Alt; type Fullsize; + type Alt; type Thumb; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Alt = Unset; type Fullsize = Unset; + type Alt = Unset; type Thumb = Unset; } - ///State transition - sets the `alt` field to Set - pub struct SetAlt(PhantomData S>); - impl sealed::Sealed for SetAlt {} - impl State for SetAlt { - type Alt = Set; - type Fullsize = S::Fullsize; - type Thumb = S::Thumb; - } ///State transition - sets the `fullsize` field to Set pub struct SetFullsize(PhantomData S>); impl sealed::Sealed for SetFullsize {} impl State for SetFullsize { - type Alt = S::Alt; type Fullsize = Set; + type Alt = S::Alt; + type Thumb = S::Thumb; + } + ///State transition - sets the `alt` field to Set + pub struct SetAlt(PhantomData S>); + impl sealed::Sealed for SetAlt {} + impl State for SetAlt { + type Fullsize = S::Fullsize; + type Alt = Set; type Thumb = S::Thumb; } ///State transition - sets the `thumb` field to Set pub struct SetThumb(PhantomData S>); impl sealed::Sealed for SetThumb {} impl State for SetThumb { - type Alt = S::Alt; type Fullsize = S::Fullsize; + type Alt = S::Alt; type Thumb = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `alt` field - pub struct alt(()); ///Marker type for the `fullsize` field pub struct fullsize(()); + ///Marker type for the `alt` field + pub struct alt(()); ///Marker type for the `thumb` field pub struct thumb(()); } @@ -917,8 +917,8 @@ where impl<'a, S> ViewImageBuilder<'a, S> where S: view_image_state::State, - S::Alt: view_image_state::IsSet, S::Fullsize: view_image_state::IsSet, + S::Alt: view_image_state::IsSet, S::Thumb: view_image_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/embed/record.rs b/crates/weaver-api/src/app_bsky/embed/record.rs index 2fcad3b..57ff086 100644 --- a/crates/weaver-api/src/app_bsky/embed/record.rs +++ b/crates/weaver-api/src/app_bsky/embed/record.rs @@ -723,51 +723,51 @@ pub mod view_blocked_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Author; type Uri; type Blocked; + type Author; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Author = Unset; type Uri = Unset; type Blocked = Unset; - } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { - type Author = Set; - type Uri = S::Uri; - type Blocked = S::Blocked; + type Author = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Author = S::Author; type Uri = Set; type Blocked = S::Blocked; + type Author = S::Author; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { - type Author = S::Author; type Uri = S::Uri; type Blocked = Set; + type Author = S::Author; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type Uri = S::Uri; + type Blocked = S::Blocked; + type Author = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `author` field - pub struct author(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `blocked` field pub struct blocked(()); + ///Marker type for the `author` field + pub struct author(()); } } @@ -860,9 +860,9 @@ where impl<'a, S> ViewBlockedBuilder<'a, S> where S: view_blocked_state::State, - S::Author: view_blocked_state::IsSet, S::Uri: view_blocked_state::IsSet, S::Blocked: view_blocked_state::IsSet, + S::Author: view_blocked_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewBlocked<'a> { @@ -934,37 +934,37 @@ pub mod view_detached_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Detached; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Detached = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Detached = S::Detached; + type Uri = Unset; } ///State transition - sets the `detached` field to Set pub struct SetDetached(PhantomData S>); impl sealed::Sealed for SetDetached {} impl State for SetDetached { - type Uri = S::Uri; type Detached = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Detached = S::Detached; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `detached` field pub struct detached(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1037,8 +1037,8 @@ where impl<'a, S> ViewDetachedBuilder<'a, S> where S: view_detached_state::State, - S::Uri: view_detached_state::IsSet, S::Detached: view_detached_state::IsSet, + S::Uri: view_detached_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewDetached<'a> { @@ -1303,83 +1303,83 @@ pub mod view_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Author; - type IndexedAt; type Cid; + type IndexedAt; + type Uri; type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Author = Unset; - type IndexedAt = Unset; type Cid = Unset; + type IndexedAt = Unset; + type Uri = Unset; type Value = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Author = S::Author; - type IndexedAt = S::IndexedAt; - type Cid = S::Cid; - type Value = S::Value; - } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Uri = S::Uri; type Author = Set; - type IndexedAt = S::IndexedAt; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Value = S::Value; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Author = S::Author; + type Cid = Set; + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Value = S::Value; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Uri = S::Uri; type Author = S::Author; - type IndexedAt = Set; type Cid = S::Cid; + type IndexedAt = Set; + type Uri = S::Uri; type Value = S::Value; } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Uri = S::Uri; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Author = S::Author; + type Cid = S::Cid; type IndexedAt = S::IndexedAt; - type Cid = Set; + type Uri = Set; type Value = S::Value; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Uri = S::Uri; type Author = S::Author; - type IndexedAt = S::IndexedAt; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `author` field pub struct author(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `value` field pub struct value(()); } @@ -1619,10 +1619,10 @@ where impl<'a, S> ViewRecordBuilder<'a, S> where S: view_record_state::State, - S::Uri: view_record_state::IsSet, S::Author: view_record_state::IsSet, - S::IndexedAt: view_record_state::IsSet, S::Cid: view_record_state::IsSet, + S::IndexedAt: view_record_state::IsSet, + S::Uri: view_record_state::IsSet, S::Value: view_record_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/embed/record_with_media.rs b/crates/weaver-api/src/app_bsky/embed/record_with_media.rs index edebb00..e90e597 100644 --- a/crates/weaver-api/src/app_bsky/embed/record_with_media.rs +++ b/crates/weaver-api/src/app_bsky/embed/record_with_media.rs @@ -33,37 +33,37 @@ pub mod record_with_media_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Media; type Record; + type Media; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Media = Unset; type Record = Unset; - } - ///State transition - sets the `media` field to Set - pub struct SetMedia(PhantomData S>); - impl sealed::Sealed for SetMedia {} - impl State for SetMedia { - type Media = Set; - type Record = S::Record; + type Media = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Media = S::Media; type Record = Set; + type Media = S::Media; + } + ///State transition - sets the `media` field to Set + pub struct SetMedia(PhantomData S>); + impl sealed::Sealed for SetMedia {} + impl State for SetMedia { + type Record = S::Record; + type Media = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `media` field - pub struct media(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `media` field + pub struct media(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> RecordWithMediaBuilder<'a, S> where S: record_with_media_state::State, - S::Media: record_with_media_state::IsSet, S::Record: record_with_media_state::IsSet, + S::Media: record_with_media_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordWithMedia<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed.rs b/crates/weaver-api/src/app_bsky/feed.rs index 7bea208..463cc06 100644 --- a/crates/weaver-api/src/app_bsky/feed.rs +++ b/crates/weaver-api/src/app_bsky/feed.rs @@ -1609,51 +1609,51 @@ pub mod blocked_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Blocked; type Author; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Blocked = Unset; type Author = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Blocked = S::Blocked; - type Author = S::Author; + type Uri = Unset; } ///State transition - sets the `blocked` field to Set pub struct SetBlocked(PhantomData S>); impl sealed::Sealed for SetBlocked {} impl State for SetBlocked { - type Uri = S::Uri; type Blocked = Set; type Author = S::Author; + type Uri = S::Uri; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Uri = S::Uri; type Blocked = S::Blocked; type Author = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Blocked = S::Blocked; + type Author = S::Author; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `blocked` field pub struct blocked(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1746,9 +1746,9 @@ where impl<'a, S> BlockedPostBuilder<'a, S> where S: blocked_post_state::State, - S::Uri: blocked_post_state::IsSet, S::Blocked: blocked_post_state::IsSet, S::Author: blocked_post_state::IsSet, + S::Uri: blocked_post_state::IsSet, { /// Build the final struct pub fn build(self) -> BlockedPost<'a> { @@ -2235,104 +2235,104 @@ pub mod generator_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Creator; - type Cid; - type Did; type DisplayName; type IndexedAt; type Uri; + type Did; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Creator = Unset; - type Cid = Unset; - type Did = Unset; type DisplayName = Unset; type IndexedAt = Unset; type Uri = Unset; + type Did = Unset; + type Cid = Unset; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { type Creator = Set; - type Cid = S::Cid; - type Did = S::Did; type DisplayName = S::DisplayName; type IndexedAt = S::IndexedAt; type Uri = S::Uri; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Creator = S::Creator; - type Cid = Set; type Did = S::Did; - type DisplayName = S::DisplayName; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Creator = S::Creator; type Cid = S::Cid; - type Did = Set; - type DisplayName = S::DisplayName; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { type Creator = S::Creator; - type Cid = S::Cid; - type Did = S::Did; type DisplayName = Set; type IndexedAt = S::IndexedAt; type Uri = S::Uri; + type Did = S::Did; + type Cid = S::Cid; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { type Creator = S::Creator; - type Cid = S::Cid; - type Did = S::Did; type DisplayName = S::DisplayName; type IndexedAt = Set; type Uri = S::Uri; + type Did = S::Did; + type Cid = S::Cid; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Creator = S::Creator; - type Cid = S::Cid; - type Did = S::Did; type DisplayName = S::DisplayName; type IndexedAt = S::IndexedAt; type Uri = Set; + type Did = S::Did; + type Cid = S::Cid; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Creator = S::Creator; + type DisplayName = S::DisplayName; + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Did = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Creator = S::Creator; + type DisplayName = S::DisplayName; + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Did = S::Did; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `creator` field pub struct creator(()); - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `display_name` field pub struct display_name(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -2649,11 +2649,11 @@ impl<'a, S> GeneratorViewBuilder<'a, S> where S: generator_view_state::State, S::Creator: generator_view_state::IsSet, - S::Cid: generator_view_state::IsSet, - S::Did: generator_view_state::IsSet, S::DisplayName: generator_view_state::IsSet, S::IndexedAt: generator_view_state::IsSet, S::Uri: generator_view_state::IsSet, + S::Did: generator_view_state::IsSet, + S::Cid: generator_view_state::IsSet, { /// Build the final struct pub fn build(self) -> GeneratorView<'a> { @@ -3207,83 +3207,83 @@ pub mod post_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Author; - type Record; type IndexedAt; + type Record; type Uri; + type Author; type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Author = Unset; - type Record = Unset; type IndexedAt = Unset; + type Record = Unset; type Uri = Unset; + type Author = Unset; type Cid = Unset; } - ///State transition - sets the `author` field to Set - pub struct SetAuthor(PhantomData S>); - impl sealed::Sealed for SetAuthor {} - impl State for SetAuthor { - type Author = Set; + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; type Record = S::Record; - type IndexedAt = S::IndexedAt; type Uri = S::Uri; + type Author = S::Author; type Cid = S::Cid; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Author = S::Author; - type Record = Set; type IndexedAt = S::IndexedAt; + type Record = Set; type Uri = S::Uri; - type Cid = S::Cid; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { type Author = S::Author; - type Record = S::Record; - type IndexedAt = Set; - type Uri = S::Uri; type Cid = S::Cid; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Author = S::Author; - type Record = S::Record; type IndexedAt = S::IndexedAt; + type Record = S::Record; type Uri = Set; + type Author = S::Author; + type Cid = S::Cid; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Uri = S::Uri; + type Author = Set; type Cid = S::Cid; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Author = S::Author; - type Record = S::Record; type IndexedAt = S::IndexedAt; + type Record = S::Record; type Uri = S::Uri; + type Author = S::Author; type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `author` field - pub struct author(()); - ///Marker type for the `record` field - pub struct record(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `record` field + pub struct record(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `author` field + pub struct author(()); ///Marker type for the `cid` field pub struct cid(()); } @@ -3598,10 +3598,10 @@ impl<'a, S: post_view_state::State> PostViewBuilder<'a, S> { impl<'a, S> PostViewBuilder<'a, S> where S: post_view_state::State, - S::Author: post_view_state::IsSet, - S::Record: post_view_state::IsSet, S::IndexedAt: post_view_state::IsSet, + S::Record: post_view_state::IsSet, S::Uri: post_view_state::IsSet, + S::Author: post_view_state::IsSet, S::Cid: post_view_state::IsSet, { /// Build the final struct @@ -3759,37 +3759,37 @@ pub mod reason_repost_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type IndexedAt; type By; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type IndexedAt = Unset; type By = Unset; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type IndexedAt = Set; - type By = S::By; + type IndexedAt = Unset; } ///State transition - sets the `by` field to Set pub struct SetBy(PhantomData S>); impl sealed::Sealed for SetBy {} impl State for SetBy { - type IndexedAt = S::IndexedAt; type By = Set; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type By = S::By; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `by` field pub struct by(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -3902,8 +3902,8 @@ impl<'a, S: reason_repost_state::State> ReasonRepostBuilder<'a, S> { impl<'a, S> ReasonRepostBuilder<'a, S> where S: reason_repost_state::State, - S::IndexedAt: reason_repost_state::IsSet, S::By: reason_repost_state::IsSet, + S::IndexedAt: reason_repost_state::IsSet, { /// Build the final struct pub fn build(self) -> ReasonRepost<'a> { @@ -3984,37 +3984,37 @@ pub mod reply_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Parent; type Root; + type Parent; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Parent = Unset; type Root = Unset; - } - ///State transition - sets the `parent` field to Set - pub struct SetParent(PhantomData S>); - impl sealed::Sealed for SetParent {} - impl State for SetParent { - type Parent = Set; - type Root = S::Root; + type Parent = Unset; } ///State transition - sets the `root` field to Set pub struct SetRoot(PhantomData S>); impl sealed::Sealed for SetRoot {} impl State for SetRoot { - type Parent = S::Parent; type Root = Set; + type Parent = S::Parent; + } + ///State transition - sets the `parent` field to Set + pub struct SetParent(PhantomData S>); + impl sealed::Sealed for SetParent {} + impl State for SetParent { + type Root = S::Root; + type Parent = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `parent` field - pub struct parent(()); ///Marker type for the `root` field pub struct root(()); + ///Marker type for the `parent` field + pub struct parent(()); } } @@ -4107,8 +4107,8 @@ where impl<'a, S> ReplyRefBuilder<'a, S> where S: reply_ref_state::State, - S::Parent: reply_ref_state::IsSet, S::Root: reply_ref_state::IsSet, + S::Parent: reply_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> ReplyRef<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/get_likes.rs b/crates/weaver-api/src/app_bsky/feed/get_likes.rs index d63c059..ddb9418 100644 --- a/crates/weaver-api/src/app_bsky/feed/get_likes.rs +++ b/crates/weaver-api/src/app_bsky/feed/get_likes.rs @@ -33,49 +33,49 @@ pub mod like_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Actor; type CreatedAt; + type Actor; type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Actor = Unset; type CreatedAt = Unset; + type Actor = Unset; type IndexedAt = Unset; } - ///State transition - sets the `actor` field to Set - pub struct SetActor(PhantomData S>); - impl sealed::Sealed for SetActor {} - impl State for SetActor { - type Actor = Set; - type CreatedAt = S::CreatedAt; - type IndexedAt = S::IndexedAt; - } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Actor = S::Actor; type CreatedAt = Set; + type Actor = S::Actor; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type CreatedAt = S::CreatedAt; + type Actor = Set; type IndexedAt = S::IndexedAt; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Actor = S::Actor; type CreatedAt = S::CreatedAt; + type Actor = S::Actor; type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `actor` field - pub struct actor(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `actor` field + pub struct actor(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); } @@ -170,8 +170,8 @@ where impl<'a, S> LikeBuilder<'a, S> where S: like_state::State, - S::Actor: like_state::IsSet, S::CreatedAt: like_state::IsSet, + S::Actor: like_state::IsSet, S::IndexedAt: like_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/feed/like.rs b/crates/weaver-api/src/app_bsky/feed/like.rs index 7d60480..29aa754 100644 --- a/crates/weaver-api/src/app_bsky/feed/like.rs +++ b/crates/weaver-api/src/app_bsky/feed/like.rs @@ -36,37 +36,37 @@ pub mod like_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type CreatedAt; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type CreatedAt = S::CreatedAt; + type Subject = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Subject = S::Subject; type CreatedAt = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type CreatedAt = S::CreatedAt; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -159,8 +159,8 @@ impl<'a, S: like_state::State> LikeBuilder<'a, S> { impl<'a, S> LikeBuilder<'a, S> where S: like_state::State, - S::Subject: like_state::IsSet, S::CreatedAt: like_state::IsSet, + S::Subject: like_state::IsSet, { /// Build the final struct pub fn build(self) -> Like<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/post.rs b/crates/weaver-api/src/app_bsky/feed/post.rs index c93d990..9caf070 100644 --- a/crates/weaver-api/src/app_bsky/feed/post.rs +++ b/crates/weaver-api/src/app_bsky/feed/post.rs @@ -38,50 +38,50 @@ pub mod entity_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Type; - type Value; type Index; + type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Type = Unset; - type Value = Unset; type Index = Unset; + type Value = Unset; } ///State transition - sets the `type` field to Set pub struct SetType(PhantomData S>); impl sealed::Sealed for SetType {} impl State for SetType { type Type = Set; - type Value = S::Value; - type Index = S::Index; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Type = S::Type; - type Value = Set; type Index = S::Index; + type Value = S::Value; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData S>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { type Type = S::Type; - type Value = S::Value; type Index = Set; + type Value = S::Value; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Type = S::Type; + type Index = S::Index; + type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `type` field pub struct r#type(()); - ///Marker type for the `value` field - pub struct value(()); ///Marker type for the `index` field pub struct index(()); + ///Marker type for the `value` field + pub struct value(()); } } @@ -175,8 +175,8 @@ impl<'a, S> EntityBuilder<'a, S> where S: entity_state::State, S::Type: entity_state::IsSet, - S::Value: entity_state::IsSet, S::Index: entity_state::IsSet, + S::Value: entity_state::IsSet, { /// Build the final struct pub fn build(self) -> Entity<'a> { @@ -622,37 +622,37 @@ pub mod post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Text; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Text = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Text = S::Text; + type CreatedAt = Unset; } ///State transition - sets the `text` field to Set pub struct SetText(PhantomData S>); impl sealed::Sealed for SetText {} impl State for SetText { - type CreatedAt = S::CreatedAt; type Text = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Text = S::Text; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `text` field pub struct text(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -869,8 +869,8 @@ where impl<'a, S> PostBuilder<'a, S> where S: post_state::State, - S::CreatedAt: post_state::IsSet, S::Text: post_state::IsSet, + S::CreatedAt: post_state::IsSet, { /// Build the final struct pub fn build(self) -> Post<'a> { @@ -1097,37 +1097,37 @@ pub mod reply_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Root; type Parent; + type Root; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Root = Unset; type Parent = Unset; - } - ///State transition - sets the `root` field to Set - pub struct SetRoot(PhantomData S>); - impl sealed::Sealed for SetRoot {} - impl State for SetRoot { - type Root = Set; - type Parent = S::Parent; + type Root = Unset; } ///State transition - sets the `parent` field to Set pub struct SetParent(PhantomData S>); impl sealed::Sealed for SetParent {} impl State for SetParent { - type Root = S::Root; type Parent = Set; + type Root = S::Root; + } + ///State transition - sets the `root` field to Set + pub struct SetRoot(PhantomData S>); + impl sealed::Sealed for SetRoot {} + impl State for SetRoot { + type Parent = S::Parent; + type Root = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `root` field - pub struct root(()); ///Marker type for the `parent` field pub struct parent(()); + ///Marker type for the `root` field + pub struct root(()); } } @@ -1200,8 +1200,8 @@ where impl<'a, S> ReplyRefBuilder<'a, S> where S: reply_ref_state::State, - S::Root: reply_ref_state::IsSet, S::Parent: reply_ref_state::IsSet, + S::Root: reply_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> ReplyRef<'a> { @@ -1271,37 +1271,37 @@ pub mod text_slice_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Start; type End; + type Start; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Start = Unset; type End = Unset; - } - ///State transition - sets the `start` field to Set - pub struct SetStart(PhantomData S>); - impl sealed::Sealed for SetStart {} - impl State for SetStart { - type Start = Set; - type End = S::End; + type Start = Unset; } ///State transition - sets the `end` field to Set pub struct SetEnd(PhantomData S>); impl sealed::Sealed for SetEnd {} impl State for SetEnd { - type Start = S::Start; type End = Set; + type Start = S::Start; + } + ///State transition - sets the `start` field to Set + pub struct SetStart(PhantomData S>); + impl sealed::Sealed for SetStart {} + impl State for SetStart { + type End = S::End; + type Start = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `start` field - pub struct start(()); ///Marker type for the `end` field pub struct end(()); + ///Marker type for the `start` field + pub struct start(()); } } @@ -1371,8 +1371,8 @@ where impl<'a, S> TextSliceBuilder<'a, S> where S: text_slice_state::State, - S::Start: text_slice_state::IsSet, S::End: text_slice_state::IsSet, + S::Start: text_slice_state::IsSet, { /// Build the final struct pub fn build(self) -> TextSlice<'a> { diff --git a/crates/weaver-api/src/app_bsky/feed/repost.rs b/crates/weaver-api/src/app_bsky/feed/repost.rs index 3c88b6b..bd94244 100644 --- a/crates/weaver-api/src/app_bsky/feed/repost.rs +++ b/crates/weaver-api/src/app_bsky/feed/repost.rs @@ -36,37 +36,37 @@ pub mod repost_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type CreatedAt; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type CreatedAt = S::CreatedAt; + type Subject = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Subject = S::Subject; type CreatedAt = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type CreatedAt = S::CreatedAt; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -159,8 +159,8 @@ impl<'a, S: repost_state::State> RepostBuilder<'a, S> { impl<'a, S> RepostBuilder<'a, S> where S: repost_state::State, - S::Subject: repost_state::IsSet, S::CreatedAt: repost_state::IsSet, + S::Subject: repost_state::IsSet, { /// Build the final struct pub fn build(self) -> Repost<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph.rs b/crates/weaver-api/src/app_bsky/graph.rs index 317509f..6ad5f4e 100644 --- a/crates/weaver-api/src/app_bsky/graph.rs +++ b/crates/weaver-api/src/app_bsky/graph.rs @@ -82,37 +82,37 @@ pub mod list_item_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type Uri; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type Uri = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type Uri = S::Uri; + type Subject = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Subject = S::Subject; type Uri = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Uri = S::Uri; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -185,8 +185,8 @@ where impl<'a, S> ListItemViewBuilder<'a, S> where S: list_item_view_state::State, - S::Subject: list_item_view_state::IsSet, S::Uri: list_item_view_state::IsSet, + S::Subject: list_item_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListItemView<'a> { @@ -1278,104 +1278,104 @@ pub mod list_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Cid; - type Purpose; - type IndexedAt; + type Creator; type Uri; + type Purpose; type Name; - type Creator; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Cid = Unset; - type Purpose = Unset; - type IndexedAt = Unset; + type Creator = Unset; type Uri = Unset; + type Purpose = Unset; type Name = Unset; - type Creator = Unset; + type IndexedAt = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { type Cid = Set; - type Purpose = S::Purpose; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - type Name = S::Name; type Creator = S::Creator; - } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData S>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { - type Cid = S::Cid; - type Purpose = Set; - type IndexedAt = S::IndexedAt; type Uri = S::Uri; + type Purpose = S::Purpose; type Name = S::Name; - type Creator = S::Creator; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData S>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { type Cid = S::Cid; - type Purpose = S::Purpose; - type IndexedAt = Set; + type Creator = Set; type Uri = S::Uri; + type Purpose = S::Purpose; type Name = S::Name; - type Creator = S::Creator; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { type Cid = S::Cid; - type Purpose = S::Purpose; - type IndexedAt = S::IndexedAt; + type Creator = S::Creator; type Uri = Set; + type Purpose = S::Purpose; type Name = S::Name; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Cid = S::Cid; type Creator = S::Creator; + type Uri = S::Uri; + type Purpose = Set; + type Name = S::Name; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { type Cid = S::Cid; - type Purpose = S::Purpose; - type IndexedAt = S::IndexedAt; + type Creator = S::Creator; type Uri = S::Uri; + type Purpose = S::Purpose; type Name = Set; - type Creator = S::Creator; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData S>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { type Cid = S::Cid; - type Purpose = S::Purpose; - type IndexedAt = S::IndexedAt; + type Creator = S::Creator; type Uri = S::Uri; + type Purpose = S::Purpose; type Name = S::Name; - type Creator = Set; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `purpose` field - pub struct purpose(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `creator` field + pub struct creator(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `purpose` field + pub struct purpose(()); ///Marker type for the `name` field pub struct name(()); - ///Marker type for the `creator` field - pub struct creator(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -1656,11 +1656,11 @@ impl<'a, S> ListViewBuilder<'a, S> where S: list_view_state::State, S::Cid: list_view_state::IsSet, - S::Purpose: list_view_state::IsSet, - S::IndexedAt: list_view_state::IsSet, + S::Creator: list_view_state::IsSet, S::Uri: list_view_state::IsSet, + S::Purpose: list_view_state::IsSet, S::Name: list_view_state::IsSet, - S::Creator: list_view_state::IsSet, + S::IndexedAt: list_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ListView<'a> { @@ -1835,67 +1835,67 @@ pub mod list_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Purpose; - type Name; - type Cid; type Uri; + type Cid; + type Name; + type Purpose; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Purpose = Unset; - type Name = Unset; - type Cid = Unset; type Uri = Unset; + type Cid = Unset; + type Name = Unset; + type Purpose = Unset; } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData S>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { - type Purpose = Set; - type Name = S::Name; + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; type Cid = S::Cid; - type Uri = S::Uri; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { + type Name = S::Name; type Purpose = S::Purpose; - type Name = Set; - type Cid = S::Cid; - type Uri = S::Uri; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Purpose = S::Purpose; - type Name = S::Name; - type Cid = Set; type Uri = S::Uri; + type Cid = Set; + type Name = S::Name; + type Purpose = S::Purpose; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Uri = S::Uri; + type Cid = S::Cid; + type Name = Set; type Purpose = S::Purpose; - type Name = S::Name; + } + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Uri = S::Uri; type Cid = S::Cid; - type Uri = Set; + type Name = S::Name; + type Purpose = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `purpose` field - pub struct purpose(()); - ///Marker type for the `name` field - pub struct name(()); - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `purpose` field + pub struct purpose(()); } } @@ -2112,10 +2112,10 @@ impl<'a, S: list_view_basic_state::State> ListViewBasicBuilder<'a, S> { impl<'a, S> ListViewBasicBuilder<'a, S> where S: list_view_basic_state::State, - S::Purpose: list_view_basic_state::IsSet, - S::Name: list_view_basic_state::IsSet, - S::Cid: list_view_basic_state::IsSet, S::Uri: list_view_basic_state::IsSet, + S::Cid: list_view_basic_state::IsSet, + S::Name: list_view_basic_state::IsSet, + S::Purpose: list_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> ListViewBasic<'a> { @@ -2699,85 +2699,85 @@ pub mod starter_pack_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Creator; - type Cid; + type Record; type Uri; type IndexedAt; - type Record; + type Creator; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Creator = Unset; - type Cid = Unset; + type Record = Unset; type Uri = Unset; type IndexedAt = Unset; - type Record = Unset; + type Creator = Unset; + type Cid = Unset; } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData S>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { - type Creator = Set; - type Cid = S::Cid; + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Record = Set; type Uri = S::Uri; type IndexedAt = S::IndexedAt; - type Record = S::Record; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { type Creator = S::Creator; - type Cid = Set; - type Uri = S::Uri; - type IndexedAt = S::IndexedAt; - type Record = S::Record; + type Cid = S::Cid; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Creator = S::Creator; - type Cid = S::Cid; + type Record = S::Record; type Uri = Set; type IndexedAt = S::IndexedAt; - type Record = S::Record; + type Creator = S::Creator; + type Cid = S::Cid; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Creator = S::Creator; - type Cid = S::Cid; + type Record = S::Record; type Uri = S::Uri; type IndexedAt = Set; - type Record = S::Record; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { type Creator = S::Creator; type Cid = S::Cid; + } + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData S>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Record = S::Record; type Uri = S::Uri; type IndexedAt = S::IndexedAt; - type Record = Set; + type Creator = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Record = S::Record; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Creator = S::Creator; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `creator` field - pub struct creator(()); - ///Marker type for the `cid` field - pub struct cid(()); + ///Marker type for the `record` field + pub struct record(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `record` field - pub struct record(()); + ///Marker type for the `creator` field + pub struct creator(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -3030,11 +3030,11 @@ where impl<'a, S> StarterPackViewBuilder<'a, S> where S: starter_pack_view_state::State, - S::Creator: starter_pack_view_state::IsSet, - S::Cid: starter_pack_view_state::IsSet, + S::Record: starter_pack_view_state::IsSet, S::Uri: starter_pack_view_state::IsSet, S::IndexedAt: starter_pack_view_state::IsSet, - S::Record: starter_pack_view_state::IsSet, + S::Creator: starter_pack_view_state::IsSet, + S::Cid: starter_pack_view_state::IsSet, { /// Build the final struct pub fn build(self) -> StarterPackView<'a> { @@ -3183,85 +3183,85 @@ pub mod starter_pack_view_basic_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; - type IndexedAt; type Creator; - type Record; + type Uri; type Cid; + type Record; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; - type IndexedAt = Unset; type Creator = Unset; - type Record = Unset; + type Uri = Unset; type Cid = Unset; + type Record = Unset; + type IndexedAt = Unset; + } + ///State transition - sets the `creator` field to Set + pub struct SetCreator(PhantomData S>); + impl sealed::Sealed for SetCreator {} + impl State for SetCreator { + type Creator = Set; + type Uri = S::Uri; + type Cid = S::Cid; + type Record = S::Record; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Uri = Set; - type IndexedAt = S::IndexedAt; type Creator = S::Creator; - type Record = S::Record; + type Uri = Set; type Cid = S::Cid; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Uri = S::Uri; - type IndexedAt = Set; - type Creator = S::Creator; type Record = S::Record; - type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `creator` field to Set - pub struct SetCreator(PhantomData S>); - impl sealed::Sealed for SetCreator {} - impl State for SetCreator { + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Creator = S::Creator; type Uri = S::Uri; - type IndexedAt = S::IndexedAt; - type Creator = Set; + type Cid = Set; type Record = S::Record; - type Cid = S::Cid; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Uri = S::Uri; - type IndexedAt = S::IndexedAt; type Creator = S::Creator; - type Record = Set; - type Cid = S::Cid; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { type Uri = S::Uri; + type Cid = S::Cid; + type Record = Set; type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { type Creator = S::Creator; + type Uri = S::Uri; + type Cid = S::Cid; type Record = S::Record; - type Cid = Set; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `creator` field pub struct creator(()); - ///Marker type for the `record` field - pub struct record(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -3472,11 +3472,11 @@ where impl<'a, S> StarterPackViewBasicBuilder<'a, S> where S: starter_pack_view_basic_state::State, - S::Uri: starter_pack_view_basic_state::IsSet, - S::IndexedAt: starter_pack_view_basic_state::IsSet, S::Creator: starter_pack_view_basic_state::IsSet, - S::Record: starter_pack_view_basic_state::IsSet, + S::Uri: starter_pack_view_basic_state::IsSet, S::Cid: starter_pack_view_basic_state::IsSet, + S::Record: starter_pack_view_basic_state::IsSet, + S::IndexedAt: starter_pack_view_basic_state::IsSet, { /// Build the final struct pub fn build(self) -> StarterPackViewBasic<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/listblock.rs b/crates/weaver-api/src/app_bsky/graph/listblock.rs index b81e93c..9e2bb50 100644 --- a/crates/weaver-api/src/app_bsky/graph/listblock.rs +++ b/crates/weaver-api/src/app_bsky/graph/listblock.rs @@ -34,37 +34,37 @@ pub mod listblock_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = S::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = S::CreatedAt; type Subject = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> ListblockBuilder<'a, S> where S: listblock_state::State, - S::CreatedAt: listblock_state::IsSet, S::Subject: listblock_state::IsSet, + S::CreatedAt: listblock_state::IsSet, { /// Build the final struct pub fn build(self) -> Listblock<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/starterpack.rs b/crates/weaver-api/src/app_bsky/graph/starterpack.rs index 3f6999a..da639ff 100644 --- a/crates/weaver-api/src/app_bsky/graph/starterpack.rs +++ b/crates/weaver-api/src/app_bsky/graph/starterpack.rs @@ -366,51 +366,51 @@ pub mod starterpack_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Name; type List; type CreatedAt; - type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Name = Unset; type List = Unset; type CreatedAt = Unset; - type Name = Unset; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Name = Set; + type List = S::List; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData S>); impl sealed::Sealed for SetList {} impl State for SetList { + type Name = S::Name; type List = Set; type CreatedAt = S::CreatedAt; - type Name = S::Name; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type List = S::List; - type CreatedAt = Set; type Name = S::Name; - } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { type List = S::List; - type CreatedAt = S::CreatedAt; - type Name = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `name` field + pub struct name(()); ///Marker type for the `list` field pub struct list(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `name` field - pub struct name(()); } } @@ -563,9 +563,9 @@ where impl<'a, S> StarterpackBuilder<'a, S> where S: starterpack_state::State, + S::Name: starterpack_state::IsSet, S::List: starterpack_state::IsSet, S::CreatedAt: starterpack_state::IsSet, - S::Name: starterpack_state::IsSet, { /// Build the final struct pub fn build(self) -> Starterpack<'a> { diff --git a/crates/weaver-api/src/app_bsky/graph/verification.rs b/crates/weaver-api/src/app_bsky/graph/verification.rs index bb8adf1..6247ebd 100644 --- a/crates/weaver-api/src/app_bsky/graph/verification.rs +++ b/crates/weaver-api/src/app_bsky/graph/verification.rs @@ -41,65 +41,65 @@ pub mod verification_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; - type Handle; type CreatedAt; + type Handle; + type Subject; type DisplayName; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; - type Handle = Unset; type CreatedAt = Unset; + type Handle = Unset; + type Subject = Unset; type DisplayName = Unset; } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; type Handle = S::Handle; - type CreatedAt = S::CreatedAt; + type Subject = S::Subject; type DisplayName = S::DisplayName; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Subject = S::Subject; - type Handle = Set; type CreatedAt = S::CreatedAt; + type Handle = Set; + type Subject = S::Subject; type DisplayName = S::DisplayName; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Subject = S::Subject; + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type CreatedAt = S::CreatedAt; type Handle = S::Handle; - type CreatedAt = Set; + type Subject = Set; type DisplayName = S::DisplayName; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Subject = S::Subject; - type Handle = S::Handle; type CreatedAt = S::CreatedAt; + type Handle = S::Handle; + type Subject = S::Subject; type DisplayName = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `handle` field + pub struct handle(()); + ///Marker type for the `subject` field + pub struct subject(()); ///Marker type for the `display_name` field pub struct display_name(()); } @@ -214,9 +214,9 @@ where impl<'a, S> VerificationBuilder<'a, S> where S: verification_state::State, - S::Subject: verification_state::IsSet, - S::Handle: verification_state::IsSet, S::CreatedAt: verification_state::IsSet, + S::Handle: verification_state::IsSet, + S::Subject: verification_state::IsSet, S::DisplayName: verification_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/labeler.rs b/crates/weaver-api/src/app_bsky/labeler.rs index 482b861..f6f0d72 100644 --- a/crates/weaver-api/src/app_bsky/labeler.rs +++ b/crates/weaver-api/src/app_bsky/labeler.rs @@ -632,8 +632,8 @@ pub mod labeler_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type IndexedAt; type Uri; + type IndexedAt; type Creator; type Cid; } @@ -641,26 +641,26 @@ pub mod labeler_view_state { pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type IndexedAt = Unset; type Uri = Unset; + type IndexedAt = Unset; type Creator = Unset; type Cid = Unset; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type IndexedAt = Set; - type Uri = S::Uri; - type Creator = S::Creator; - type Cid = S::Cid; - } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type IndexedAt = S::IndexedAt; type Uri = Set; + type IndexedAt = S::IndexedAt; + type Creator = S::Creator; + type Cid = S::Cid; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Uri = S::Uri; + type IndexedAt = Set; type Creator = S::Creator; type Cid = S::Cid; } @@ -668,8 +668,8 @@ pub mod labeler_view_state { pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { - type IndexedAt = S::IndexedAt; type Uri = S::Uri; + type IndexedAt = S::IndexedAt; type Creator = Set; type Cid = S::Cid; } @@ -677,18 +677,18 @@ pub mod labeler_view_state { pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type IndexedAt = S::IndexedAt; type Uri = S::Uri; + type IndexedAt = S::IndexedAt; type Creator = S::Creator; type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `creator` field pub struct creator(()); ///Marker type for the `cid` field @@ -859,8 +859,8 @@ impl<'a, S: labeler_view_state::State> LabelerViewBuilder<'a, S> { impl<'a, S> LabelerViewBuilder<'a, S> where S: labeler_view_state::State, - S::IndexedAt: labeler_view_state::IsSet, S::Uri: labeler_view_state::IsSet, + S::IndexedAt: labeler_view_state::IsSet, S::Creator: labeler_view_state::IsSet, S::Cid: labeler_view_state::IsSet, { @@ -985,85 +985,85 @@ pub mod labeler_view_detailed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; + type Policies; type Cid; - type IndexedAt; type Creator; - type Policies; + type Uri; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; + type Policies = Unset; type Cid = Unset; - type IndexedAt = Unset; type Creator = Unset; - type Policies = Unset; + type Uri = Unset; + type IndexedAt = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; + ///State transition - sets the `policies` field to Set + pub struct SetPolicies(PhantomData S>); + impl sealed::Sealed for SetPolicies {} + impl State for SetPolicies { + type Policies = Set; type Cid = S::Cid; - type IndexedAt = S::IndexedAt; type Creator = S::Creator; - type Policies = S::Policies; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Uri = S::Uri; + type Policies = S::Policies; type Cid = Set; - type IndexedAt = S::IndexedAt; type Creator = S::Creator; - type Policies = S::Policies; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { type Uri = S::Uri; - type Cid = S::Cid; - type IndexedAt = Set; - type Creator = S::Creator; - type Policies = S::Policies; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `creator` field to Set pub struct SetCreator(PhantomData S>); impl sealed::Sealed for SetCreator {} impl State for SetCreator { - type Uri = S::Uri; + type Policies = S::Policies; type Cid = S::Cid; - type IndexedAt = S::IndexedAt; type Creator = Set; - type Policies = S::Policies; - } - ///State transition - sets the `policies` field to Set - pub struct SetPolicies(PhantomData S>); - impl sealed::Sealed for SetPolicies {} - impl State for SetPolicies { type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Policies = S::Policies; type Cid = S::Cid; + type Creator = S::Creator; + type Uri = Set; type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Policies = S::Policies; + type Cid = S::Cid; type Creator = S::Creator; - type Policies = Set; + type Uri = S::Uri; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); + ///Marker type for the `policies` field + pub struct policies(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `creator` field pub struct creator(()); - ///Marker type for the `policies` field - pub struct policies(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -1322,11 +1322,11 @@ impl<'a, S: labeler_view_detailed_state::State> LabelerViewDetailedBuilder<'a, S impl<'a, S> LabelerViewDetailedBuilder<'a, S> where S: labeler_view_detailed_state::State, - S::Uri: labeler_view_detailed_state::IsSet, + S::Policies: labeler_view_detailed_state::IsSet, S::Cid: labeler_view_detailed_state::IsSet, - S::IndexedAt: labeler_view_detailed_state::IsSet, S::Creator: labeler_view_detailed_state::IsSet, - S::Policies: labeler_view_detailed_state::IsSet, + S::Uri: labeler_view_detailed_state::IsSet, + S::IndexedAt: labeler_view_detailed_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelerViewDetailed<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification.rs b/crates/weaver-api/src/app_bsky/notification.rs index 61190f8..2195f6c 100644 --- a/crates/weaver-api/src/app_bsky/notification.rs +++ b/crates/weaver-api/src/app_bsky/notification.rs @@ -43,37 +43,37 @@ pub mod activity_subscription_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Reply; type Post; + type Reply; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Reply = Unset; type Post = Unset; - } - ///State transition - sets the `reply` field to Set - pub struct SetReply(PhantomData S>); - impl sealed::Sealed for SetReply {} - impl State for SetReply { - type Reply = Set; - type Post = S::Post; + type Reply = Unset; } ///State transition - sets the `post` field to Set pub struct SetPost(PhantomData S>); impl sealed::Sealed for SetPost {} impl State for SetPost { - type Reply = S::Reply; type Post = Set; + type Reply = S::Reply; + } + ///State transition - sets the `reply` field to Set + pub struct SetReply(PhantomData S>); + impl sealed::Sealed for SetReply {} + impl State for SetReply { + type Post = S::Post; + type Reply = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reply` field - pub struct reply(()); ///Marker type for the `post` field pub struct post(()); + ///Marker type for the `reply` field + pub struct reply(()); } } @@ -143,8 +143,8 @@ where impl<'a, S> ActivitySubscriptionBuilder<'a, S> where S: activity_subscription_state::State, - S::Reply: activity_subscription_state::IsSet, S::Post: activity_subscription_state::IsSet, + S::Reply: activity_subscription_state::IsSet, { /// Build the final struct pub fn build(self) -> ActivitySubscription<'a> { @@ -601,37 +601,37 @@ pub mod chat_preference_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Include; type Push; + type Include; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Include = Unset; type Push = Unset; - } - ///State transition - sets the `include` field to Set - pub struct SetInclude(PhantomData S>); - impl sealed::Sealed for SetInclude {} - impl State for SetInclude { - type Include = Set; - type Push = S::Push; + type Include = Unset; } ///State transition - sets the `push` field to Set pub struct SetPush(PhantomData S>); impl sealed::Sealed for SetPush {} impl State for SetPush { - type Include = S::Include; type Push = Set; + type Include = S::Include; + } + ///State transition - sets the `include` field to Set + pub struct SetInclude(PhantomData S>); + impl sealed::Sealed for SetInclude {} + impl State for SetInclude { + type Push = S::Push; + type Include = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `include` field - pub struct include(()); ///Marker type for the `push` field pub struct push(()); + ///Marker type for the `include` field + pub struct include(()); } } @@ -704,8 +704,8 @@ where impl<'a, S> ChatPreferenceBuilder<'a, S> where S: chat_preference_state::State, - S::Include: chat_preference_state::IsSet, S::Push: chat_preference_state::IsSet, + S::Include: chat_preference_state::IsSet, { /// Build the final struct pub fn build(self) -> ChatPreference<'a> { @@ -777,50 +777,50 @@ pub mod filterable_preference_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Push; - type Include; type List; + type Include; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Push = Unset; - type Include = Unset; type List = Unset; + type Include = Unset; } ///State transition - sets the `push` field to Set pub struct SetPush(PhantomData S>); impl sealed::Sealed for SetPush {} impl State for SetPush { type Push = Set; - type Include = S::Include; - type List = S::List; - } - ///State transition - sets the `include` field to Set - pub struct SetInclude(PhantomData S>); - impl sealed::Sealed for SetInclude {} - impl State for SetInclude { - type Push = S::Push; - type Include = Set; type List = S::List; + type Include = S::Include; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData S>); impl sealed::Sealed for SetList {} impl State for SetList { type Push = S::Push; - type Include = S::Include; type List = Set; + type Include = S::Include; + } + ///State transition - sets the `include` field to Set + pub struct SetInclude(PhantomData S>); + impl sealed::Sealed for SetInclude {} + impl State for SetInclude { + type Push = S::Push; + type List = S::List; + type Include = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `push` field pub struct push(()); - ///Marker type for the `include` field - pub struct include(()); ///Marker type for the `list` field pub struct list(()); + ///Marker type for the `include` field + pub struct include(()); } } @@ -914,8 +914,8 @@ impl<'a, S> FilterablePreferenceBuilder<'a, S> where S: filterable_preference_state::State, S::Push: filterable_preference_state::IsSet, - S::Include: filterable_preference_state::IsSet, S::List: filterable_preference_state::IsSet, + S::Include: filterable_preference_state::IsSet, { /// Build the final struct pub fn build(self) -> FilterablePreference<'a> { @@ -1180,301 +1180,301 @@ pub mod preferences_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type LikeViaRepost; + type RepostViaRepost; + type SubscribedPost; + type Verified; + type Reply; + type Chat; type Repost; + type StarterpackJoined; type Unverified; + type Like; type Follow; type Mention; type Quote; - type StarterpackJoined; - type SubscribedPost; - type Chat; - type Like; - type LikeViaRepost; - type Verified; - type RepostViaRepost; - type Reply; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type LikeViaRepost = Unset; + type RepostViaRepost = Unset; + type SubscribedPost = Unset; + type Verified = Unset; + type Reply = Unset; + type Chat = Unset; type Repost = Unset; + type StarterpackJoined = Unset; type Unverified = Unset; + type Like = Unset; type Follow = Unset; type Mention = Unset; type Quote = Unset; - type StarterpackJoined = Unset; - type SubscribedPost = Unset; - type Chat = Unset; - type Like = Unset; - type LikeViaRepost = Unset; - type Verified = Unset; - type RepostViaRepost = Unset; - type Reply = Unset; } - ///State transition - sets the `repost` field to Set - pub struct SetRepost(PhantomData S>); - impl sealed::Sealed for SetRepost {} - impl State for SetRepost { - type Repost = Set; + ///State transition - sets the `like_via_repost` field to Set + pub struct SetLikeViaRepost(PhantomData S>); + impl sealed::Sealed for SetLikeViaRepost {} + impl State for SetLikeViaRepost { + type LikeViaRepost = Set; + type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type Verified = S::Verified; + type Reply = S::Reply; + type Chat = S::Chat; + type Repost = S::Repost; + type StarterpackJoined = S::StarterpackJoined; type Unverified = S::Unverified; + type Like = S::Like; type Follow = S::Follow; type Mention = S::Mention; type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Chat = S::Chat; - type Like = S::Like; + } + ///State transition - sets the `repost_via_repost` field to Set + pub struct SetRepostViaRepost(PhantomData S>); + impl sealed::Sealed for SetRepostViaRepost {} + impl State for SetRepostViaRepost { type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = Set; + type SubscribedPost = S::SubscribedPost; type Verified = S::Verified; - type RepostViaRepost = S::RepostViaRepost; type Reply = S::Reply; - } - ///State transition - sets the `unverified` field to Set - pub struct SetUnverified(PhantomData S>); - impl sealed::Sealed for SetUnverified {} - impl State for SetUnverified { + type Chat = S::Chat; type Repost = S::Repost; - type Unverified = Set; + type StarterpackJoined = S::StarterpackJoined; + type Unverified = S::Unverified; + type Like = S::Like; type Follow = S::Follow; type Mention = S::Mention; type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Chat = S::Chat; - type Like = S::Like; + } + ///State transition - sets the `subscribed_post` field to Set + pub struct SetSubscribedPost(PhantomData S>); + impl sealed::Sealed for SetSubscribedPost {} + impl State for SetSubscribedPost { type LikeViaRepost = S::LikeViaRepost; - type Verified = S::Verified; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = Set; + type Verified = S::Verified; type Reply = S::Reply; - } - ///State transition - sets the `follow` field to Set - pub struct SetFollow(PhantomData S>); - impl sealed::Sealed for SetFollow {} - impl State for SetFollow { + type Chat = S::Chat; type Repost = S::Repost; + type StarterpackJoined = S::StarterpackJoined; type Unverified = S::Unverified; - type Follow = Set; + type Like = S::Like; + type Follow = S::Follow; type Mention = S::Mention; type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Chat = S::Chat; - type Like = S::Like; + } + ///State transition - sets the `verified` field to Set + pub struct SetVerified(PhantomData S>); + impl sealed::Sealed for SetVerified {} + impl State for SetVerified { type LikeViaRepost = S::LikeViaRepost; - type Verified = S::Verified; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type Verified = Set; type Reply = S::Reply; - } - ///State transition - sets the `mention` field to Set - pub struct SetMention(PhantomData S>); - impl sealed::Sealed for SetMention {} - impl State for SetMention { + type Chat = S::Chat; type Repost = S::Repost; + type StarterpackJoined = S::StarterpackJoined; type Unverified = S::Unverified; + type Like = S::Like; type Follow = S::Follow; - type Mention = Set; + type Mention = S::Mention; type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; + } + ///State transition - sets the `reply` field to Set + pub struct SetReply(PhantomData S>); + impl sealed::Sealed for SetReply {} + impl State for SetReply { + type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = S::RepostViaRepost; type SubscribedPost = S::SubscribedPost; + type Verified = S::Verified; + type Reply = Set; type Chat = S::Chat; + type Repost = S::Repost; + type StarterpackJoined = S::StarterpackJoined; + type Unverified = S::Unverified; type Like = S::Like; + type Follow = S::Follow; + type Mention = S::Mention; + type Quote = S::Quote; + } + ///State transition - sets the `chat` field to Set + pub struct SetChat(PhantomData S>); + impl sealed::Sealed for SetChat {} + impl State for SetChat { type LikeViaRepost = S::LikeViaRepost; - type Verified = S::Verified; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type Verified = S::Verified; type Reply = S::Reply; - } - ///State transition - sets the `quote` field to Set - pub struct SetQuote(PhantomData S>); - impl sealed::Sealed for SetQuote {} - impl State for SetQuote { + type Chat = Set; type Repost = S::Repost; + type StarterpackJoined = S::StarterpackJoined; type Unverified = S::Unverified; + type Like = S::Like; type Follow = S::Follow; type Mention = S::Mention; - type Quote = Set; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Chat = S::Chat; - type Like = S::Like; + type Quote = S::Quote; + } + ///State transition - sets the `repost` field to Set + pub struct SetRepost(PhantomData S>); + impl sealed::Sealed for SetRepost {} + impl State for SetRepost { type LikeViaRepost = S::LikeViaRepost; - type Verified = S::Verified; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type Verified = S::Verified; type Reply = S::Reply; + type Chat = S::Chat; + type Repost = Set; + type StarterpackJoined = S::StarterpackJoined; + type Unverified = S::Unverified; + type Like = S::Like; + type Follow = S::Follow; + type Mention = S::Mention; + type Quote = S::Quote; } ///State transition - sets the `starterpack_joined` field to Set pub struct SetStarterpackJoined(PhantomData S>); impl sealed::Sealed for SetStarterpackJoined {} impl State for SetStarterpackJoined { - type Repost = S::Repost; - type Unverified = S::Unverified; - type Follow = S::Follow; - type Mention = S::Mention; - type Quote = S::Quote; - type StarterpackJoined = Set; - type SubscribedPost = S::SubscribedPost; - type Chat = S::Chat; - type Like = S::Like; type LikeViaRepost = S::LikeViaRepost; - type Verified = S::Verified; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type Verified = S::Verified; type Reply = S::Reply; - } - ///State transition - sets the `subscribed_post` field to Set - pub struct SetSubscribedPost(PhantomData S>); - impl sealed::Sealed for SetSubscribedPost {} - impl State for SetSubscribedPost { + type Chat = S::Chat; type Repost = S::Repost; + type StarterpackJoined = Set; type Unverified = S::Unverified; + type Like = S::Like; type Follow = S::Follow; type Mention = S::Mention; type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = Set; - type Chat = S::Chat; - type Like = S::Like; + } + ///State transition - sets the `unverified` field to Set + pub struct SetUnverified(PhantomData S>); + impl sealed::Sealed for SetUnverified {} + impl State for SetUnverified { type LikeViaRepost = S::LikeViaRepost; - type Verified = S::Verified; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type Verified = S::Verified; type Reply = S::Reply; - } - ///State transition - sets the `chat` field to Set - pub struct SetChat(PhantomData S>); - impl sealed::Sealed for SetChat {} - impl State for SetChat { + type Chat = S::Chat; type Repost = S::Repost; - type Unverified = S::Unverified; + type StarterpackJoined = S::StarterpackJoined; + type Unverified = Set; + type Like = S::Like; type Follow = S::Follow; type Mention = S::Mention; type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Chat = Set; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Verified = S::Verified; - type RepostViaRepost = S::RepostViaRepost; - type Reply = S::Reply; } ///State transition - sets the `like` field to Set pub struct SetLike(PhantomData S>); impl sealed::Sealed for SetLike {} impl State for SetLike { - type Repost = S::Repost; - type Unverified = S::Unverified; - type Follow = S::Follow; - type Mention = S::Mention; - type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Chat = S::Chat; - type Like = Set; type LikeViaRepost = S::LikeViaRepost; - type Verified = S::Verified; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type Verified = S::Verified; type Reply = S::Reply; - } - ///State transition - sets the `like_via_repost` field to Set - pub struct SetLikeViaRepost(PhantomData S>); - impl sealed::Sealed for SetLikeViaRepost {} - impl State for SetLikeViaRepost { + type Chat = S::Chat; type Repost = S::Repost; + type StarterpackJoined = S::StarterpackJoined; type Unverified = S::Unverified; + type Like = Set; type Follow = S::Follow; type Mention = S::Mention; type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; + } + ///State transition - sets the `follow` field to Set + pub struct SetFollow(PhantomData S>); + impl sealed::Sealed for SetFollow {} + impl State for SetFollow { + type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = S::RepostViaRepost; type SubscribedPost = S::SubscribedPost; - type Chat = S::Chat; - type Like = S::Like; - type LikeViaRepost = Set; type Verified = S::Verified; - type RepostViaRepost = S::RepostViaRepost; type Reply = S::Reply; - } - ///State transition - sets the `verified` field to Set - pub struct SetVerified(PhantomData S>); - impl sealed::Sealed for SetVerified {} - impl State for SetVerified { + type Chat = S::Chat; type Repost = S::Repost; + type StarterpackJoined = S::StarterpackJoined; type Unverified = S::Unverified; - type Follow = S::Follow; + type Like = S::Like; + type Follow = Set; type Mention = S::Mention; type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Chat = S::Chat; - type Like = S::Like; + } + ///State transition - sets the `mention` field to Set + pub struct SetMention(PhantomData S>); + impl sealed::Sealed for SetMention {} + impl State for SetMention { type LikeViaRepost = S::LikeViaRepost; - type Verified = Set; type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; + type Verified = S::Verified; type Reply = S::Reply; - } - ///State transition - sets the `repost_via_repost` field to Set - pub struct SetRepostViaRepost(PhantomData S>); - impl sealed::Sealed for SetRepostViaRepost {} - impl State for SetRepostViaRepost { + type Chat = S::Chat; type Repost = S::Repost; + type StarterpackJoined = S::StarterpackJoined; type Unverified = S::Unverified; + type Like = S::Like; type Follow = S::Follow; - type Mention = S::Mention; + type Mention = Set; type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Chat = S::Chat; - type Like = S::Like; + } + ///State transition - sets the `quote` field to Set + pub struct SetQuote(PhantomData S>); + impl sealed::Sealed for SetQuote {} + impl State for SetQuote { type LikeViaRepost = S::LikeViaRepost; + type RepostViaRepost = S::RepostViaRepost; + type SubscribedPost = S::SubscribedPost; type Verified = S::Verified; - type RepostViaRepost = Set; type Reply = S::Reply; - } - ///State transition - sets the `reply` field to Set - pub struct SetReply(PhantomData S>); - impl sealed::Sealed for SetReply {} - impl State for SetReply { + type Chat = S::Chat; type Repost = S::Repost; + type StarterpackJoined = S::StarterpackJoined; type Unverified = S::Unverified; + type Like = S::Like; type Follow = S::Follow; type Mention = S::Mention; - type Quote = S::Quote; - type StarterpackJoined = S::StarterpackJoined; - type SubscribedPost = S::SubscribedPost; - type Chat = S::Chat; - type Like = S::Like; - type LikeViaRepost = S::LikeViaRepost; - type Verified = S::Verified; - type RepostViaRepost = S::RepostViaRepost; - type Reply = Set; + type Quote = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `like_via_repost` field + pub struct like_via_repost(()); + ///Marker type for the `repost_via_repost` field + pub struct repost_via_repost(()); + ///Marker type for the `subscribed_post` field + pub struct subscribed_post(()); + ///Marker type for the `verified` field + pub struct verified(()); + ///Marker type for the `reply` field + pub struct reply(()); + ///Marker type for the `chat` field + pub struct chat(()); ///Marker type for the `repost` field pub struct repost(()); + ///Marker type for the `starterpack_joined` field + pub struct starterpack_joined(()); ///Marker type for the `unverified` field pub struct unverified(()); + ///Marker type for the `like` field + pub struct like(()); ///Marker type for the `follow` field pub struct follow(()); ///Marker type for the `mention` field pub struct mention(()); ///Marker type for the `quote` field pub struct quote(()); - ///Marker type for the `starterpack_joined` field - pub struct starterpack_joined(()); - ///Marker type for the `subscribed_post` field - pub struct subscribed_post(()); - ///Marker type for the `chat` field - pub struct chat(()); - ///Marker type for the `like` field - pub struct like(()); - ///Marker type for the `like_via_repost` field - pub struct like_via_repost(()); - ///Marker type for the `verified` field - pub struct verified(()); - ///Marker type for the `repost_via_repost` field - pub struct repost_via_repost(()); - ///Marker type for the `reply` field - pub struct reply(()); } } @@ -1781,19 +1781,19 @@ where impl<'a, S> PreferencesBuilder<'a, S> where S: preferences_state::State, + S::LikeViaRepost: preferences_state::IsSet, + S::RepostViaRepost: preferences_state::IsSet, + S::SubscribedPost: preferences_state::IsSet, + S::Verified: preferences_state::IsSet, + S::Reply: preferences_state::IsSet, + S::Chat: preferences_state::IsSet, S::Repost: preferences_state::IsSet, + S::StarterpackJoined: preferences_state::IsSet, S::Unverified: preferences_state::IsSet, + S::Like: preferences_state::IsSet, S::Follow: preferences_state::IsSet, S::Mention: preferences_state::IsSet, S::Quote: preferences_state::IsSet, - S::StarterpackJoined: preferences_state::IsSet, - S::SubscribedPost: preferences_state::IsSet, - S::Chat: preferences_state::IsSet, - S::Like: preferences_state::IsSet, - S::LikeViaRepost: preferences_state::IsSet, - S::Verified: preferences_state::IsSet, - S::RepostViaRepost: preferences_state::IsSet, - S::Reply: preferences_state::IsSet, { /// Build the final struct pub fn build(self) -> Preferences<'a> { @@ -1917,37 +1917,37 @@ pub mod subject_activity_subscription_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ActivitySubscription; type Subject; + type ActivitySubscription; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ActivitySubscription = Unset; type Subject = Unset; - } - ///State transition - sets the `activity_subscription` field to Set - pub struct SetActivitySubscription(PhantomData S>); - impl sealed::Sealed for SetActivitySubscription {} - impl State for SetActivitySubscription { - type ActivitySubscription = Set; - type Subject = S::Subject; + type ActivitySubscription = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type ActivitySubscription = S::ActivitySubscription; type Subject = Set; + type ActivitySubscription = S::ActivitySubscription; + } + ///State transition - sets the `activity_subscription` field to Set + pub struct SetActivitySubscription(PhantomData S>); + impl sealed::Sealed for SetActivitySubscription {} + impl State for SetActivitySubscription { + type Subject = S::Subject; + type ActivitySubscription = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `activity_subscription` field - pub struct activity_subscription(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `activity_subscription` field + pub struct activity_subscription(()); } } @@ -2034,8 +2034,8 @@ where impl<'a, S> SubjectActivitySubscriptionBuilder<'a, S> where S: subject_activity_subscription_state::State, - S::ActivitySubscription: subject_activity_subscription_state::IsSet, S::Subject: subject_activity_subscription_state::IsSet, + S::ActivitySubscription: subject_activity_subscription_state::IsSet, { /// Build the final struct pub fn build(self) -> SubjectActivitySubscription<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification/list_notifications.rs b/crates/weaver-api/src/app_bsky/notification/list_notifications.rs index 2938a72..df04601 100644 --- a/crates/weaver-api/src/app_bsky/notification/list_notifications.rs +++ b/crates/weaver-api/src/app_bsky/notification/list_notifications.rs @@ -273,9 +273,9 @@ pub mod notification_state { pub trait State: sealed::Sealed { type Cid; type IsRead; - type IndexedAt; type Uri; type Author; + type IndexedAt; type Reason; type Record; } @@ -285,9 +285,9 @@ pub mod notification_state { impl State for Empty { type Cid = Unset; type IsRead = Unset; - type IndexedAt = Unset; type Uri = Unset; type Author = Unset; + type IndexedAt = Unset; type Reason = Unset; type Record = Unset; } @@ -297,9 +297,9 @@ pub mod notification_state { impl State for SetCid { type Cid = Set; type IsRead = S::IsRead; - type IndexedAt = S::IndexedAt; type Uri = S::Uri; type Author = S::Author; + type IndexedAt = S::IndexedAt; type Reason = S::Reason; type Record = S::Record; } @@ -309,21 +309,9 @@ pub mod notification_state { impl State for SetIsRead { type Cid = S::Cid; type IsRead = Set; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - type Author = S::Author; - type Reason = S::Reason; - type Record = S::Record; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Cid = S::Cid; - type IsRead = S::IsRead; - type IndexedAt = Set; type Uri = S::Uri; type Author = S::Author; + type IndexedAt = S::IndexedAt; type Reason = S::Reason; type Record = S::Record; } @@ -333,9 +321,9 @@ pub mod notification_state { impl State for SetUri { type Cid = S::Cid; type IsRead = S::IsRead; - type IndexedAt = S::IndexedAt; type Uri = Set; type Author = S::Author; + type IndexedAt = S::IndexedAt; type Reason = S::Reason; type Record = S::Record; } @@ -345,9 +333,21 @@ pub mod notification_state { impl State for SetAuthor { type Cid = S::Cid; type IsRead = S::IsRead; - type IndexedAt = S::IndexedAt; type Uri = S::Uri; type Author = Set; + type IndexedAt = S::IndexedAt; + type Reason = S::Reason; + type Record = S::Record; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Cid = S::Cid; + type IsRead = S::IsRead; + type Uri = S::Uri; + type Author = S::Author; + type IndexedAt = Set; type Reason = S::Reason; type Record = S::Record; } @@ -357,9 +357,9 @@ pub mod notification_state { impl State for SetReason { type Cid = S::Cid; type IsRead = S::IsRead; - type IndexedAt = S::IndexedAt; type Uri = S::Uri; type Author = S::Author; + type IndexedAt = S::IndexedAt; type Reason = Set; type Record = S::Record; } @@ -369,9 +369,9 @@ pub mod notification_state { impl State for SetRecord { type Cid = S::Cid; type IsRead = S::IsRead; - type IndexedAt = S::IndexedAt; type Uri = S::Uri; type Author = S::Author; + type IndexedAt = S::IndexedAt; type Reason = S::Reason; type Record = Set; } @@ -382,12 +382,12 @@ pub mod notification_state { pub struct cid(()); ///Marker type for the `is_read` field pub struct is_read(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `reason` field pub struct reason(()); ///Marker type for the `record` field @@ -616,9 +616,9 @@ where S: notification_state::State, S::Cid: notification_state::IsSet, S::IsRead: notification_state::IsSet, - S::IndexedAt: notification_state::IsSet, S::Uri: notification_state::IsSet, S::Author: notification_state::IsSet, + S::IndexedAt: notification_state::IsSet, S::Reason: notification_state::IsSet, S::Record: notification_state::IsSet, { diff --git a/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs b/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs index 7e167a9..b0c858e 100644 --- a/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs +++ b/crates/weaver-api/src/app_bsky/notification/put_activity_subscription.rs @@ -33,37 +33,37 @@ pub mod put_activity_subscription_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type ActivitySubscription; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type ActivitySubscription = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type ActivitySubscription = S::ActivitySubscription; + type Subject = Unset; } ///State transition - sets the `activity_subscription` field to Set pub struct SetActivitySubscription(PhantomData S>); impl sealed::Sealed for SetActivitySubscription {} impl State for SetActivitySubscription { - type Subject = S::Subject; type ActivitySubscription = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type ActivitySubscription = S::ActivitySubscription; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `activity_subscription` field pub struct activity_subscription(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -148,8 +148,8 @@ where impl<'a, S> PutActivitySubscriptionBuilder<'a, S> where S: put_activity_subscription_state::State, - S::Subject: put_activity_subscription_state::IsSet, S::ActivitySubscription: put_activity_subscription_state::IsSet, + S::Subject: put_activity_subscription_state::IsSet, { /// Build the final struct pub fn build(self) -> PutActivitySubscription<'a> { diff --git a/crates/weaver-api/src/app_bsky/notification/unregister_push.rs b/crates/weaver-api/src/app_bsky/notification/unregister_push.rs index 8f47e47..fd6244f 100644 --- a/crates/weaver-api/src/app_bsky/notification/unregister_push.rs +++ b/crates/weaver-api/src/app_bsky/notification/unregister_push.rs @@ -39,8 +39,8 @@ pub mod unregister_push_state { pub trait State: sealed::Sealed { type Platform; type ServiceDid; - type AppId; type Token; + type AppId; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -48,8 +48,8 @@ pub mod unregister_push_state { impl State for Empty { type Platform = Unset; type ServiceDid = Unset; - type AppId = Unset; type Token = Unset; + type AppId = Unset; } ///State transition - sets the `platform` field to Set pub struct SetPlatform(PhantomData S>); @@ -57,8 +57,8 @@ pub mod unregister_push_state { impl State for SetPlatform { type Platform = Set; type ServiceDid = S::ServiceDid; - type AppId = S::AppId; type Token = S::Token; + type AppId = S::AppId; } ///State transition - sets the `service_did` field to Set pub struct SetServiceDid(PhantomData S>); @@ -66,17 +66,8 @@ pub mod unregister_push_state { impl State for SetServiceDid { type Platform = S::Platform; type ServiceDid = Set; - type AppId = S::AppId; - type Token = S::Token; - } - ///State transition - sets the `app_id` field to Set - pub struct SetAppId(PhantomData S>); - impl sealed::Sealed for SetAppId {} - impl State for SetAppId { - type Platform = S::Platform; - type ServiceDid = S::ServiceDid; - type AppId = Set; type Token = S::Token; + type AppId = S::AppId; } ///State transition - sets the `token` field to Set pub struct SetToken(PhantomData S>); @@ -84,8 +75,17 @@ pub mod unregister_push_state { impl State for SetToken { type Platform = S::Platform; type ServiceDid = S::ServiceDid; - type AppId = S::AppId; type Token = Set; + type AppId = S::AppId; + } + ///State transition - sets the `app_id` field to Set + pub struct SetAppId(PhantomData S>); + impl sealed::Sealed for SetAppId {} + impl State for SetAppId { + type Platform = S::Platform; + type ServiceDid = S::ServiceDid; + type Token = S::Token; + type AppId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -94,10 +94,10 @@ pub mod unregister_push_state { pub struct platform(()); ///Marker type for the `service_did` field pub struct service_did(()); - ///Marker type for the `app_id` field - pub struct app_id(()); ///Marker type for the `token` field pub struct token(()); + ///Marker type for the `app_id` field + pub struct app_id(()); } } @@ -212,8 +212,8 @@ where S: unregister_push_state::State, S::Platform: unregister_push_state::IsSet, S::ServiceDid: unregister_push_state::IsSet, - S::AppId: unregister_push_state::IsSet, S::Token: unregister_push_state::IsSet, + S::AppId: unregister_push_state::IsSet, { /// Build the final struct pub fn build(self) -> UnregisterPush<'a> { diff --git a/crates/weaver-api/src/app_bsky/richtext/facet.rs b/crates/weaver-api/src/app_bsky/richtext/facet.rs index 2b225b3..46a7337 100644 --- a/crates/weaver-api/src/app_bsky/richtext/facet.rs +++ b/crates/weaver-api/src/app_bsky/richtext/facet.rs @@ -581,37 +581,37 @@ pub mod facet_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Features; type Index; + type Features; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Features = Unset; type Index = Unset; - } - ///State transition - sets the `features` field to Set - pub struct SetFeatures(PhantomData S>); - impl sealed::Sealed for SetFeatures {} - impl State for SetFeatures { - type Features = Set; - type Index = S::Index; + type Features = Unset; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData S>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { - type Features = S::Features; type Index = Set; + type Features = S::Features; + } + ///State transition - sets the `features` field to Set + pub struct SetFeatures(PhantomData S>); + impl sealed::Sealed for SetFeatures {} + impl State for SetFeatures { + type Index = S::Index; + type Features = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `features` field - pub struct features(()); ///Marker type for the `index` field pub struct index(()); + ///Marker type for the `features` field + pub struct features(()); } } @@ -684,8 +684,8 @@ where impl<'a, S> FacetBuilder<'a, S> where S: facet_state::State, - S::Features: facet_state::IsSet, S::Index: facet_state::IsSet, + S::Features: facet_state::IsSet, { /// Build the final struct pub fn build(self) -> Facet<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced.rs b/crates/weaver-api/src/app_bsky/unspecced.rs index cb4d28f..34ce3a6 100644 --- a/crates/weaver-api/src/app_bsky/unspecced.rs +++ b/crates/weaver-api/src/app_bsky/unspecced.rs @@ -81,49 +81,49 @@ pub mod age_assurance_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type AttemptId; type CreatedAt; + type AttemptId; type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type AttemptId = Unset; type CreatedAt = Unset; + type AttemptId = Unset; type Status = Unset; } - ///State transition - sets the `attempt_id` field to Set - pub struct SetAttemptId(PhantomData S>); - impl sealed::Sealed for SetAttemptId {} - impl State for SetAttemptId { - type AttemptId = Set; - type CreatedAt = S::CreatedAt; - type Status = S::Status; - } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type AttemptId = S::AttemptId; type CreatedAt = Set; + type AttemptId = S::AttemptId; + type Status = S::Status; + } + ///State transition - sets the `attempt_id` field to Set + pub struct SetAttemptId(PhantomData S>); + impl sealed::Sealed for SetAttemptId {} + impl State for SetAttemptId { + type CreatedAt = S::CreatedAt; + type AttemptId = Set; type Status = S::Status; } ///State transition - sets the `status` field to Set pub struct SetStatus(PhantomData S>); impl sealed::Sealed for SetStatus {} impl State for SetStatus { - type AttemptId = S::AttemptId; type CreatedAt = S::CreatedAt; + type AttemptId = S::AttemptId; type Status = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `attempt_id` field - pub struct attempt_id(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `attempt_id` field + pub struct attempt_id(()); ///Marker type for the `status` field pub struct status(()); } @@ -309,8 +309,8 @@ where impl<'a, S> AgeAssuranceEventBuilder<'a, S> where S: age_assurance_event_state::State, - S::AttemptId: age_assurance_event_state::IsSet, S::CreatedAt: age_assurance_event_state::IsSet, + S::AttemptId: age_assurance_event_state::IsSet, S::Status: age_assurance_event_state::IsSet, { /// Build the final struct @@ -1743,103 +1743,103 @@ pub mod skeleton_trend_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type PostCount; + type Link; type Topic; type DisplayName; - type Link; type Dids; + type PostCount; type StartedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type PostCount = Unset; + type Link = Unset; type Topic = Unset; type DisplayName = Unset; - type Link = Unset; type Dids = Unset; + type PostCount = Unset; type StartedAt = Unset; } - ///State transition - sets the `post_count` field to Set - pub struct SetPostCount(PhantomData S>); - impl sealed::Sealed for SetPostCount {} - impl State for SetPostCount { - type PostCount = Set; + ///State transition - sets the `link` field to Set + pub struct SetLink(PhantomData S>); + impl sealed::Sealed for SetLink {} + impl State for SetLink { + type Link = Set; type Topic = S::Topic; type DisplayName = S::DisplayName; - type Link = S::Link; type Dids = S::Dids; + type PostCount = S::PostCount; type StartedAt = S::StartedAt; } ///State transition - sets the `topic` field to Set pub struct SetTopic(PhantomData S>); impl sealed::Sealed for SetTopic {} impl State for SetTopic { - type PostCount = S::PostCount; + type Link = S::Link; type Topic = Set; type DisplayName = S::DisplayName; - type Link = S::Link; type Dids = S::Dids; + type PostCount = S::PostCount; type StartedAt = S::StartedAt; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type PostCount = S::PostCount; + type Link = S::Link; type Topic = S::Topic; type DisplayName = Set; - type Link = S::Link; type Dids = S::Dids; - type StartedAt = S::StartedAt; - } - ///State transition - sets the `link` field to Set - pub struct SetLink(PhantomData S>); - impl sealed::Sealed for SetLink {} - impl State for SetLink { type PostCount = S::PostCount; - type Topic = S::Topic; - type DisplayName = S::DisplayName; - type Link = Set; - type Dids = S::Dids; type StartedAt = S::StartedAt; } ///State transition - sets the `dids` field to Set pub struct SetDids(PhantomData S>); impl sealed::Sealed for SetDids {} impl State for SetDids { - type PostCount = S::PostCount; + type Link = S::Link; type Topic = S::Topic; type DisplayName = S::DisplayName; - type Link = S::Link; type Dids = Set; + type PostCount = S::PostCount; + type StartedAt = S::StartedAt; + } + ///State transition - sets the `post_count` field to Set + pub struct SetPostCount(PhantomData S>); + impl sealed::Sealed for SetPostCount {} + impl State for SetPostCount { + type Link = S::Link; + type Topic = S::Topic; + type DisplayName = S::DisplayName; + type Dids = S::Dids; + type PostCount = Set; type StartedAt = S::StartedAt; } ///State transition - sets the `started_at` field to Set pub struct SetStartedAt(PhantomData S>); impl sealed::Sealed for SetStartedAt {} impl State for SetStartedAt { - type PostCount = S::PostCount; + type Link = S::Link; type Topic = S::Topic; type DisplayName = S::DisplayName; - type Link = S::Link; type Dids = S::Dids; + type PostCount = S::PostCount; type StartedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `post_count` field - pub struct post_count(()); + ///Marker type for the `link` field + pub struct link(()); ///Marker type for the `topic` field pub struct topic(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `link` field - pub struct link(()); ///Marker type for the `dids` field pub struct dids(()); + ///Marker type for the `post_count` field + pub struct post_count(()); ///Marker type for the `started_at` field pub struct started_at(()); } @@ -2028,11 +2028,11 @@ where impl<'a, S> SkeletonTrendBuilder<'a, S> where S: skeleton_trend_state::State, - S::PostCount: skeleton_trend_state::IsSet, + S::Link: skeleton_trend_state::IsSet, S::Topic: skeleton_trend_state::IsSet, S::DisplayName: skeleton_trend_state::IsSet, - S::Link: skeleton_trend_state::IsSet, S::Dids: skeleton_trend_state::IsSet, + S::PostCount: skeleton_trend_state::IsSet, S::StartedAt: skeleton_trend_state::IsSet, { /// Build the final struct @@ -2322,105 +2322,105 @@ pub mod thread_item_post_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type MutedByViewer; - type MoreReplies; - type MoreParents; type Post; type OpThread; + type MoreReplies; type HiddenByThreadgate; + type MoreParents; + type MutedByViewer; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type MutedByViewer = Unset; - type MoreReplies = Unset; - type MoreParents = Unset; type Post = Unset; type OpThread = Unset; + type MoreReplies = Unset; type HiddenByThreadgate = Unset; + type MoreParents = Unset; + type MutedByViewer = Unset; } - ///State transition - sets the `muted_by_viewer` field to Set - pub struct SetMutedByViewer(PhantomData S>); - impl sealed::Sealed for SetMutedByViewer {} - impl State for SetMutedByViewer { - type MutedByViewer = Set; + ///State transition - sets the `post` field to Set + pub struct SetPost(PhantomData S>); + impl sealed::Sealed for SetPost {} + impl State for SetPost { + type Post = Set; + type OpThread = S::OpThread; type MoreReplies = S::MoreReplies; + type HiddenByThreadgate = S::HiddenByThreadgate; type MoreParents = S::MoreParents; + type MutedByViewer = S::MutedByViewer; + } + ///State transition - sets the `op_thread` field to Set + pub struct SetOpThread(PhantomData S>); + impl sealed::Sealed for SetOpThread {} + impl State for SetOpThread { type Post = S::Post; - type OpThread = S::OpThread; + type OpThread = Set; + type MoreReplies = S::MoreReplies; type HiddenByThreadgate = S::HiddenByThreadgate; + type MoreParents = S::MoreParents; + type MutedByViewer = S::MutedByViewer; } ///State transition - sets the `more_replies` field to Set pub struct SetMoreReplies(PhantomData S>); impl sealed::Sealed for SetMoreReplies {} impl State for SetMoreReplies { - type MutedByViewer = S::MutedByViewer; + type Post = S::Post; + type OpThread = S::OpThread; type MoreReplies = Set; + type HiddenByThreadgate = S::HiddenByThreadgate; type MoreParents = S::MoreParents; + type MutedByViewer = S::MutedByViewer; + } + ///State transition - sets the `hidden_by_threadgate` field to Set + pub struct SetHiddenByThreadgate(PhantomData S>); + impl sealed::Sealed for SetHiddenByThreadgate {} + impl State for SetHiddenByThreadgate { type Post = S::Post; type OpThread = S::OpThread; - type HiddenByThreadgate = S::HiddenByThreadgate; + type MoreReplies = S::MoreReplies; + type HiddenByThreadgate = Set; + type MoreParents = S::MoreParents; + type MutedByViewer = S::MutedByViewer; } ///State transition - sets the `more_parents` field to Set pub struct SetMoreParents(PhantomData S>); impl sealed::Sealed for SetMoreParents {} impl State for SetMoreParents { - type MutedByViewer = S::MutedByViewer; - type MoreReplies = S::MoreReplies; - type MoreParents = Set; type Post = S::Post; type OpThread = S::OpThread; - type HiddenByThreadgate = S::HiddenByThreadgate; - } - ///State transition - sets the `post` field to Set - pub struct SetPost(PhantomData S>); - impl sealed::Sealed for SetPost {} - impl State for SetPost { - type MutedByViewer = S::MutedByViewer; type MoreReplies = S::MoreReplies; - type MoreParents = S::MoreParents; - type Post = Set; - type OpThread = S::OpThread; type HiddenByThreadgate = S::HiddenByThreadgate; - } - ///State transition - sets the `op_thread` field to Set - pub struct SetOpThread(PhantomData S>); - impl sealed::Sealed for SetOpThread {} - impl State for SetOpThread { + type MoreParents = Set; type MutedByViewer = S::MutedByViewer; - type MoreReplies = S::MoreReplies; - type MoreParents = S::MoreParents; - type Post = S::Post; - type OpThread = Set; - type HiddenByThreadgate = S::HiddenByThreadgate; } - ///State transition - sets the `hidden_by_threadgate` field to Set - pub struct SetHiddenByThreadgate(PhantomData S>); - impl sealed::Sealed for SetHiddenByThreadgate {} - impl State for SetHiddenByThreadgate { - type MutedByViewer = S::MutedByViewer; - type MoreReplies = S::MoreReplies; - type MoreParents = S::MoreParents; + ///State transition - sets the `muted_by_viewer` field to Set + pub struct SetMutedByViewer(PhantomData S>); + impl sealed::Sealed for SetMutedByViewer {} + impl State for SetMutedByViewer { type Post = S::Post; type OpThread = S::OpThread; - type HiddenByThreadgate = Set; + type MoreReplies = S::MoreReplies; + type HiddenByThreadgate = S::HiddenByThreadgate; + type MoreParents = S::MoreParents; + type MutedByViewer = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `muted_by_viewer` field - pub struct muted_by_viewer(()); - ///Marker type for the `more_replies` field - pub struct more_replies(()); - ///Marker type for the `more_parents` field - pub struct more_parents(()); ///Marker type for the `post` field pub struct post(()); ///Marker type for the `op_thread` field pub struct op_thread(()); + ///Marker type for the `more_replies` field + pub struct more_replies(()); ///Marker type for the `hidden_by_threadgate` field pub struct hidden_by_threadgate(()); + ///Marker type for the `more_parents` field + pub struct more_parents(()); + ///Marker type for the `muted_by_viewer` field + pub struct muted_by_viewer(()); } } @@ -2573,12 +2573,12 @@ where impl<'a, S> ThreadItemPostBuilder<'a, S> where S: thread_item_post_state::State, - S::MutedByViewer: thread_item_post_state::IsSet, - S::MoreReplies: thread_item_post_state::IsSet, - S::MoreParents: thread_item_post_state::IsSet, S::Post: thread_item_post_state::IsSet, S::OpThread: thread_item_post_state::IsSet, + S::MoreReplies: thread_item_post_state::IsSet, S::HiddenByThreadgate: thread_item_post_state::IsSet, + S::MoreParents: thread_item_post_state::IsSet, + S::MutedByViewer: thread_item_post_state::IsSet, { /// Build the final struct pub fn build(self) -> ThreadItemPost<'a> { @@ -2669,10 +2669,10 @@ pub mod trend_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Topic; type Link; - type PostCount; + type Topic; type DisplayName; + type PostCount; type StartedAt; type Actors; } @@ -2680,43 +2680,32 @@ pub mod trend_view_state { pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Topic = Unset; type Link = Unset; - type PostCount = Unset; + type Topic = Unset; type DisplayName = Unset; + type PostCount = Unset; type StartedAt = Unset; type Actors = Unset; } - ///State transition - sets the `topic` field to Set - pub struct SetTopic(PhantomData S>); - impl sealed::Sealed for SetTopic {} - impl State for SetTopic { - type Topic = Set; - type Link = S::Link; - type PostCount = S::PostCount; - type DisplayName = S::DisplayName; - type StartedAt = S::StartedAt; - type Actors = S::Actors; - } ///State transition - sets the `link` field to Set pub struct SetLink(PhantomData S>); impl sealed::Sealed for SetLink {} impl State for SetLink { - type Topic = S::Topic; type Link = Set; - type PostCount = S::PostCount; + type Topic = S::Topic; type DisplayName = S::DisplayName; + type PostCount = S::PostCount; type StartedAt = S::StartedAt; type Actors = S::Actors; } - ///State transition - sets the `post_count` field to Set - pub struct SetPostCount(PhantomData S>); - impl sealed::Sealed for SetPostCount {} - impl State for SetPostCount { - type Topic = S::Topic; + ///State transition - sets the `topic` field to Set + pub struct SetTopic(PhantomData S>); + impl sealed::Sealed for SetTopic {} + impl State for SetTopic { type Link = S::Link; - type PostCount = Set; + type Topic = Set; type DisplayName = S::DisplayName; + type PostCount = S::PostCount; type StartedAt = S::StartedAt; type Actors = S::Actors; } @@ -2724,10 +2713,21 @@ pub mod trend_view_state { pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { - type Topic = S::Topic; type Link = S::Link; - type PostCount = S::PostCount; + type Topic = S::Topic; type DisplayName = Set; + type PostCount = S::PostCount; + type StartedAt = S::StartedAt; + type Actors = S::Actors; + } + ///State transition - sets the `post_count` field to Set + pub struct SetPostCount(PhantomData S>); + impl sealed::Sealed for SetPostCount {} + impl State for SetPostCount { + type Link = S::Link; + type Topic = S::Topic; + type DisplayName = S::DisplayName; + type PostCount = Set; type StartedAt = S::StartedAt; type Actors = S::Actors; } @@ -2735,10 +2735,10 @@ pub mod trend_view_state { pub struct SetStartedAt(PhantomData S>); impl sealed::Sealed for SetStartedAt {} impl State for SetStartedAt { - type Topic = S::Topic; type Link = S::Link; - type PostCount = S::PostCount; + type Topic = S::Topic; type DisplayName = S::DisplayName; + type PostCount = S::PostCount; type StartedAt = Set; type Actors = S::Actors; } @@ -2746,24 +2746,24 @@ pub mod trend_view_state { pub struct SetActors(PhantomData S>); impl sealed::Sealed for SetActors {} impl State for SetActors { - type Topic = S::Topic; type Link = S::Link; - type PostCount = S::PostCount; + type Topic = S::Topic; type DisplayName = S::DisplayName; + type PostCount = S::PostCount; type StartedAt = S::StartedAt; type Actors = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `topic` field - pub struct topic(()); ///Marker type for the `link` field pub struct link(()); - ///Marker type for the `post_count` field - pub struct post_count(()); + ///Marker type for the `topic` field + pub struct topic(()); ///Marker type for the `display_name` field pub struct display_name(()); + ///Marker type for the `post_count` field + pub struct post_count(()); ///Marker type for the `started_at` field pub struct started_at(()); ///Marker type for the `actors` field @@ -2954,10 +2954,10 @@ where impl<'a, S> TrendViewBuilder<'a, S> where S: trend_view_state::State, - S::Topic: trend_view_state::IsSet, S::Link: trend_view_state::IsSet, - S::PostCount: trend_view_state::IsSet, + S::Topic: trend_view_state::IsSet, S::DisplayName: trend_view_state::IsSet, + S::PostCount: trend_view_state::IsSet, S::StartedAt: trend_view_state::IsSet, S::Actors: trend_view_state::IsSet, { diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_config.rs b/crates/weaver-api/src/app_bsky/unspecced/get_config.rs index 08bdc64..93b7596 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_config.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_config.rs @@ -33,37 +33,37 @@ pub mod live_now_config_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Domains; type Did; + type Domains; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Domains = Unset; type Did = Unset; - } - ///State transition - sets the `domains` field to Set - pub struct SetDomains(PhantomData S>); - impl sealed::Sealed for SetDomains {} - impl State for SetDomains { - type Domains = Set; - type Did = S::Did; + type Domains = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Domains = S::Domains; type Did = Set; + type Domains = S::Domains; + } + ///State transition - sets the `domains` field to Set + pub struct SetDomains(PhantomData S>); + impl sealed::Sealed for SetDomains {} + impl State for SetDomains { + type Did = S::Did; + type Domains = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `domains` field - pub struct domains(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `domains` field + pub struct domains(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> LiveNowConfigBuilder<'a, S> where S: live_now_config_state::State, - S::Domains: live_now_config_state::IsSet, S::Did: live_now_config_state::IsSet, + S::Domains: live_now_config_state::IsSet, { /// Build the final struct pub fn build(self) -> LiveNowConfig<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs index 691dc9b..acc76f5 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_other_v2.rs @@ -189,51 +189,51 @@ pub mod thread_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Depth; type Value; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Depth = Unset; type Value = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Depth = S::Depth; - type Value = S::Value; + type Uri = Unset; } ///State transition - sets the `depth` field to Set pub struct SetDepth(PhantomData S>); impl sealed::Sealed for SetDepth {} impl State for SetDepth { - type Uri = S::Uri; type Depth = Set; type Value = S::Value; + type Uri = S::Uri; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Uri = S::Uri; type Depth = S::Depth; type Value = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Depth = S::Depth; + type Value = S::Value; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `depth` field pub struct depth(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -326,9 +326,9 @@ where impl<'a, S> ThreadItemBuilder<'a, S> where S: thread_item_state::State, - S::Uri: thread_item_state::IsSet, S::Depth: thread_item_state::IsSet, S::Value: thread_item_state::IsSet, + S::Uri: thread_item_state::IsSet, { /// Build the final struct pub fn build(self) -> ThreadItem<'a> { diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs index 25e75df..39bc068 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_post_thread_v2.rs @@ -265,49 +265,49 @@ pub mod thread_item_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Depth; + type Uri; type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Depth = Unset; + type Uri = Unset; type Value = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Depth = S::Depth; - type Value = S::Value; - } ///State transition - sets the `depth` field to Set pub struct SetDepth(PhantomData S>); impl sealed::Sealed for SetDepth {} impl State for SetDepth { - type Uri = S::Uri; type Depth = Set; + type Uri = S::Uri; + type Value = S::Value; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Depth = S::Depth; + type Uri = Set; type Value = S::Value; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Uri = S::Uri; type Depth = S::Depth; + type Uri = S::Uri; type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `depth` field pub struct depth(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `value` field pub struct value(()); } @@ -402,8 +402,8 @@ where impl<'a, S> ThreadItemBuilder<'a, S> where S: thread_item_state::State, - S::Uri: thread_item_state::IsSet, S::Depth: thread_item_state::IsSet, + S::Uri: thread_item_state::IsSet, S::Value: thread_item_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs b/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs index cc9100b..3bceb81 100644 --- a/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs +++ b/crates/weaver-api/src/app_bsky/unspecced/get_tagged_suggestions.rs @@ -90,49 +90,49 @@ pub mod suggestion_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type SubjectType; type Tag; + type SubjectType; type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type SubjectType = Unset; type Tag = Unset; + type SubjectType = Unset; type Subject = Unset; } - ///State transition - sets the `subject_type` field to Set - pub struct SetSubjectType(PhantomData S>); - impl sealed::Sealed for SetSubjectType {} - impl State for SetSubjectType { - type SubjectType = Set; - type Tag = S::Tag; - type Subject = S::Subject; - } ///State transition - sets the `tag` field to Set pub struct SetTag(PhantomData S>); impl sealed::Sealed for SetTag {} impl State for SetTag { - type SubjectType = S::SubjectType; type Tag = Set; + type SubjectType = S::SubjectType; + type Subject = S::Subject; + } + ///State transition - sets the `subject_type` field to Set + pub struct SetSubjectType(PhantomData S>); + impl sealed::Sealed for SetSubjectType {} + impl State for SetSubjectType { + type Tag = S::Tag; + type SubjectType = Set; type Subject = S::Subject; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type SubjectType = S::SubjectType; type Tag = S::Tag; + type SubjectType = S::SubjectType; type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject_type` field - pub struct subject_type(()); ///Marker type for the `tag` field pub struct tag(()); + ///Marker type for the `subject_type` field + pub struct subject_type(()); ///Marker type for the `subject` field pub struct subject(()); } @@ -227,8 +227,8 @@ where impl<'a, S> SuggestionBuilder<'a, S> where S: suggestion_state::State, - S::SubjectType: suggestion_state::IsSet, S::Tag: suggestion_state::IsSet, + S::SubjectType: suggestion_state::IsSet, S::Subject: suggestion_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/chat_bsky/convo.rs b/crates/weaver-api/src/chat_bsky/convo.rs index 167413e..0aff1d6 100644 --- a/crates/weaver-api/src/chat_bsky/convo.rs +++ b/crates/weaver-api/src/chat_bsky/convo.rs @@ -66,85 +66,85 @@ pub mod convo_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type UnreadCount; - type Rev; - type Id; type Muted; + type UnreadCount; type Members; + type Id; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type UnreadCount = Unset; - type Rev = Unset; - type Id = Unset; type Muted = Unset; + type UnreadCount = Unset; type Members = Unset; + type Id = Unset; + type Rev = Unset; + } + ///State transition - sets the `muted` field to Set + pub struct SetMuted(PhantomData S>); + impl sealed::Sealed for SetMuted {} + impl State for SetMuted { + type Muted = Set; + type UnreadCount = S::UnreadCount; + type Members = S::Members; + type Id = S::Id; + type Rev = S::Rev; } ///State transition - sets the `unread_count` field to Set pub struct SetUnreadCount(PhantomData S>); impl sealed::Sealed for SetUnreadCount {} impl State for SetUnreadCount { - type UnreadCount = Set; - type Rev = S::Rev; - type Id = S::Id; type Muted = S::Muted; + type UnreadCount = Set; type Members = S::Members; + type Id = S::Id; + type Rev = S::Rev; } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { + ///State transition - sets the `members` field to Set + pub struct SetMembers(PhantomData S>); + impl sealed::Sealed for SetMembers {} + impl State for SetMembers { + type Muted = S::Muted; type UnreadCount = S::UnreadCount; - type Rev = Set; + type Members = Set; type Id = S::Id; - type Muted = S::Muted; - type Members = S::Members; + type Rev = S::Rev; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type UnreadCount = S::UnreadCount; - type Rev = S::Rev; - type Id = Set; type Muted = S::Muted; - type Members = S::Members; - } - ///State transition - sets the `muted` field to Set - pub struct SetMuted(PhantomData S>); - impl sealed::Sealed for SetMuted {} - impl State for SetMuted { type UnreadCount = S::UnreadCount; - type Rev = S::Rev; - type Id = S::Id; - type Muted = Set; type Members = S::Members; + type Id = Set; + type Rev = S::Rev; } - ///State transition - sets the `members` field to Set - pub struct SetMembers(PhantomData S>); - impl sealed::Sealed for SetMembers {} - impl State for SetMembers { + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Muted = S::Muted; type UnreadCount = S::UnreadCount; - type Rev = S::Rev; + type Members = S::Members; type Id = S::Id; - type Muted = S::Muted; - type Members = Set; + type Rev = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `unread_count` field - pub struct unread_count(()); - ///Marker type for the `rev` field - pub struct rev(()); - ///Marker type for the `id` field - pub struct id(()); ///Marker type for the `muted` field pub struct muted(()); + ///Marker type for the `unread_count` field + pub struct unread_count(()); ///Marker type for the `members` field pub struct members(()); + ///Marker type for the `id` field + pub struct id(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -334,11 +334,11 @@ where impl<'a, S> ConvoViewBuilder<'a, S> where S: convo_view_state::State, - S::UnreadCount: convo_view_state::IsSet, - S::Rev: convo_view_state::IsSet, - S::Id: convo_view_state::IsSet, S::Muted: convo_view_state::IsSet, + S::UnreadCount: convo_view_state::IsSet, S::Members: convo_view_state::IsSet, + S::Id: convo_view_state::IsSet, + S::Rev: convo_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ConvoView<'a> { @@ -1648,65 +1648,65 @@ pub mod deleted_message_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; type SentAt; type Rev; + type Id; type Sender; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; type SentAt = Unset; type Rev = Unset; + type Id = Unset; type Sender = Unset; } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type SentAt = S::SentAt; - type Rev = S::Rev; - type Sender = S::Sender; - } ///State transition - sets the `sent_at` field to Set pub struct SetSentAt(PhantomData S>); impl sealed::Sealed for SetSentAt {} impl State for SetSentAt { - type Id = S::Id; type SentAt = Set; type Rev = S::Rev; + type Id = S::Id; type Sender = S::Sender; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Id = S::Id; type SentAt = S::SentAt; type Rev = Set; + type Id = S::Id; + type Sender = S::Sender; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type SentAt = S::SentAt; + type Rev = S::Rev; + type Id = Set; type Sender = S::Sender; } ///State transition - sets the `sender` field to Set pub struct SetSender(PhantomData S>); impl sealed::Sealed for SetSender {} impl State for SetSender { - type Id = S::Id; type SentAt = S::SentAt; type Rev = S::Rev; + type Id = S::Id; type Sender = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `id` field - pub struct id(()); ///Marker type for the `sent_at` field pub struct sent_at(()); ///Marker type for the `rev` field pub struct rev(()); + ///Marker type for the `id` field + pub struct id(()); ///Marker type for the `sender` field pub struct sender(()); } @@ -1821,9 +1821,9 @@ where impl<'a, S> DeletedMessageViewBuilder<'a, S> where S: deleted_message_view_state::State, - S::Id: deleted_message_view_state::IsSet, S::SentAt: deleted_message_view_state::IsSet, S::Rev: deleted_message_view_state::IsSet, + S::Id: deleted_message_view_state::IsSet, S::Sender: deleted_message_view_state::IsSet, { /// Build the final struct @@ -1939,67 +1939,67 @@ pub mod log_add_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Message; type ConvoId; - type Reaction; + type Message; type Rev; + type Reaction; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Message = Unset; type ConvoId = Unset; - type Reaction = Unset; + type Message = Unset; type Rev = Unset; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type Message = Set; - type ConvoId = S::ConvoId; - type Reaction = S::Reaction; - type Rev = S::Rev; + type Reaction = Unset; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Message = S::Message; type ConvoId = Set; - type Reaction = S::Reaction; + type Message = S::Message; type Rev = S::Rev; + type Reaction = S::Reaction; } - ///State transition - sets the `reaction` field to Set - pub struct SetReaction(PhantomData S>); - impl sealed::Sealed for SetReaction {} - impl State for SetReaction { - type Message = S::Message; + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { type ConvoId = S::ConvoId; - type Reaction = Set; + type Message = Set; type Rev = S::Rev; + type Reaction = S::Reaction; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Message = S::Message; type ConvoId = S::ConvoId; - type Reaction = S::Reaction; + type Message = S::Message; type Rev = Set; + type Reaction = S::Reaction; + } + ///State transition - sets the `reaction` field to Set + pub struct SetReaction(PhantomData S>); + impl sealed::Sealed for SetReaction {} + impl State for SetReaction { + type ConvoId = S::ConvoId; + type Message = S::Message; + type Rev = S::Rev; + type Reaction = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `message` field - pub struct message(()); ///Marker type for the `convo_id` field pub struct convo_id(()); - ///Marker type for the `reaction` field - pub struct reaction(()); + ///Marker type for the `message` field + pub struct message(()); ///Marker type for the `rev` field pub struct rev(()); + ///Marker type for the `reaction` field + pub struct reaction(()); } } @@ -2112,10 +2112,10 @@ where impl<'a, S> LogAddReactionBuilder<'a, S> where S: log_add_reaction_state::State, - S::Message: log_add_reaction_state::IsSet, S::ConvoId: log_add_reaction_state::IsSet, - S::Reaction: log_add_reaction_state::IsSet, + S::Message: log_add_reaction_state::IsSet, S::Rev: log_add_reaction_state::IsSet, + S::Reaction: log_add_reaction_state::IsSet, { /// Build the final struct pub fn build(self) -> LogAddReaction<'a> { @@ -2247,51 +2247,51 @@ pub mod log_create_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; - type ConvoId; type Message; + type ConvoId; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; - type ConvoId = Unset; type Message = Unset; + type ConvoId = Unset; + type Rev = Unset; } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Rev = Set; + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Message = Set; type ConvoId = S::ConvoId; - type Message = S::Message; + type Rev = S::Rev; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Rev = S::Rev; - type ConvoId = Set; type Message = S::Message; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { + type ConvoId = Set; type Rev = S::Rev; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Message = S::Message; type ConvoId = S::ConvoId; - type Message = Set; + type Rev = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rev` field - pub struct rev(()); - ///Marker type for the `convo_id` field - pub struct convo_id(()); ///Marker type for the `message` field pub struct message(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -2384,9 +2384,9 @@ where impl<'a, S> LogCreateMessageBuilder<'a, S> where S: log_create_message_state::State, - S::Rev: log_create_message_state::IsSet, - S::ConvoId: log_create_message_state::IsSet, S::Message: log_create_message_state::IsSet, + S::ConvoId: log_create_message_state::IsSet, + S::Rev: log_create_message_state::IsSet, { /// Build the final struct pub fn build(self) -> LogCreateMessage<'a> { @@ -2481,50 +2481,50 @@ pub mod log_delete_message_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Rev; - type ConvoId; type Message; + type ConvoId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Rev = Unset; - type ConvoId = Unset; type Message = Unset; + type ConvoId = Unset; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { type Rev = Set; - type ConvoId = S::ConvoId; - type Message = S::Message; - } - ///State transition - sets the `convo_id` field to Set - pub struct SetConvoId(PhantomData S>); - impl sealed::Sealed for SetConvoId {} - impl State for SetConvoId { - type Rev = S::Rev; - type ConvoId = Set; type Message = S::Message; + type ConvoId = S::ConvoId; } ///State transition - sets the `message` field to Set pub struct SetMessage(PhantomData S>); impl sealed::Sealed for SetMessage {} impl State for SetMessage { type Rev = S::Rev; - type ConvoId = S::ConvoId; type Message = Set; + type ConvoId = S::ConvoId; + } + ///State transition - sets the `convo_id` field to Set + pub struct SetConvoId(PhantomData S>); + impl sealed::Sealed for SetConvoId {} + impl State for SetConvoId { + type Rev = S::Rev; + type Message = S::Message; + type ConvoId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `rev` field pub struct rev(()); - ///Marker type for the `convo_id` field - pub struct convo_id(()); ///Marker type for the `message` field pub struct message(()); + ///Marker type for the `convo_id` field + pub struct convo_id(()); } } @@ -2618,8 +2618,8 @@ impl<'a, S> LogDeleteMessageBuilder<'a, S> where S: log_delete_message_state::State, S::Rev: log_delete_message_state::IsSet, - S::ConvoId: log_delete_message_state::IsSet, S::Message: log_delete_message_state::IsSet, + S::ConvoId: log_delete_message_state::IsSet, { /// Build the final struct pub fn build(self) -> LogDeleteMessage<'a> { @@ -2785,51 +2785,51 @@ pub mod log_read_message_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Message; type Rev; type ConvoId; + type Message; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Message = Unset; type Rev = Unset; type ConvoId = Unset; - } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type Message = Set; - type Rev = S::Rev; - type ConvoId = S::ConvoId; + type Message = Unset; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Message = S::Message; type Rev = Set; type ConvoId = S::ConvoId; + type Message = S::Message; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Message = S::Message; type Rev = S::Rev; type ConvoId = Set; + type Message = S::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type Rev = S::Rev; + type ConvoId = S::ConvoId; + type Message = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `message` field - pub struct message(()); ///Marker type for the `rev` field pub struct rev(()); ///Marker type for the `convo_id` field pub struct convo_id(()); + ///Marker type for the `message` field + pub struct message(()); } } @@ -2922,9 +2922,9 @@ where impl<'a, S> LogReadMessageBuilder<'a, S> where S: log_read_message_state::State, - S::Message: log_read_message_state::IsSet, S::Rev: log_read_message_state::IsSet, S::ConvoId: log_read_message_state::IsSet, + S::Message: log_read_message_state::IsSet, { /// Build the final struct pub fn build(self) -> LogReadMessage<'a> { @@ -3020,67 +3020,67 @@ pub mod log_remove_reaction_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; type ConvoId; - type Message; + type Rev; type Reaction; + type Message; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; type ConvoId = Unset; - type Message = Unset; + type Rev = Unset; type Reaction = Unset; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Rev = Set; - type ConvoId = S::ConvoId; - type Message = S::Message; - type Reaction = S::Reaction; + type Message = Unset; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { - type Rev = S::Rev; type ConvoId = Set; - type Message = S::Message; + type Rev = S::Rev; type Reaction = S::Reaction; + type Message = S::Message; } - ///State transition - sets the `message` field to Set - pub struct SetMessage(PhantomData S>); - impl sealed::Sealed for SetMessage {} - impl State for SetMessage { - type Rev = S::Rev; + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { type ConvoId = S::ConvoId; - type Message = Set; + type Rev = Set; type Reaction = S::Reaction; + type Message = S::Message; } ///State transition - sets the `reaction` field to Set pub struct SetReaction(PhantomData S>); impl sealed::Sealed for SetReaction {} impl State for SetReaction { - type Rev = S::Rev; type ConvoId = S::ConvoId; - type Message = S::Message; + type Rev = S::Rev; type Reaction = Set; + type Message = S::Message; + } + ///State transition - sets the `message` field to Set + pub struct SetMessage(PhantomData S>); + impl sealed::Sealed for SetMessage {} + impl State for SetMessage { + type ConvoId = S::ConvoId; + type Rev = S::Rev; + type Reaction = S::Reaction; + type Message = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `convo_id` field pub struct convo_id(()); - ///Marker type for the `message` field - pub struct message(()); + ///Marker type for the `rev` field + pub struct rev(()); ///Marker type for the `reaction` field pub struct reaction(()); + ///Marker type for the `message` field + pub struct message(()); } } @@ -3193,10 +3193,10 @@ where impl<'a, S> LogRemoveReactionBuilder<'a, S> where S: log_remove_reaction_state::State, - S::Rev: log_remove_reaction_state::IsSet, S::ConvoId: log_remove_reaction_state::IsSet, - S::Message: log_remove_reaction_state::IsSet, + S::Rev: log_remove_reaction_state::IsSet, S::Reaction: log_remove_reaction_state::IsSet, + S::Message: log_remove_reaction_state::IsSet, { /// Build the final struct pub fn build(self) -> LogRemoveReaction<'a> { @@ -3586,50 +3586,50 @@ pub mod message_ref_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type MessageId; - type Did; type ConvoId; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type MessageId = Unset; - type Did = Unset; type ConvoId = Unset; + type Did = Unset; } ///State transition - sets the `message_id` field to Set pub struct SetMessageId(PhantomData S>); impl sealed::Sealed for SetMessageId {} impl State for SetMessageId { type MessageId = Set; - type Did = S::Did; - type ConvoId = S::ConvoId; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type MessageId = S::MessageId; - type Did = Set; type ConvoId = S::ConvoId; + type Did = S::Did; } ///State transition - sets the `convo_id` field to Set pub struct SetConvoId(PhantomData S>); impl sealed::Sealed for SetConvoId {} impl State for SetConvoId { type MessageId = S::MessageId; - type Did = S::Did; type ConvoId = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type MessageId = S::MessageId; + type ConvoId = S::ConvoId; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `message_id` field pub struct message_id(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `convo_id` field pub struct convo_id(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -3723,8 +3723,8 @@ impl<'a, S> MessageRefBuilder<'a, S> where S: message_ref_state::State, S::MessageId: message_ref_state::IsSet, - S::Did: message_ref_state::IsSet, S::ConvoId: message_ref_state::IsSet, + S::Did: message_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> MessageRef<'a> { @@ -3813,85 +3813,85 @@ pub mod message_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Sender; - type SentAt; type Id; - type Rev; type Text; + type Rev; + type Sender; + type SentAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Sender = Unset; - type SentAt = Unset; type Id = Unset; - type Rev = Unset; type Text = Unset; - } - ///State transition - sets the `sender` field to Set - pub struct SetSender(PhantomData S>); - impl sealed::Sealed for SetSender {} - impl State for SetSender { - type Sender = Set; - type SentAt = S::SentAt; - type Id = S::Id; - type Rev = S::Rev; - type Text = S::Text; - } - ///State transition - sets the `sent_at` field to Set - pub struct SetSentAt(PhantomData S>); - impl sealed::Sealed for SetSentAt {} - impl State for SetSentAt { - type Sender = S::Sender; - type SentAt = Set; - type Id = S::Id; - type Rev = S::Rev; - type Text = S::Text; + type Rev = Unset; + type Sender = Unset; + type SentAt = Unset; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { + type Id = Set; + type Text = S::Text; + type Rev = S::Rev; type Sender = S::Sender; type SentAt = S::SentAt; - type Id = Set; + } + ///State transition - sets the `text` field to Set + pub struct SetText(PhantomData S>); + impl sealed::Sealed for SetText {} + impl State for SetText { + type Id = S::Id; + type Text = Set; type Rev = S::Rev; - type Text = S::Text; + type Sender = S::Sender; + type SentAt = S::SentAt; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { + type Id = S::Id; + type Text = S::Text; + type Rev = Set; type Sender = S::Sender; type SentAt = S::SentAt; + } + ///State transition - sets the `sender` field to Set + pub struct SetSender(PhantomData S>); + impl sealed::Sealed for SetSender {} + impl State for SetSender { type Id = S::Id; - type Rev = Set; type Text = S::Text; - } - ///State transition - sets the `text` field to Set - pub struct SetText(PhantomData S>); - impl sealed::Sealed for SetText {} - impl State for SetText { - type Sender = S::Sender; + type Rev = S::Rev; + type Sender = Set; type SentAt = S::SentAt; + } + ///State transition - sets the `sent_at` field to Set + pub struct SetSentAt(PhantomData S>); + impl sealed::Sealed for SetSentAt {} + impl State for SetSentAt { type Id = S::Id; + type Text = S::Text; type Rev = S::Rev; - type Text = Set; + type Sender = S::Sender; + type SentAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `sender` field - pub struct sender(()); - ///Marker type for the `sent_at` field - pub struct sent_at(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `rev` field - pub struct rev(()); ///Marker type for the `text` field pub struct text(()); + ///Marker type for the `rev` field + pub struct rev(()); + ///Marker type for the `sender` field + pub struct sender(()); + ///Marker type for the `sent_at` field + pub struct sent_at(()); } } @@ -4084,11 +4084,11 @@ where impl<'a, S> MessageViewBuilder<'a, S> where S: message_view_state::State, - S::Sender: message_view_state::IsSet, - S::SentAt: message_view_state::IsSet, S::Id: message_view_state::IsSet, - S::Rev: message_view_state::IsSet, S::Text: message_view_state::IsSet, + S::Rev: message_view_state::IsSet, + S::Sender: message_view_state::IsSet, + S::SentAt: message_view_state::IsSet, { /// Build the final struct pub fn build(self) -> MessageView<'a> { diff --git a/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs b/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs index 87582a4..151d313 100644 --- a/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs +++ b/crates/weaver-api/src/chat_bsky/moderation/get_actor_metadata.rs @@ -186,8 +186,8 @@ pub mod metadata_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type ConvosStarted; - type MessagesSent; type Convos; + type MessagesSent; type MessagesReceived; } /// Empty state - all required fields are unset @@ -195,8 +195,8 @@ pub mod metadata_state { impl sealed::Sealed for Empty {} impl State for Empty { type ConvosStarted = Unset; - type MessagesSent = Unset; type Convos = Unset; + type MessagesSent = Unset; type MessagesReceived = Unset; } ///State transition - sets the `convos_started` field to Set @@ -204,17 +204,8 @@ pub mod metadata_state { impl sealed::Sealed for SetConvosStarted {} impl State for SetConvosStarted { type ConvosStarted = Set; - type MessagesSent = S::MessagesSent; - type Convos = S::Convos; - type MessagesReceived = S::MessagesReceived; - } - ///State transition - sets the `messages_sent` field to Set - pub struct SetMessagesSent(PhantomData S>); - impl sealed::Sealed for SetMessagesSent {} - impl State for SetMessagesSent { - type ConvosStarted = S::ConvosStarted; - type MessagesSent = Set; type Convos = S::Convos; + type MessagesSent = S::MessagesSent; type MessagesReceived = S::MessagesReceived; } ///State transition - sets the `convos` field to Set @@ -222,8 +213,17 @@ pub mod metadata_state { impl sealed::Sealed for SetConvos {} impl State for SetConvos { type ConvosStarted = S::ConvosStarted; - type MessagesSent = S::MessagesSent; type Convos = Set; + type MessagesSent = S::MessagesSent; + type MessagesReceived = S::MessagesReceived; + } + ///State transition - sets the `messages_sent` field to Set + pub struct SetMessagesSent(PhantomData S>); + impl sealed::Sealed for SetMessagesSent {} + impl State for SetMessagesSent { + type ConvosStarted = S::ConvosStarted; + type Convos = S::Convos; + type MessagesSent = Set; type MessagesReceived = S::MessagesReceived; } ///State transition - sets the `messages_received` field to Set @@ -231,8 +231,8 @@ pub mod metadata_state { impl sealed::Sealed for SetMessagesReceived {} impl State for SetMessagesReceived { type ConvosStarted = S::ConvosStarted; - type MessagesSent = S::MessagesSent; type Convos = S::Convos; + type MessagesSent = S::MessagesSent; type MessagesReceived = Set; } /// Marker types for field names @@ -240,10 +240,10 @@ pub mod metadata_state { pub mod members { ///Marker type for the `convos_started` field pub struct convos_started(()); - ///Marker type for the `messages_sent` field - pub struct messages_sent(()); ///Marker type for the `convos` field pub struct convos(()); + ///Marker type for the `messages_sent` field + pub struct messages_sent(()); ///Marker type for the `messages_received` field pub struct messages_received(()); } @@ -359,8 +359,8 @@ impl<'a, S> MetadataBuilder<'a, S> where S: metadata_state::State, S::ConvosStarted: metadata_state::IsSet, - S::MessagesSent: metadata_state::IsSet, S::Convos: metadata_state::IsSet, + S::MessagesSent: metadata_state::IsSet, S::MessagesReceived: metadata_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs b/crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs index ebdd92b..b93c5d1 100644 --- a/crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs +++ b/crates/weaver-api/src/chat_bsky/moderation/update_actor_access.rs @@ -35,37 +35,37 @@ pub mod update_actor_access_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Actor; type AllowAccess; + type Actor; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Actor = Unset; type AllowAccess = Unset; - } - ///State transition - sets the `actor` field to Set - pub struct SetActor(PhantomData S>); - impl sealed::Sealed for SetActor {} - impl State for SetActor { - type Actor = Set; - type AllowAccess = S::AllowAccess; + type Actor = Unset; } ///State transition - sets the `allow_access` field to Set pub struct SetAllowAccess(PhantomData S>); impl sealed::Sealed for SetAllowAccess {} impl State for SetAllowAccess { - type Actor = S::Actor; type AllowAccess = Set; + type Actor = S::Actor; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type AllowAccess = S::AllowAccess; + type Actor = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `actor` field - pub struct actor(()); ///Marker type for the `allow_access` field pub struct allow_access(()); + ///Marker type for the `actor` field + pub struct actor(()); } } @@ -155,8 +155,8 @@ impl<'a, S: update_actor_access_state::State> UpdateActorAccessBuilder<'a, S> { impl<'a, S> UpdateActorAccessBuilder<'a, S> where S: update_actor_access_state::State, - S::Actor: update_actor_access_state::IsSet, S::AllowAccess: update_actor_access_state::IsSet, + S::Actor: update_actor_access_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateActorAccess<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin.rs b/crates/weaver-api/src/com_atproto/admin.rs index aedf3f7..2990ddf 100644 --- a/crates/weaver-api/src/com_atproto/admin.rs +++ b/crates/weaver-api/src/com_atproto/admin.rs @@ -80,51 +80,51 @@ pub mod account_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Handle; - type IndexedAt; type Did; + type IndexedAt; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Handle = Unset; - type IndexedAt = Unset; type Did = Unset; + type IndexedAt = Unset; + type Handle = Unset; } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type Handle = Set; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; type IndexedAt = S::IndexedAt; - type Did = S::Did; + type Handle = S::Handle; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Handle = S::Handle; - type IndexedAt = Set; type Did = S::Did; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { + type IndexedAt = Set; type Handle = S::Handle; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Did = S::Did; type IndexedAt = S::IndexedAt; - type Did = Set; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `handle` field - pub struct handle(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -401,9 +401,9 @@ impl<'a, S: account_view_state::State> AccountViewBuilder<'a, S> { impl<'a, S> AccountViewBuilder<'a, S> where S: account_view_state::State, - S::Handle: account_view_state::IsSet, - S::IndexedAt: account_view_state::IsSet, S::Did: account_view_state::IsSet, + S::IndexedAt: account_view_state::IsSet, + S::Handle: account_view_state::IsSet, { /// Build the final struct pub fn build(self) -> AccountView<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin/send_email.rs b/crates/weaver-api/src/com_atproto/admin/send_email.rs index 3d4338a..b386221 100644 --- a/crates/weaver-api/src/com_atproto/admin/send_email.rs +++ b/crates/weaver-api/src/com_atproto/admin/send_email.rs @@ -42,51 +42,51 @@ pub mod send_email_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Content; type SenderDid; type RecipientDid; + type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Content = Unset; type SenderDid = Unset; type RecipientDid = Unset; - } - ///State transition - sets the `content` field to Set - pub struct SetContent(PhantomData S>); - impl sealed::Sealed for SetContent {} - impl State for SetContent { - type Content = Set; - type SenderDid = S::SenderDid; - type RecipientDid = S::RecipientDid; + type Content = Unset; } ///State transition - sets the `sender_did` field to Set pub struct SetSenderDid(PhantomData S>); impl sealed::Sealed for SetSenderDid {} impl State for SetSenderDid { - type Content = S::Content; type SenderDid = Set; type RecipientDid = S::RecipientDid; + type Content = S::Content; } ///State transition - sets the `recipient_did` field to Set pub struct SetRecipientDid(PhantomData S>); impl sealed::Sealed for SetRecipientDid {} impl State for SetRecipientDid { - type Content = S::Content; type SenderDid = S::SenderDid; type RecipientDid = Set; + type Content = S::Content; + } + ///State transition - sets the `content` field to Set + pub struct SetContent(PhantomData S>); + impl sealed::Sealed for SetContent {} + impl State for SetContent { + type SenderDid = S::SenderDid; + type RecipientDid = S::RecipientDid; + type Content = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `content` field - pub struct content(()); ///Marker type for the `sender_did` field pub struct sender_did(()); ///Marker type for the `recipient_did` field pub struct recipient_did(()); + ///Marker type for the `content` field + pub struct content(()); } } @@ -213,9 +213,9 @@ impl<'a, S: send_email_state::State> SendEmailBuilder<'a, S> { impl<'a, S> SendEmailBuilder<'a, S> where S: send_email_state::State, - S::Content: send_email_state::IsSet, S::SenderDid: send_email_state::IsSet, S::RecipientDid: send_email_state::IsSet, + S::Content: send_email_state::IsSet, { /// Build the final struct pub fn build(self) -> SendEmail<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin/update_account_handle.rs b/crates/weaver-api/src/com_atproto/admin/update_account_handle.rs index 021ff61..edb8971 100644 --- a/crates/weaver-api/src/com_atproto/admin/update_account_handle.rs +++ b/crates/weaver-api/src/com_atproto/admin/update_account_handle.rs @@ -33,37 +33,37 @@ pub mod update_account_handle_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Handle; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Handle = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Handle = S::Handle; + type Did = Unset; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type Did = S::Did; type Handle = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = S::Handle; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> UpdateAccountHandleBuilder<'a, S> where S: update_account_handle_state::State, - S::Did: update_account_handle_state::IsSet, S::Handle: update_account_handle_state::IsSet, + S::Did: update_account_handle_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateAccountHandle<'a> { diff --git a/crates/weaver-api/src/com_atproto/admin/update_account_password.rs b/crates/weaver-api/src/com_atproto/admin/update_account_password.rs index fdf105f..47c11d7 100644 --- a/crates/weaver-api/src/com_atproto/admin/update_account_password.rs +++ b/crates/weaver-api/src/com_atproto/admin/update_account_password.rs @@ -33,37 +33,37 @@ pub mod update_account_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Password; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Password = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Password = S::Password; + type Did = Unset; } ///State transition - sets the `password` field to Set pub struct SetPassword(PhantomData S>); impl sealed::Sealed for SetPassword {} impl State for SetPassword { - type Did = S::Did; type Password = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Password = S::Password; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `password` field pub struct password(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -142,8 +142,8 @@ where impl<'a, S> UpdateAccountPasswordBuilder<'a, S> where S: update_account_password_state::State, - S::Did: update_account_password_state::IsSet, S::Password: update_account_password_state::IsSet, + S::Did: update_account_password_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateAccountPassword<'a> { diff --git a/crates/weaver-api/src/com_atproto/identity.rs b/crates/weaver-api/src/com_atproto/identity.rs index c24ac7d..6e752d0 100644 --- a/crates/weaver-api/src/com_atproto/identity.rs +++ b/crates/weaver-api/src/com_atproto/identity.rs @@ -47,51 +47,51 @@ pub mod identity_info_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type DidDoc; type Did; type Handle; + type DidDoc; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type DidDoc = Unset; type Did = Unset; type Handle = Unset; - } - ///State transition - sets the `did_doc` field to Set - pub struct SetDidDoc(PhantomData S>); - impl sealed::Sealed for SetDidDoc {} - impl State for SetDidDoc { - type DidDoc = Set; - type Did = S::Did; - type Handle = S::Handle; + type DidDoc = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type DidDoc = S::DidDoc; type Did = Set; type Handle = S::Handle; + type DidDoc = S::DidDoc; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type DidDoc = S::DidDoc; type Did = S::Did; type Handle = Set; + type DidDoc = S::DidDoc; + } + ///State transition - sets the `did_doc` field to Set + pub struct SetDidDoc(PhantomData S>); + impl sealed::Sealed for SetDidDoc {} + impl State for SetDidDoc { + type Did = S::Did; + type Handle = S::Handle; + type DidDoc = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did_doc` field - pub struct did_doc(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `did_doc` field + pub struct did_doc(()); } } @@ -184,9 +184,9 @@ where impl<'a, S> IdentityInfoBuilder<'a, S> where S: identity_info_state::State, - S::DidDoc: identity_info_state::IsSet, S::Did: identity_info_state::IsSet, S::Handle: identity_info_state::IsSet, + S::DidDoc: identity_info_state::IsSet, { /// Build the final struct pub fn build(self) -> IdentityInfo<'a> { diff --git a/crates/weaver-api/src/com_atproto/label.rs b/crates/weaver-api/src/com_atproto/label.rs index 0aabecf..0dabae0 100644 --- a/crates/weaver-api/src/com_atproto/label.rs +++ b/crates/weaver-api/src/com_atproto/label.rs @@ -63,67 +63,67 @@ pub mod label_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Src; - type Uri; type Val; + type Src; type Cts; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Src = Unset; - type Uri = Unset; type Val = Unset; + type Src = Unset; type Cts = Unset; - } - ///State transition - sets the `src` field to Set - pub struct SetSrc(PhantomData S>); - impl sealed::Sealed for SetSrc {} - impl State for SetSrc { - type Src = Set; - type Uri = S::Uri; - type Val = S::Val; - type Cts = S::Cts; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Src = S::Src; - type Uri = Set; - type Val = S::Val; - type Cts = S::Cts; + type Uri = Unset; } ///State transition - sets the `val` field to Set pub struct SetVal(PhantomData S>); impl sealed::Sealed for SetVal {} impl State for SetVal { + type Val = Set; type Src = S::Src; + type Cts = S::Cts; type Uri = S::Uri; - type Val = Set; + } + ///State transition - sets the `src` field to Set + pub struct SetSrc(PhantomData S>); + impl sealed::Sealed for SetSrc {} + impl State for SetSrc { + type Val = S::Val; + type Src = Set; type Cts = S::Cts; + type Uri = S::Uri; } ///State transition - sets the `cts` field to Set pub struct SetCts(PhantomData S>); impl sealed::Sealed for SetCts {} impl State for SetCts { + type Val = S::Val; type Src = S::Src; + type Cts = Set; type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Val = S::Val; - type Cts = Set; + type Src = S::Src; + type Cts = S::Cts; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `src` field - pub struct src(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `val` field pub struct val(()); + ///Marker type for the `src` field + pub struct src(()); ///Marker type for the `cts` field pub struct cts(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -328,10 +328,10 @@ impl<'a, S: label_state::State> LabelBuilder<'a, S> { impl<'a, S> LabelBuilder<'a, S> where S: label_state::State, - S::Src: label_state::IsSet, - S::Uri: label_state::IsSet, S::Val: label_state::IsSet, + S::Src: label_state::IsSet, S::Cts: label_state::IsSet, + S::Uri: label_state::IsSet, { /// Build the final struct pub fn build(self) -> Label<'a> { @@ -1055,8 +1055,8 @@ pub mod label_value_definition_state { pub trait State: sealed::Sealed { type Severity; type Identifier; - type Locales; type Blurs; + type Locales; } /// Empty state - all required fields are unset pub struct Empty(()); @@ -1064,8 +1064,8 @@ pub mod label_value_definition_state { impl State for Empty { type Severity = Unset; type Identifier = Unset; - type Locales = Unset; type Blurs = Unset; + type Locales = Unset; } ///State transition - sets the `severity` field to Set pub struct SetSeverity(PhantomData S>); @@ -1073,8 +1073,8 @@ pub mod label_value_definition_state { impl State for SetSeverity { type Severity = Set; type Identifier = S::Identifier; - type Locales = S::Locales; type Blurs = S::Blurs; + type Locales = S::Locales; } ///State transition - sets the `identifier` field to Set pub struct SetIdentifier(PhantomData S>); @@ -1082,17 +1082,8 @@ pub mod label_value_definition_state { impl State for SetIdentifier { type Severity = S::Severity; type Identifier = Set; - type Locales = S::Locales; - type Blurs = S::Blurs; - } - ///State transition - sets the `locales` field to Set - pub struct SetLocales(PhantomData S>); - impl sealed::Sealed for SetLocales {} - impl State for SetLocales { - type Severity = S::Severity; - type Identifier = S::Identifier; - type Locales = Set; type Blurs = S::Blurs; + type Locales = S::Locales; } ///State transition - sets the `blurs` field to Set pub struct SetBlurs(PhantomData S>); @@ -1100,8 +1091,17 @@ pub mod label_value_definition_state { impl State for SetBlurs { type Severity = S::Severity; type Identifier = S::Identifier; - type Locales = S::Locales; type Blurs = Set; + type Locales = S::Locales; + } + ///State transition - sets the `locales` field to Set + pub struct SetLocales(PhantomData S>); + impl sealed::Sealed for SetLocales {} + impl State for SetLocales { + type Severity = S::Severity; + type Identifier = S::Identifier; + type Blurs = S::Blurs; + type Locales = Set; } /// Marker types for field names #[allow(non_camel_case_types)] @@ -1110,10 +1110,10 @@ pub mod label_value_definition_state { pub struct severity(()); ///Marker type for the `identifier` field pub struct identifier(()); - ///Marker type for the `locales` field - pub struct locales(()); ///Marker type for the `blurs` field pub struct blurs(()); + ///Marker type for the `locales` field + pub struct locales(()); } } @@ -1270,8 +1270,8 @@ where S: label_value_definition_state::State, S::Severity: label_value_definition_state::IsSet, S::Identifier: label_value_definition_state::IsSet, - S::Locales: label_value_definition_state::IsSet, S::Blurs: label_value_definition_state::IsSet, + S::Locales: label_value_definition_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelValueDefinition<'a> { @@ -1388,50 +1388,50 @@ pub mod label_value_definition_strings_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Name; - type Description; type Lang; + type Description; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Name = Unset; - type Description = Unset; type Lang = Unset; + type Description = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { type Name = Set; - type Description = S::Description; - type Lang = S::Lang; - } - ///State transition - sets the `description` field to Set - pub struct SetDescription(PhantomData S>); - impl sealed::Sealed for SetDescription {} - impl State for SetDescription { - type Name = S::Name; - type Description = Set; type Lang = S::Lang; + type Description = S::Description; } ///State transition - sets the `lang` field to Set pub struct SetLang(PhantomData S>); impl sealed::Sealed for SetLang {} impl State for SetLang { type Name = S::Name; - type Description = S::Description; type Lang = Set; + type Description = S::Description; + } + ///State transition - sets the `description` field to Set + pub struct SetDescription(PhantomData S>); + impl sealed::Sealed for SetDescription {} + impl State for SetDescription { + type Name = S::Name; + type Lang = S::Lang; + type Description = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `name` field pub struct name(()); - ///Marker type for the `description` field - pub struct description(()); ///Marker type for the `lang` field pub struct lang(()); + ///Marker type for the `description` field + pub struct description(()); } } @@ -1542,8 +1542,8 @@ impl<'a, S> LabelValueDefinitionStringsBuilder<'a, S> where S: label_value_definition_strings_state::State, S::Name: label_value_definition_strings_state::IsSet, - S::Description: label_value_definition_strings_state::IsSet, S::Lang: label_value_definition_strings_state::IsSet, + S::Description: label_value_definition_strings_state::IsSet, { /// Build the final struct pub fn build(self) -> LabelValueDefinitionStrings<'a> { diff --git a/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs b/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs index 77ad97f..6ae8520 100644 --- a/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs +++ b/crates/weaver-api/src/com_atproto/label/subscribe_labels.rs @@ -203,37 +203,37 @@ pub mod labels_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Labels; type Seq; + type Labels; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Labels = Unset; type Seq = Unset; - } - ///State transition - sets the `labels` field to Set - pub struct SetLabels(PhantomData S>); - impl sealed::Sealed for SetLabels {} - impl State for SetLabels { - type Labels = Set; - type Seq = S::Seq; + type Labels = Unset; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData S>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { - type Labels = S::Labels; type Seq = Set; + type Labels = S::Labels; + } + ///State transition - sets the `labels` field to Set + pub struct SetLabels(PhantomData S>); + impl sealed::Sealed for SetLabels {} + impl State for SetLabels { + type Seq = S::Seq; + type Labels = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `labels` field - pub struct labels(()); ///Marker type for the `seq` field pub struct seq(()); + ///Marker type for the `labels` field + pub struct labels(()); } } @@ -306,8 +306,8 @@ where impl<'a, S> LabelsBuilder<'a, S> where S: labels_state::State, - S::Labels: labels_state::IsSet, S::Seq: labels_state::IsSet, + S::Labels: labels_state::IsSet, { /// Build the final struct pub fn build(self) -> Labels<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo.rs b/crates/weaver-api/src/com_atproto/repo.rs index c4326dc..fe41eba 100644 --- a/crates/weaver-api/src/com_atproto/repo.rs +++ b/crates/weaver-api/src/com_atproto/repo.rs @@ -44,37 +44,37 @@ pub mod commit_meta_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Rev; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Rev = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Rev = S::Rev; + type Cid = Unset; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Cid = S::Cid; type Rev = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Rev = S::Rev; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `rev` field pub struct rev(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -147,8 +147,8 @@ where impl<'a, S> CommitMetaBuilder<'a, S> where S: commit_meta_state::State, - S::Cid: commit_meta_state::IsSet, S::Rev: commit_meta_state::IsSet, + S::Cid: commit_meta_state::IsSet, { /// Build the final struct pub fn build(self) -> CommitMeta<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/apply_writes.rs b/crates/weaver-api/src/com_atproto/repo/apply_writes.rs index 079a970..fd8c1bf 100644 --- a/crates/weaver-api/src/com_atproto/repo/apply_writes.rs +++ b/crates/weaver-api/src/com_atproto/repo/apply_writes.rs @@ -728,37 +728,37 @@ pub mod create_result_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = S::Uri; + type Cid = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = S::Cid; type Uri = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = S::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -851,8 +851,8 @@ impl<'a, S: create_result_state::State> CreateResultBuilder<'a, S> { impl<'a, S> CreateResultBuilder<'a, S> where S: create_result_state::State, - S::Cid: create_result_state::IsSet, S::Uri: create_result_state::IsSet, + S::Cid: create_result_state::IsSet, { /// Build the final struct pub fn build(self) -> CreateResult<'a> { @@ -928,37 +928,37 @@ pub mod delete_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rkey; type Collection; + type Rkey; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rkey = Unset; type Collection = Unset; - } - ///State transition - sets the `rkey` field to Set - pub struct SetRkey(PhantomData S>); - impl sealed::Sealed for SetRkey {} - impl State for SetRkey { - type Rkey = Set; - type Collection = S::Collection; + type Rkey = Unset; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { - type Rkey = S::Rkey; type Collection = Set; + type Rkey = S::Rkey; + } + ///State transition - sets the `rkey` field to Set + pub struct SetRkey(PhantomData S>); + impl sealed::Sealed for SetRkey {} + impl State for SetRkey { + type Collection = S::Collection; + type Rkey = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rkey` field - pub struct rkey(()); ///Marker type for the `collection` field pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); } } @@ -1039,8 +1039,8 @@ where impl<'a, S> DeleteBuilder<'a, S> where S: delete_state::State, - S::Rkey: delete_state::IsSet, S::Collection: delete_state::IsSet, + S::Rkey: delete_state::IsSet, { /// Build the final struct pub fn build(self) -> Delete<'a> { @@ -1149,37 +1149,37 @@ pub mod apply_writes_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Writes; type Repo; + type Writes; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Writes = Unset; type Repo = Unset; - } - ///State transition - sets the `writes` field to Set - pub struct SetWrites(PhantomData S>); - impl sealed::Sealed for SetWrites {} - impl State for SetWrites { - type Writes = Set; - type Repo = S::Repo; + type Writes = Unset; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Writes = S::Writes; type Repo = Set; + type Writes = S::Writes; + } + ///State transition - sets the `writes` field to Set + pub struct SetWrites(PhantomData S>); + impl sealed::Sealed for SetWrites {} + impl State for SetWrites { + type Repo = S::Repo; + type Writes = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `writes` field - pub struct writes(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `writes` field + pub struct writes(()); } } @@ -1286,8 +1286,8 @@ where impl<'a, S> ApplyWritesBuilder<'a, S> where S: apply_writes_state::State, - S::Writes: apply_writes_state::IsSet, S::Repo: apply_writes_state::IsSet, + S::Writes: apply_writes_state::IsSet, { /// Build the final struct pub fn build(self) -> ApplyWrites<'a> { @@ -1476,51 +1476,51 @@ pub mod update_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Value; type Collection; type Rkey; + type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Value = Unset; type Collection = Unset; type Rkey = Unset; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Value = Set; - type Collection = S::Collection; - type Rkey = S::Rkey; + type Value = Unset; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { - type Value = S::Value; type Collection = Set; type Rkey = S::Rkey; + type Value = S::Value; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Value = S::Value; type Collection = S::Collection; type Rkey = Set; + type Value = S::Value; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Collection = S::Collection; + type Rkey = S::Rkey; + type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `value` field - pub struct value(()); ///Marker type for the `collection` field pub struct collection(()); ///Marker type for the `rkey` field pub struct rkey(()); + ///Marker type for the `value` field + pub struct value(()); } } @@ -1621,9 +1621,9 @@ where impl<'a, S> UpdateBuilder<'a, S> where S: update_state::State, - S::Value: update_state::IsSet, S::Collection: update_state::IsSet, S::Rkey: update_state::IsSet, + S::Value: update_state::IsSet, { /// Build the final struct pub fn build(self) -> Update<'a> { @@ -1699,37 +1699,37 @@ pub mod update_result_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Cid; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Cid = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Cid = S::Cid; + type Uri = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Uri = S::Uri; type Cid = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Cid = S::Cid; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1822,8 +1822,8 @@ impl<'a, S: update_result_state::State> UpdateResultBuilder<'a, S> { impl<'a, S> UpdateResultBuilder<'a, S> where S: update_result_state::State, - S::Uri: update_result_state::IsSet, S::Cid: update_result_state::IsSet, + S::Uri: update_result_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateResult<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/create_record.rs b/crates/weaver-api/src/com_atproto/repo/create_record.rs index 2df559c..0bebd18 100644 --- a/crates/weaver-api/src/com_atproto/repo/create_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/create_record.rs @@ -53,49 +53,49 @@ pub mod create_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Record; type Repo; + type Record; type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Record = Unset; type Repo = Unset; + type Record = Unset; type Collection = Unset; } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Record = Set; - type Repo = S::Repo; - type Collection = S::Collection; - } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Record = S::Record; type Repo = Set; + type Record = S::Record; + type Collection = S::Collection; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Repo = S::Repo; + type Record = Set; type Collection = S::Collection; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { - type Record = S::Record; type Repo = S::Repo; + type Record = S::Record; type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `record` field - pub struct record(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `record` field + pub struct record(()); ///Marker type for the `collection` field pub struct collection(()); } @@ -258,8 +258,8 @@ impl<'a, S: create_record_state::State> CreateRecordBuilder<'a, S> { impl<'a, S> CreateRecordBuilder<'a, S> where S: create_record_state::State, - S::Record: create_record_state::IsSet, S::Repo: create_record_state::IsSet, + S::Record: create_record_state::IsSet, S::Collection: create_record_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/com_atproto/repo/delete_record.rs b/crates/weaver-api/src/com_atproto/repo/delete_record.rs index dcd1553..b546dff 100644 --- a/crates/weaver-api/src/com_atproto/repo/delete_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/delete_record.rs @@ -49,50 +49,50 @@ pub mod delete_record_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Repo; - type Rkey; type Collection; + type Rkey; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Repo = Unset; - type Rkey = Unset; type Collection = Unset; + type Rkey = Unset; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { type Repo = Set; - type Rkey = S::Rkey; - type Collection = S::Collection; - } - ///State transition - sets the `rkey` field to Set - pub struct SetRkey(PhantomData S>); - impl sealed::Sealed for SetRkey {} - impl State for SetRkey { - type Repo = S::Repo; - type Rkey = Set; type Collection = S::Collection; + type Rkey = S::Rkey; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { type Repo = S::Repo; - type Rkey = S::Rkey; type Collection = Set; + type Rkey = S::Rkey; + } + ///State transition - sets the `rkey` field to Set + pub struct SetRkey(PhantomData S>); + impl sealed::Sealed for SetRkey {} + impl State for SetRkey { + type Repo = S::Repo; + type Collection = S::Collection; + type Rkey = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `repo` field pub struct repo(()); - ///Marker type for the `rkey` field - pub struct rkey(()); ///Marker type for the `collection` field pub struct collection(()); + ///Marker type for the `rkey` field + pub struct rkey(()); } } @@ -234,8 +234,8 @@ impl<'a, S> DeleteRecordBuilder<'a, S> where S: delete_record_state::State, S::Repo: delete_record_state::IsSet, - S::Rkey: delete_record_state::IsSet, S::Collection: delete_record_state::IsSet, + S::Rkey: delete_record_state::IsSet, { /// Build the final struct pub fn build(self) -> DeleteRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/get_record.rs b/crates/weaver-api/src/com_atproto/repo/get_record.rs index c1a4fb8..1691fbc 100644 --- a/crates/weaver-api/src/com_atproto/repo/get_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/get_record.rs @@ -39,51 +39,51 @@ pub mod get_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Collection; type Rkey; type Repo; - type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Collection = Unset; type Rkey = Unset; type Repo = Unset; - type Collection = Unset; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData S>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Collection = Set; + type Rkey = S::Rkey; + type Repo = S::Repo; } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { + type Collection = S::Collection; type Rkey = Set; type Repo = S::Repo; - type Collection = S::Collection; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Rkey = S::Rkey; - type Repo = Set; type Collection = S::Collection; - } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData S>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { type Rkey = S::Rkey; - type Repo = S::Repo; - type Collection = Set; + type Repo = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `collection` field + pub struct collection(()); ///Marker type for the `rkey` field pub struct rkey(()); ///Marker type for the `repo` field pub struct repo(()); - ///Marker type for the `collection` field - pub struct collection(()); } } @@ -204,9 +204,9 @@ where impl<'a, S> GetRecordBuilder<'a, S> where S: get_record_state::State, + S::Collection: get_record_state::IsSet, S::Rkey: get_record_state::IsSet, S::Repo: get_record_state::IsSet, - S::Collection: get_record_state::IsSet, { /// Build the final struct pub fn build(self) -> GetRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/list_missing_blobs.rs b/crates/weaver-api/src/com_atproto/repo/list_missing_blobs.rs index 3295674..62c775e 100644 --- a/crates/weaver-api/src/com_atproto/repo/list_missing_blobs.rs +++ b/crates/weaver-api/src/com_atproto/repo/list_missing_blobs.rs @@ -186,37 +186,37 @@ pub mod record_blob_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type RecordUri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type RecordUri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type RecordUri = S::RecordUri; + type Cid = Unset; } ///State transition - sets the `record_uri` field to Set pub struct SetRecordUri(PhantomData S>); impl sealed::Sealed for SetRecordUri {} impl State for SetRecordUri { - type Cid = S::Cid; type RecordUri = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type RecordUri = S::RecordUri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `record_uri` field pub struct record_uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -289,8 +289,8 @@ where impl<'a, S> RecordBlobBuilder<'a, S> where S: record_blob_state::State, - S::Cid: record_blob_state::IsSet, S::RecordUri: record_blob_state::IsSet, + S::Cid: record_blob_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordBlob<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/list_records.rs b/crates/weaver-api/src/com_atproto/repo/list_records.rs index 86d973a..d6cf99b 100644 --- a/crates/weaver-api/src/com_atproto/repo/list_records.rs +++ b/crates/weaver-api/src/com_atproto/repo/list_records.rs @@ -40,37 +40,37 @@ pub mod list_records_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Collection; type Repo; + type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Collection = Unset; type Repo = Unset; - } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData S>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { - type Collection = Set; - type Repo = S::Repo; + type Collection = Unset; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { - type Collection = S::Collection; type Repo = Set; + type Collection = S::Collection; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData S>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Repo = S::Repo; + type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `collection` field - pub struct collection(()); ///Marker type for the `repo` field pub struct repo(()); + ///Marker type for the `collection` field + pub struct collection(()); } } @@ -188,8 +188,8 @@ impl<'a, S: list_records_state::State> ListRecordsBuilder<'a, S> { impl<'a, S> ListRecordsBuilder<'a, S> where S: list_records_state::State, - S::Collection: list_records_state::IsSet, S::Repo: list_records_state::IsSet, + S::Collection: list_records_state::IsSet, { /// Build the final struct pub fn build(self) -> ListRecords<'a> { @@ -278,49 +278,49 @@ pub mod record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Value; type Uri; + type Value; type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Value = Unset; type Uri = Unset; + type Value = Unset; type Cid = Unset; } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Value = Set; - type Uri = S::Uri; - type Cid = S::Cid; - } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Value = S::Value; type Uri = Set; + type Value = S::Value; + type Cid = S::Cid; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Uri = S::Uri; + type Value = Set; type Cid = S::Cid; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Value = S::Value; type Uri = S::Uri; + type Value = S::Value; type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `value` field - pub struct value(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `cid` field pub struct cid(()); } @@ -415,8 +415,8 @@ where impl<'a, S> RecordBuilder<'a, S> where S: record_state::State, - S::Value: record_state::IsSet, S::Uri: record_state::IsSet, + S::Value: record_state::IsSet, S::Cid: record_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/com_atproto/repo/put_record.rs b/crates/weaver-api/src/com_atproto/repo/put_record.rs index 06d0781..111cf1b 100644 --- a/crates/weaver-api/src/com_atproto/repo/put_record.rs +++ b/crates/weaver-api/src/com_atproto/repo/put_record.rs @@ -54,67 +54,67 @@ pub mod put_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Rkey; + type Collection; type Repo; type Record; - type Collection; - type Rkey; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Rkey = Unset; + type Collection = Unset; type Repo = Unset; type Record = Unset; - type Collection = Unset; - type Rkey = Unset; + } + ///State transition - sets the `rkey` field to Set + pub struct SetRkey(PhantomData S>); + impl sealed::Sealed for SetRkey {} + impl State for SetRkey { + type Rkey = Set; + type Collection = S::Collection; + type Repo = S::Repo; + type Record = S::Record; + } + ///State transition - sets the `collection` field to Set + pub struct SetCollection(PhantomData S>); + impl sealed::Sealed for SetCollection {} + impl State for SetCollection { + type Rkey = S::Rkey; + type Collection = Set; + type Repo = S::Repo; + type Record = S::Record; } ///State transition - sets the `repo` field to Set pub struct SetRepo(PhantomData S>); impl sealed::Sealed for SetRepo {} impl State for SetRepo { + type Rkey = S::Rkey; + type Collection = S::Collection; type Repo = Set; type Record = S::Record; - type Collection = S::Collection; - type Rkey = S::Rkey; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Repo = S::Repo; - type Record = Set; - type Collection = S::Collection; - type Rkey = S::Rkey; - } - ///State transition - sets the `collection` field to Set - pub struct SetCollection(PhantomData S>); - impl sealed::Sealed for SetCollection {} - impl State for SetCollection { - type Repo = S::Repo; - type Record = S::Record; - type Collection = Set; type Rkey = S::Rkey; - } - ///State transition - sets the `rkey` field to Set - pub struct SetRkey(PhantomData S>); - impl sealed::Sealed for SetRkey {} - impl State for SetRkey { - type Repo = S::Repo; - type Record = S::Record; type Collection = S::Collection; - type Rkey = Set; + type Repo = S::Repo; + type Record = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `rkey` field + pub struct rkey(()); + ///Marker type for the `collection` field + pub struct collection(()); ///Marker type for the `repo` field pub struct repo(()); ///Marker type for the `record` field pub struct record(()); - ///Marker type for the `collection` field - pub struct collection(()); - ///Marker type for the `rkey` field - pub struct rkey(()); } } @@ -289,10 +289,10 @@ impl<'a, S: put_record_state::State> PutRecordBuilder<'a, S> { impl<'a, S> PutRecordBuilder<'a, S> where S: put_record_state::State, + S::Rkey: put_record_state::IsSet, + S::Collection: put_record_state::IsSet, S::Repo: put_record_state::IsSet, S::Record: put_record_state::IsSet, - S::Collection: put_record_state::IsSet, - S::Rkey: put_record_state::IsSet, { /// Build the final struct pub fn build(self) -> PutRecord<'a> { diff --git a/crates/weaver-api/src/com_atproto/repo/strong_ref.rs b/crates/weaver-api/src/com_atproto/repo/strong_ref.rs index 9a034c1..dc0555c 100644 --- a/crates/weaver-api/src/com_atproto/repo/strong_ref.rs +++ b/crates/weaver-api/src/com_atproto/repo/strong_ref.rs @@ -33,37 +33,37 @@ pub mod strong_ref_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Uri; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = S::Uri; + type Cid = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Cid = S::Cid; type Uri = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = S::Uri; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> StrongRefBuilder<'a, S> where S: strong_ref_state::State, - S::Cid: strong_ref_state::IsSet, S::Uri: strong_ref_state::IsSet, + S::Cid: strong_ref_state::IsSet, { /// Build the final struct pub fn build(self) -> StrongRef<'a> { diff --git a/crates/weaver-api/src/com_atproto/server.rs b/crates/weaver-api/src/com_atproto/server.rs index e0f8716..7685ad9 100644 --- a/crates/weaver-api/src/com_atproto/server.rs +++ b/crates/weaver-api/src/com_atproto/server.rs @@ -66,127 +66,127 @@ pub mod invite_code_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ForAccount; - type CreatedBy; + type Available; type CreatedAt; type Uses; - type Code; - type Available; type Disabled; + type Code; + type ForAccount; + type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ForAccount = Unset; - type CreatedBy = Unset; + type Available = Unset; type CreatedAt = Unset; type Uses = Unset; - type Code = Unset; - type Available = Unset; type Disabled = Unset; + type Code = Unset; + type ForAccount = Unset; + type CreatedBy = Unset; } - ///State transition - sets the `for_account` field to Set - pub struct SetForAccount(PhantomData S>); - impl sealed::Sealed for SetForAccount {} - impl State for SetForAccount { - type ForAccount = Set; - type CreatedBy = S::CreatedBy; + ///State transition - sets the `available` field to Set + pub struct SetAvailable(PhantomData S>); + impl sealed::Sealed for SetAvailable {} + impl State for SetAvailable { + type Available = Set; type CreatedAt = S::CreatedAt; type Uses = S::Uses; - type Code = S::Code; - type Available = S::Available; type Disabled = S::Disabled; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type ForAccount = S::ForAccount; - type CreatedBy = Set; - type CreatedAt = S::CreatedAt; - type Uses = S::Uses; type Code = S::Code; - type Available = S::Available; - type Disabled = S::Disabled; + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type ForAccount = S::ForAccount; - type CreatedBy = S::CreatedBy; + type Available = S::Available; type CreatedAt = Set; type Uses = S::Uses; - type Code = S::Code; - type Available = S::Available; type Disabled = S::Disabled; + type Code = S::Code; + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `uses` field to Set pub struct SetUses(PhantomData S>); impl sealed::Sealed for SetUses {} impl State for SetUses { - type ForAccount = S::ForAccount; - type CreatedBy = S::CreatedBy; + type Available = S::Available; type CreatedAt = S::CreatedAt; type Uses = Set; + type Disabled = S::Disabled; type Code = S::Code; + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `disabled` field to Set + pub struct SetDisabled(PhantomData S>); + impl sealed::Sealed for SetDisabled {} + impl State for SetDisabled { type Available = S::Available; - type Disabled = S::Disabled; + type CreatedAt = S::CreatedAt; + type Uses = S::Uses; + type Disabled = Set; + type Code = S::Code; + type ForAccount = S::ForAccount; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `code` field to Set pub struct SetCode(PhantomData S>); impl sealed::Sealed for SetCode {} impl State for SetCode { - type ForAccount = S::ForAccount; - type CreatedBy = S::CreatedBy; + type Available = S::Available; type CreatedAt = S::CreatedAt; type Uses = S::Uses; - type Code = Set; - type Available = S::Available; type Disabled = S::Disabled; - } - ///State transition - sets the `available` field to Set - pub struct SetAvailable(PhantomData S>); - impl sealed::Sealed for SetAvailable {} - impl State for SetAvailable { + type Code = Set; type ForAccount = S::ForAccount; type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `for_account` field to Set + pub struct SetForAccount(PhantomData S>); + impl sealed::Sealed for SetForAccount {} + impl State for SetForAccount { + type Available = S::Available; type CreatedAt = S::CreatedAt; type Uses = S::Uses; - type Code = S::Code; - type Available = Set; type Disabled = S::Disabled; - } - ///State transition - sets the `disabled` field to Set - pub struct SetDisabled(PhantomData S>); - impl sealed::Sealed for SetDisabled {} - impl State for SetDisabled { - type ForAccount = S::ForAccount; + type Code = S::Code; + type ForAccount = Set; type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type Available = S::Available; type CreatedAt = S::CreatedAt; type Uses = S::Uses; + type Disabled = S::Disabled; type Code = S::Code; - type Available = S::Available; - type Disabled = Set; + type ForAccount = S::ForAccount; + type CreatedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `for_account` field - pub struct for_account(()); - ///Marker type for the `created_by` field - pub struct created_by(()); + ///Marker type for the `available` field + pub struct available(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `uses` field pub struct uses(()); - ///Marker type for the `code` field - pub struct code(()); - ///Marker type for the `available` field - pub struct available(()); ///Marker type for the `disabled` field pub struct disabled(()); + ///Marker type for the `code` field + pub struct code(()); + ///Marker type for the `for_account` field + pub struct for_account(()); + ///Marker type for the `created_by` field + pub struct created_by(()); } } @@ -359,13 +359,13 @@ where impl<'a, S> InviteCodeBuilder<'a, S> where S: invite_code_state::State, - S::ForAccount: invite_code_state::IsSet, - S::CreatedBy: invite_code_state::IsSet, + S::Available: invite_code_state::IsSet, S::CreatedAt: invite_code_state::IsSet, S::Uses: invite_code_state::IsSet, - S::Code: invite_code_state::IsSet, - S::Available: invite_code_state::IsSet, S::Disabled: invite_code_state::IsSet, + S::Code: invite_code_state::IsSet, + S::ForAccount: invite_code_state::IsSet, + S::CreatedBy: invite_code_state::IsSet, { /// Build the final struct pub fn build(self) -> InviteCode<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/create_app_password.rs b/crates/weaver-api/src/com_atproto/server/create_app_password.rs index 9796b09..112e670 100644 --- a/crates/weaver-api/src/com_atproto/server/create_app_password.rs +++ b/crates/weaver-api/src/com_atproto/server/create_app_password.rs @@ -36,51 +36,51 @@ pub mod app_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Password; type Name; type CreatedAt; + type Password; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Password = Unset; type Name = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `password` field to Set - pub struct SetPassword(PhantomData S>); - impl sealed::Sealed for SetPassword {} - impl State for SetPassword { - type Password = Set; - type Name = S::Name; - type CreatedAt = S::CreatedAt; + type Password = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Password = S::Password; type Name = Set; type CreatedAt = S::CreatedAt; + type Password = S::Password; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Password = S::Password; type Name = S::Name; type CreatedAt = Set; + type Password = S::Password; + } + ///State transition - sets the `password` field to Set + pub struct SetPassword(PhantomData S>); + impl sealed::Sealed for SetPassword {} + impl State for SetPassword { + type Name = S::Name; + type CreatedAt = S::CreatedAt; + type Password = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `password` field - pub struct password(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `password` field + pub struct password(()); } } @@ -187,9 +187,9 @@ impl<'a, S: app_password_state::State> AppPasswordBuilder<'a, S> { impl<'a, S> AppPasswordBuilder<'a, S> where S: app_password_state::State, - S::Password: app_password_state::IsSet, S::Name: app_password_state::IsSet, S::CreatedAt: app_password_state::IsSet, + S::Password: app_password_state::IsSet, { /// Build the final struct pub fn build(self) -> AppPassword<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs b/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs index 829d545..eace7a5 100644 --- a/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs +++ b/crates/weaver-api/src/com_atproto/server/create_invite_codes.rs @@ -33,37 +33,37 @@ pub mod account_codes_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Account; type Codes; + type Account; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Account = Unset; type Codes = Unset; - } - ///State transition - sets the `account` field to Set - pub struct SetAccount(PhantomData S>); - impl sealed::Sealed for SetAccount {} - impl State for SetAccount { - type Account = Set; - type Codes = S::Codes; + type Account = Unset; } ///State transition - sets the `codes` field to Set pub struct SetCodes(PhantomData S>); impl sealed::Sealed for SetCodes {} impl State for SetCodes { - type Account = S::Account; type Codes = Set; + type Account = S::Account; + } + ///State transition - sets the `account` field to Set + pub struct SetAccount(PhantomData S>); + impl sealed::Sealed for SetAccount {} + impl State for SetAccount { + type Codes = S::Codes; + type Account = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `account` field - pub struct account(()); ///Marker type for the `codes` field pub struct codes(()); + ///Marker type for the `account` field + pub struct account(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> AccountCodesBuilder<'a, S> where S: account_codes_state::State, - S::Account: account_codes_state::IsSet, S::Codes: account_codes_state::IsSet, + S::Account: account_codes_state::IsSet, { /// Build the final struct pub fn build(self) -> AccountCodes<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/delete_account.rs b/crates/weaver-api/src/com_atproto/server/delete_account.rs index 621258d..9805d89 100644 --- a/crates/weaver-api/src/com_atproto/server/delete_account.rs +++ b/crates/weaver-api/src/com_atproto/server/delete_account.rs @@ -35,51 +35,51 @@ pub mod delete_account_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Token; type Did; type Password; + type Token; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Token = Unset; type Did = Unset; type Password = Unset; - } - ///State transition - sets the `token` field to Set - pub struct SetToken(PhantomData S>); - impl sealed::Sealed for SetToken {} - impl State for SetToken { - type Token = Set; - type Did = S::Did; - type Password = S::Password; + type Token = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Token = S::Token; type Did = Set; type Password = S::Password; + type Token = S::Token; } ///State transition - sets the `password` field to Set pub struct SetPassword(PhantomData S>); impl sealed::Sealed for SetPassword {} impl State for SetPassword { - type Token = S::Token; type Did = S::Did; type Password = Set; + type Token = S::Token; + } + ///State transition - sets the `token` field to Set + pub struct SetToken(PhantomData S>); + impl sealed::Sealed for SetToken {} + impl State for SetToken { + type Did = S::Did; + type Password = S::Password; + type Token = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `token` field - pub struct token(()); ///Marker type for the `did` field pub struct did(()); ///Marker type for the `password` field pub struct password(()); + ///Marker type for the `token` field + pub struct token(()); } } @@ -172,9 +172,9 @@ where impl<'a, S> DeleteAccountBuilder<'a, S> where S: delete_account_state::State, - S::Token: delete_account_state::IsSet, S::Did: delete_account_state::IsSet, S::Password: delete_account_state::IsSet, + S::Token: delete_account_state::IsSet, { /// Build the final struct pub fn build(self) -> DeleteAccount<'a> { diff --git a/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs b/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs index 905d864..0500c91 100644 --- a/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs +++ b/crates/weaver-api/src/com_atproto/server/list_app_passwords.rs @@ -34,37 +34,37 @@ pub mod app_password_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Name; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Name = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Name = S::Name; + type CreatedAt = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type CreatedAt = S::CreatedAt; type Name = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Name = S::Name; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -151,8 +151,8 @@ impl<'a, S: app_password_state::State> AppPasswordBuilder<'a, S> { impl<'a, S> AppPasswordBuilder<'a, S> where S: app_password_state::State, - S::CreatedAt: app_password_state::IsSet, S::Name: app_password_state::IsSet, + S::CreatedAt: app_password_state::IsSet, { /// Build the final struct pub fn build(self) -> AppPassword<'a> { diff --git a/crates/weaver-api/src/com_atproto/sync/get_blob.rs b/crates/weaver-api/src/com_atproto/sync/get_blob.rs index e7c670d..549b7a1 100644 --- a/crates/weaver-api/src/com_atproto/sync/get_blob.rs +++ b/crates/weaver-api/src/com_atproto/sync/get_blob.rs @@ -32,37 +32,37 @@ pub mod get_blob_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Did; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Did = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Did = S::Did; + type Cid = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type Cid = S::Cid; type Did = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Did = S::Did; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> GetBlobBuilder<'a, S> where S: get_blob_state::State, - S::Cid: get_blob_state::IsSet, S::Did: get_blob_state::IsSet, + S::Cid: get_blob_state::IsSet, { /// Build the final struct pub fn build(self) -> GetBlob<'a> { diff --git a/crates/weaver-api/src/com_atproto/sync/get_blocks.rs b/crates/weaver-api/src/com_atproto/sync/get_blocks.rs index 3022ba6..4c82750 100644 --- a/crates/weaver-api/src/com_atproto/sync/get_blocks.rs +++ b/crates/weaver-api/src/com_atproto/sync/get_blocks.rs @@ -32,37 +32,37 @@ pub mod get_blocks_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Cids; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Cids = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Cids = S::Cids; + type Did = Unset; } ///State transition - sets the `cids` field to Set pub struct SetCids(PhantomData S>); impl sealed::Sealed for SetCids {} impl State for SetCids { - type Did = S::Did; type Cids = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Cids = S::Cids; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `cids` field pub struct cids(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> GetBlocksBuilder<'a, S> where S: get_blocks_state::State, - S::Did: get_blocks_state::IsSet, S::Cids: get_blocks_state::IsSet, + S::Did: get_blocks_state::IsSet, { /// Build the final struct pub fn build(self) -> GetBlocks<'a> { diff --git a/crates/weaver-api/src/com_atproto/sync/get_record.rs b/crates/weaver-api/src/com_atproto/sync/get_record.rs index 415a6f2..45509de 100644 --- a/crates/weaver-api/src/com_atproto/sync/get_record.rs +++ b/crates/weaver-api/src/com_atproto/sync/get_record.rs @@ -36,49 +36,49 @@ pub mod get_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Rkey; + type Did; type Collection; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Rkey = Unset; + type Did = Unset; type Collection = Unset; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Rkey = S::Rkey; - type Collection = S::Collection; - } ///State transition - sets the `rkey` field to Set pub struct SetRkey(PhantomData S>); impl sealed::Sealed for SetRkey {} impl State for SetRkey { - type Did = S::Did; type Rkey = Set; + type Did = S::Did; + type Collection = S::Collection; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Rkey = S::Rkey; + type Did = Set; type Collection = S::Collection; } ///State transition - sets the `collection` field to Set pub struct SetCollection(PhantomData S>); impl sealed::Sealed for SetCollection {} impl State for SetCollection { - type Did = S::Did; type Rkey = S::Rkey; + type Did = S::Did; type Collection = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `rkey` field pub struct rkey(()); + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `collection` field pub struct collection(()); } @@ -181,8 +181,8 @@ where impl<'a, S> GetRecordBuilder<'a, S> where S: get_record_state::State, - S::Did: get_record_state::IsSet, S::Rkey: get_record_state::IsSet, + S::Did: get_record_state::IsSet, S::Collection: get_record_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/com_atproto/sync/list_repos.rs b/crates/weaver-api/src/com_atproto/sync/list_repos.rs index a6ef385..5a4ba79 100644 --- a/crates/weaver-api/src/com_atproto/sync/list_repos.rs +++ b/crates/weaver-api/src/com_atproto/sync/list_repos.rs @@ -194,51 +194,51 @@ pub mod repo_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Head; type Rev; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Head = Unset; type Rev = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Head = S::Head; - type Rev = S::Rev; + type Did = Unset; } ///State transition - sets the `head` field to Set pub struct SetHead(PhantomData S>); impl sealed::Sealed for SetHead {} impl State for SetHead { - type Did = S::Did; type Head = Set; type Rev = S::Rev; + type Did = S::Did; } ///State transition - sets the `rev` field to Set pub struct SetRev(PhantomData S>); impl sealed::Sealed for SetRev {} impl State for SetRev { - type Did = S::Did; type Head = S::Head; type Rev = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Head = S::Head; + type Rev = S::Rev; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `head` field pub struct head(()); ///Marker type for the `rev` field pub struct rev(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -362,9 +362,9 @@ impl<'a, S: repo_state::State> RepoBuilder<'a, S> { impl<'a, S> RepoBuilder<'a, S> where S: repo_state::State, - S::Did: repo_state::IsSet, S::Head: repo_state::IsSet, S::Rev: repo_state::IsSet, + S::Did: repo_state::IsSet, { /// Build the final struct pub fn build(self) -> Repo<'a> { diff --git a/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs b/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs index c44d0d9..4ae22f2 100644 --- a/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs +++ b/crates/weaver-api/src/com_atproto/sync/subscribe_repos.rs @@ -41,66 +41,66 @@ pub mod account_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; - type Time; type Seq; type Active; + type Time; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; - type Time = Unset; type Seq = Unset; type Active = Unset; + type Time = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; - type Time = S::Time; - type Seq = S::Seq; - type Active = S::Active; - } - ///State transition - sets the `time` field to Set - pub struct SetTime(PhantomData S>); - impl sealed::Sealed for SetTime {} - impl State for SetTime { - type Did = S::Did; - type Time = Set; type Seq = S::Seq; type Active = S::Active; + type Time = S::Time; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData S>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { type Did = S::Did; - type Time = S::Time; type Seq = Set; type Active = S::Active; + type Time = S::Time; } ///State transition - sets the `active` field to Set pub struct SetActive(PhantomData S>); impl sealed::Sealed for SetActive {} impl State for SetActive { type Did = S::Did; - type Time = S::Time; type Seq = S::Seq; type Active = Set; + type Time = S::Time; + } + ///State transition - sets the `time` field to Set + pub struct SetTime(PhantomData S>); + impl sealed::Sealed for SetTime {} + impl State for SetTime { + type Did = S::Did; + type Seq = S::Seq; + type Active = S::Active; + type Time = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `time` field - pub struct time(()); ///Marker type for the `seq` field pub struct seq(()); ///Marker type for the `active` field pub struct active(()); + ///Marker type for the `time` field + pub struct time(()); } } @@ -231,9 +231,9 @@ impl<'a, S> AccountBuilder<'a, S> where S: account_state::State, S::Did: account_state::IsSet, - S::Time: account_state::IsSet, S::Seq: account_state::IsSet, S::Active: account_state::IsSet, + S::Time: account_state::IsSet, { /// Build the final struct pub fn build(self) -> Account<'a> { @@ -967,205 +967,205 @@ pub mod commit_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Time; + type Seq; type Rebase; + type Time; + type Ops; type Repo; - type Blocks; - type Seq; type Commit; - type Blobs; - type Ops; type Rev; + type Blobs; type TooBig; + type Blocks; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Time = Unset; + type Seq = Unset; type Rebase = Unset; + type Time = Unset; + type Ops = Unset; type Repo = Unset; - type Blocks = Unset; - type Seq = Unset; type Commit = Unset; - type Blobs = Unset; - type Ops = Unset; type Rev = Unset; + type Blobs = Unset; type TooBig = Unset; + type Blocks = Unset; } - ///State transition - sets the `time` field to Set - pub struct SetTime(PhantomData S>); - impl sealed::Sealed for SetTime {} - impl State for SetTime { - type Time = Set; + ///State transition - sets the `seq` field to Set + pub struct SetSeq(PhantomData S>); + impl sealed::Sealed for SetSeq {} + impl State for SetSeq { + type Seq = Set; type Rebase = S::Rebase; + type Time = S::Time; + type Ops = S::Ops; type Repo = S::Repo; - type Blocks = S::Blocks; - type Seq = S::Seq; type Commit = S::Commit; - type Blobs = S::Blobs; - type Ops = S::Ops; type Rev = S::Rev; + type Blobs = S::Blobs; type TooBig = S::TooBig; + type Blocks = S::Blocks; } ///State transition - sets the `rebase` field to Set pub struct SetRebase(PhantomData S>); impl sealed::Sealed for SetRebase {} impl State for SetRebase { - type Time = S::Time; + type Seq = S::Seq; type Rebase = Set; + type Time = S::Time; + type Ops = S::Ops; type Repo = S::Repo; - type Blocks = S::Blocks; - type Seq = S::Seq; type Commit = S::Commit; - type Blobs = S::Blobs; - type Ops = S::Ops; type Rev = S::Rev; + type Blobs = S::Blobs; type TooBig = S::TooBig; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { - type Time = S::Time; - type Rebase = S::Rebase; - type Repo = Set; type Blocks = S::Blocks; + } + ///State transition - sets the `time` field to Set + pub struct SetTime(PhantomData S>); + impl sealed::Sealed for SetTime {} + impl State for SetTime { type Seq = S::Seq; - type Commit = S::Commit; - type Blobs = S::Blobs; + type Rebase = S::Rebase; + type Time = Set; type Ops = S::Ops; + type Repo = S::Repo; + type Commit = S::Commit; type Rev = S::Rev; + type Blobs = S::Blobs; type TooBig = S::TooBig; + type Blocks = S::Blocks; } - ///State transition - sets the `blocks` field to Set - pub struct SetBlocks(PhantomData S>); - impl sealed::Sealed for SetBlocks {} - impl State for SetBlocks { - type Time = S::Time; + ///State transition - sets the `ops` field to Set + pub struct SetOps(PhantomData S>); + impl sealed::Sealed for SetOps {} + impl State for SetOps { + type Seq = S::Seq; type Rebase = S::Rebase; + type Time = S::Time; + type Ops = Set; type Repo = S::Repo; - type Blocks = Set; - type Seq = S::Seq; type Commit = S::Commit; - type Blobs = S::Blobs; - type Ops = S::Ops; type Rev = S::Rev; + type Blobs = S::Blobs; type TooBig = S::TooBig; + type Blocks = S::Blocks; } - ///State transition - sets the `seq` field to Set - pub struct SetSeq(PhantomData S>); - impl sealed::Sealed for SetSeq {} - impl State for SetSeq { - type Time = S::Time; + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Seq = S::Seq; type Rebase = S::Rebase; - type Repo = S::Repo; - type Blocks = S::Blocks; - type Seq = Set; - type Commit = S::Commit; - type Blobs = S::Blobs; + type Time = S::Time; type Ops = S::Ops; + type Repo = Set; + type Commit = S::Commit; type Rev = S::Rev; + type Blobs = S::Blobs; type TooBig = S::TooBig; + type Blocks = S::Blocks; } ///State transition - sets the `commit` field to Set pub struct SetCommit(PhantomData S>); impl sealed::Sealed for SetCommit {} impl State for SetCommit { - type Time = S::Time; + type Seq = S::Seq; type Rebase = S::Rebase; + type Time = S::Time; + type Ops = S::Ops; type Repo = S::Repo; - type Blocks = S::Blocks; - type Seq = S::Seq; type Commit = Set; + type Rev = S::Rev; type Blobs = S::Blobs; + type TooBig = S::TooBig; + type Blocks = S::Blocks; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Seq = S::Seq; + type Rebase = S::Rebase; + type Time = S::Time; type Ops = S::Ops; - type Rev = S::Rev; + type Repo = S::Repo; + type Commit = S::Commit; + type Rev = Set; + type Blobs = S::Blobs; type TooBig = S::TooBig; + type Blocks = S::Blocks; } ///State transition - sets the `blobs` field to Set pub struct SetBlobs(PhantomData S>); impl sealed::Sealed for SetBlobs {} impl State for SetBlobs { - type Time = S::Time; - type Rebase = S::Rebase; - type Repo = S::Repo; - type Blocks = S::Blocks; type Seq = S::Seq; - type Commit = S::Commit; - type Blobs = Set; - type Ops = S::Ops; - type Rev = S::Rev; - type TooBig = S::TooBig; - } - ///State transition - sets the `ops` field to Set - pub struct SetOps(PhantomData S>); - impl sealed::Sealed for SetOps {} - impl State for SetOps { - type Time = S::Time; type Rebase = S::Rebase; + type Time = S::Time; + type Ops = S::Ops; type Repo = S::Repo; - type Blocks = S::Blocks; - type Seq = S::Seq; type Commit = S::Commit; - type Blobs = S::Blobs; - type Ops = Set; type Rev = S::Rev; + type Blobs = Set; type TooBig = S::TooBig; - } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Time = S::Time; - type Rebase = S::Rebase; - type Repo = S::Repo; type Blocks = S::Blocks; - type Seq = S::Seq; - type Commit = S::Commit; - type Blobs = S::Blobs; - type Ops = S::Ops; - type Rev = Set; - type TooBig = S::TooBig; } ///State transition - sets the `too_big` field to Set pub struct SetTooBig(PhantomData S>); impl sealed::Sealed for SetTooBig {} impl State for SetTooBig { - type Time = S::Time; + type Seq = S::Seq; type Rebase = S::Rebase; + type Time = S::Time; + type Ops = S::Ops; type Repo = S::Repo; - type Blocks = S::Blocks; - type Seq = S::Seq; type Commit = S::Commit; + type Rev = S::Rev; type Blobs = S::Blobs; + type TooBig = Set; + type Blocks = S::Blocks; + } + ///State transition - sets the `blocks` field to Set + pub struct SetBlocks(PhantomData S>); + impl sealed::Sealed for SetBlocks {} + impl State for SetBlocks { + type Seq = S::Seq; + type Rebase = S::Rebase; + type Time = S::Time; type Ops = S::Ops; + type Repo = S::Repo; + type Commit = S::Commit; type Rev = S::Rev; - type TooBig = Set; + type Blobs = S::Blobs; + type TooBig = S::TooBig; + type Blocks = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `time` field - pub struct time(()); + ///Marker type for the `seq` field + pub struct seq(()); ///Marker type for the `rebase` field pub struct rebase(()); + ///Marker type for the `time` field + pub struct time(()); + ///Marker type for the `ops` field + pub struct ops(()); ///Marker type for the `repo` field pub struct repo(()); - ///Marker type for the `blocks` field - pub struct blocks(()); - ///Marker type for the `seq` field - pub struct seq(()); ///Marker type for the `commit` field pub struct commit(()); - ///Marker type for the `blobs` field - pub struct blobs(()); - ///Marker type for the `ops` field - pub struct ops(()); ///Marker type for the `rev` field pub struct rev(()); + ///Marker type for the `blobs` field + pub struct blobs(()); ///Marker type for the `too_big` field pub struct too_big(()); + ///Marker type for the `blocks` field + pub struct blocks(()); } } @@ -1453,16 +1453,16 @@ where impl<'a, S> CommitBuilder<'a, S> where S: commit_state::State, - S::Time: commit_state::IsSet, + S::Seq: commit_state::IsSet, S::Rebase: commit_state::IsSet, + S::Time: commit_state::IsSet, + S::Ops: commit_state::IsSet, S::Repo: commit_state::IsSet, - S::Blocks: commit_state::IsSet, - S::Seq: commit_state::IsSet, S::Commit: commit_state::IsSet, - S::Blobs: commit_state::IsSet, - S::Ops: commit_state::IsSet, S::Rev: commit_state::IsSet, + S::Blobs: commit_state::IsSet, S::TooBig: commit_state::IsSet, + S::Blocks: commit_state::IsSet, { /// Build the final struct pub fn build(self) -> Commit<'a> { @@ -1571,51 +1571,51 @@ pub mod identity_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Time; - type Seq; type Did; + type Seq; + type Time; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Time = Unset; - type Seq = Unset; type Did = Unset; + type Seq = Unset; + type Time = Unset; } - ///State transition - sets the `time` field to Set - pub struct SetTime(PhantomData S>); - impl sealed::Sealed for SetTime {} - impl State for SetTime { - type Time = Set; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; type Seq = S::Seq; - type Did = S::Did; + type Time = S::Time; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData S>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { - type Time = S::Time; - type Seq = Set; type Did = S::Did; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { + type Seq = Set; type Time = S::Time; + } + ///State transition - sets the `time` field to Set + pub struct SetTime(PhantomData S>); + impl sealed::Sealed for SetTime {} + impl State for SetTime { + type Did = S::Did; type Seq = S::Seq; - type Did = Set; + type Time = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `time` field - pub struct time(()); - ///Marker type for the `seq` field - pub struct seq(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `seq` field + pub struct seq(()); + ///Marker type for the `time` field + pub struct time(()); } } @@ -1728,9 +1728,9 @@ where impl<'a, S> IdentityBuilder<'a, S> where S: identity_state::State, - S::Time: identity_state::IsSet, - S::Seq: identity_state::IsSet, S::Did: identity_state::IsSet, + S::Seq: identity_state::IsSet, + S::Time: identity_state::IsSet, { /// Build the final struct pub fn build(self) -> Identity<'a> { @@ -2297,85 +2297,85 @@ pub mod sync_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Rev; - type Time; + type Did; type Seq; type Blocks; - type Did; + type Time; + type Rev; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Rev = Unset; - type Time = Unset; + type Did = Unset; type Seq = Unset; type Blocks = Unset; - type Did = Unset; + type Time = Unset; + type Rev = Unset; } - ///State transition - sets the `rev` field to Set - pub struct SetRev(PhantomData S>); - impl sealed::Sealed for SetRev {} - impl State for SetRev { - type Rev = Set; - type Time = S::Time; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; type Seq = S::Seq; type Blocks = S::Blocks; - type Did = S::Did; - } - ///State transition - sets the `time` field to Set - pub struct SetTime(PhantomData S>); - impl sealed::Sealed for SetTime {} - impl State for SetTime { + type Time = S::Time; type Rev = S::Rev; - type Time = Set; - type Seq = S::Seq; - type Blocks = S::Blocks; - type Did = S::Did; } ///State transition - sets the `seq` field to Set pub struct SetSeq(PhantomData S>); impl sealed::Sealed for SetSeq {} impl State for SetSeq { - type Rev = S::Rev; - type Time = S::Time; + type Did = S::Did; type Seq = Set; type Blocks = S::Blocks; - type Did = S::Did; + type Time = S::Time; + type Rev = S::Rev; } ///State transition - sets the `blocks` field to Set pub struct SetBlocks(PhantomData S>); impl sealed::Sealed for SetBlocks {} impl State for SetBlocks { - type Rev = S::Rev; - type Time = S::Time; + type Did = S::Did; type Seq = S::Seq; type Blocks = Set; - type Did = S::Did; + type Time = S::Time; + type Rev = S::Rev; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { + ///State transition - sets the `time` field to Set + pub struct SetTime(PhantomData S>); + impl sealed::Sealed for SetTime {} + impl State for SetTime { + type Did = S::Did; + type Seq = S::Seq; + type Blocks = S::Blocks; + type Time = Set; type Rev = S::Rev; - type Time = S::Time; + } + ///State transition - sets the `rev` field to Set + pub struct SetRev(PhantomData S>); + impl sealed::Sealed for SetRev {} + impl State for SetRev { + type Did = S::Did; type Seq = S::Seq; type Blocks = S::Blocks; - type Did = Set; + type Time = S::Time; + type Rev = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `rev` field - pub struct rev(()); - ///Marker type for the `time` field - pub struct time(()); + ///Marker type for the `did` field + pub struct did(()); ///Marker type for the `seq` field pub struct seq(()); ///Marker type for the `blocks` field pub struct blocks(()); - ///Marker type for the `did` field - pub struct did(()); + ///Marker type for the `time` field + pub struct time(()); + ///Marker type for the `rev` field + pub struct rev(()); } } @@ -2508,11 +2508,11 @@ where impl<'a, S> SyncBuilder<'a, S> where S: sync_state::State, - S::Rev: sync_state::IsSet, - S::Time: sync_state::IsSet, + S::Did: sync_state::IsSet, S::Seq: sync_state::IsSet, S::Blocks: sync_state::IsSet, - S::Did: sync_state::IsSet, + S::Time: sync_state::IsSet, + S::Rev: sync_state::IsSet, { /// Build the final struct pub fn build(self) -> Sync<'a> { diff --git a/crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs b/crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs index 6590cd1..3a09b2d 100644 --- a/crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs +++ b/crates/weaver-api/src/com_atproto/temp/check_handle_availability.rs @@ -692,37 +692,37 @@ pub mod suggestion_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Handle; type Method; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Handle = Unset; type Method = Unset; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type Handle = Set; - type Method = S::Method; + type Handle = Unset; } ///State transition - sets the `method` field to Set pub struct SetMethod(PhantomData S>); impl sealed::Sealed for SetMethod {} impl State for SetMethod { - type Handle = S::Handle; type Method = Set; + type Handle = S::Handle; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Method = S::Method; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `method` field pub struct method(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -795,8 +795,8 @@ where impl<'a, S> SuggestionBuilder<'a, S> where S: suggestion_state::State, - S::Handle: suggestion_state::IsSet, S::Method: suggestion_state::IsSet, + S::Handle: suggestion_state::IsSet, { /// Build the final struct pub fn build(self) -> Suggestion<'a> { diff --git a/crates/weaver-api/src/sh_weaver.rs b/crates/weaver-api/src/sh_weaver.rs index 7ff2610..d910987 100644 --- a/crates/weaver-api/src/sh_weaver.rs +++ b/crates/weaver-api/src/sh_weaver.rs @@ -9,4 +9,5 @@ pub mod edit; pub mod embed; pub mod graph; pub mod notebook; +pub mod notification; pub mod publish; \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/actor.rs b/crates/weaver-api/src/sh_weaver/actor.rs index c1f7bcd..f655532 100644 --- a/crates/weaver-api/src/sh_weaver/actor.rs +++ b/crates/weaver-api/src/sh_weaver/actor.rs @@ -5,8 +5,13 @@ // This file was automatically generated from Lexicon schemas. // Any manual changes will be overwritten on the next regeneration. +pub mod get_actor_entries; +pub mod get_actor_notebooks; pub mod get_profile; +pub mod get_suggested_authors; pub mod profile; +pub mod search_actors; +pub mod search_actors_typeahead; /// A single author in a Weaver notebook. #[jacquard_derive::lexicon] @@ -231,6 +236,58 @@ fn lexicon_doc_sh_weaver_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc properties: { #[allow(unused_mut)] let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "collaborationCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "entryCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followerCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followingCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("inner"), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { @@ -243,6 +300,26 @@ fn lexicon_doc_sh_weaver_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc closed: None, }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "notebookCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewer"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#viewerState"), + }), + ); map }, }), @@ -258,6 +335,32 @@ fn lexicon_doc_sh_weaver_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc properties: { #[allow(unused_mut)] let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followerCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followingCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("inner"), ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { @@ -270,6 +373,15 @@ fn lexicon_doc_sh_weaver_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc closed: None, }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewer"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#viewerStateBasic", + ), + }), + ); map }, }), @@ -726,6 +838,72 @@ fn lexicon_doc_sh_weaver_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc max_length: Some(5usize), }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("subscribedNotebook"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A notebook the viewer subscribes to without a global follow.", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("uri")], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("path"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tangledProfileView"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { @@ -903,113 +1081,489 @@ fn lexicon_doc_sh_weaver_actor_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc }, }), ); - map - }, - } -} - -impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Author<'a> { - fn nsid() -> &'static str { - "sh.weaver.actor.defs" - } - fn def_name() -> &'static str { - "author" - } - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { - lexicon_doc_sh_weaver_actor_defs() - } - fn validate( - &self, - ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { - Ok(()) - } -} - -pub type PinnedList<'a> = Vec>; -#[jacquard_derive::lexicon] -#[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic -)] -#[serde(rename_all = "camelCase")] -pub struct ProfileDataView<'a> { - #[serde(borrow)] - pub inner: ProfileDataViewInner<'a>, -} - -pub mod profile_data_view_state { - - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; - #[allow(unused)] - use ::core::marker::PhantomData; - mod sealed { - pub trait Sealed {} - } - /// State trait tracking which required fields have been set - pub trait State: sealed::Sealed { - type Inner; - } - /// Empty state - all required fields are unset - pub struct Empty(()); - impl sealed::Sealed for Empty {} - impl State for Empty { - type Inner = Unset; - } - ///State transition - sets the `inner` field to Set - pub struct SetInner(PhantomData S>); - impl sealed::Sealed for SetInner {} - impl State for SetInner { - type Inner = Set; - } - /// Marker types for field names - #[allow(non_camel_case_types)] - pub mod members { - ///Marker type for the `inner` field - pub struct inner(()); - } -} - -/// Builder for constructing an instance of this type -pub struct ProfileDataViewBuilder<'a, S: profile_data_view_state::State> { - _phantom_state: ::core::marker::PhantomData S>, - __unsafe_private_named: (::core::option::Option>,), - _phantom: ::core::marker::PhantomData<&'a ()>, -} - -impl<'a> ProfileDataView<'a> { - /// Create a new builder for this type - pub fn new() -> ProfileDataViewBuilder<'a, profile_data_view_state::Empty> { - ProfileDataViewBuilder::new() - } -} - -impl<'a> ProfileDataViewBuilder<'a, profile_data_view_state::Empty> { - /// Create a new builder with all fields unset - pub fn new() -> Self { - ProfileDataViewBuilder { - _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None,), - _phantom: ::core::marker::PhantomData, - } - } -} - -impl<'a, S> ProfileDataViewBuilder<'a, S> -where - S: profile_data_view_state::State, - S::Inner: profile_data_view_state::IsUnset, -{ - /// Set the `inner` field (required) - pub fn inner( - mut self, + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewerState"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Viewer's relationship state with an actor (detailed version).", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blocked"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "blockedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followRequested", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followRequestedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "following", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("muted"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subscribedNotebooks", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#subscribedNotebook", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewerStateBasic"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Viewer's relationship state with an actor (basic version).", + ), + ), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("blocked"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "blockedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followRequested", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followRequestedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "followedBy", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "following", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("muted"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subscribedNotebookCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Author<'a> { + fn nsid() -> &'static str { + "sh.weaver.actor.defs" + } + fn def_name() -> &'static str { + "author" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +pub type PinnedList<'a> = Vec>; +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ProfileDataView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub collaboration_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub entry_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub follower_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub following_count: std::option::Option, + #[serde(borrow)] + pub inner: ProfileDataViewInner<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub notebook_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: std::option::Option>, +} + +pub mod profile_data_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Inner; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Inner = Unset; + } + ///State transition - sets the `inner` field to Set + pub struct SetInner(PhantomData S>); + impl sealed::Sealed for SetInner {} + impl State for SetInner { + type Inner = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `inner` field + pub struct inner(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ProfileDataViewBuilder<'a, S: profile_data_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ProfileDataView<'a> { + /// Create a new builder for this type + pub fn new() -> ProfileDataViewBuilder<'a, profile_data_view_state::Empty> { + ProfileDataViewBuilder::new() + } +} + +impl<'a> ProfileDataViewBuilder<'a, profile_data_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ProfileDataViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { + /// Set the `collaborationCount` field (optional) + pub fn collaboration_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `collaborationCount` field to an Option value (optional) + pub fn maybe_collaboration_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { + /// Set the `entryCount` field (optional) + pub fn entry_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `entryCount` field to an Option value (optional) + pub fn maybe_entry_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { + /// Set the `followerCount` field (optional) + pub fn follower_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `followerCount` field to an Option value (optional) + pub fn maybe_follower_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { + /// Set the `followingCount` field (optional) + pub fn following_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `followingCount` field to an Option value (optional) + pub fn maybe_following_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> ProfileDataViewBuilder<'a, S> +where + S: profile_data_view_state::State, + S::Inner: profile_data_view_state::IsUnset, +{ + /// Set the `inner` field (required) + pub fn inner( + mut self, value: impl Into>, ) -> ProfileDataViewBuilder<'a, profile_data_view_state::SetInner> { - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); ProfileDataViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, @@ -1018,6 +1572,38 @@ where } } +impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { + /// Set the `notebookCount` field (optional) + pub fn notebook_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `notebookCount` field to an Option value (optional) + pub fn maybe_notebook_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: profile_data_view_state::State> ProfileDataViewBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `viewer` field to an Option value (optional) + pub fn maybe_viewer( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + impl<'a, S> ProfileDataViewBuilder<'a, S> where S: profile_data_view_state::State, @@ -1026,7 +1612,13 @@ where /// Build the final struct pub fn build(self) -> ProfileDataView<'a> { ProfileDataView { - inner: self.__unsafe_private_named.0.unwrap(), + collaboration_count: self.__unsafe_private_named.0, + entry_count: self.__unsafe_private_named.1, + follower_count: self.__unsafe_private_named.2, + following_count: self.__unsafe_private_named.3, + inner: self.__unsafe_private_named.4.unwrap(), + notebook_count: self.__unsafe_private_named.5, + viewer: self.__unsafe_private_named.6, extra_data: Default::default(), } } @@ -1039,7 +1631,13 @@ where >, ) -> ProfileDataView<'a> { ProfileDataView { - inner: self.__unsafe_private_named.0.unwrap(), + collaboration_count: self.__unsafe_private_named.0, + entry_count: self.__unsafe_private_named.1, + follower_count: self.__unsafe_private_named.2, + following_count: self.__unsafe_private_named.3, + inner: self.__unsafe_private_named.4.unwrap(), + notebook_count: self.__unsafe_private_named.5, + viewer: self.__unsafe_private_named.6, extra_data: Some(extra_data), } } @@ -1095,8 +1693,15 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileDataView<'a> { )] #[serde(rename_all = "camelCase")] pub struct ProfileDataViewBasic<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub follower_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub following_count: std::option::Option, #[serde(borrow)] pub inner: ProfileDataViewBasicInner<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer: std::option::Option>, } pub mod profile_data_view_basic_state { @@ -1134,7 +1739,12 @@ pub mod profile_data_view_basic_state { /// Builder for constructing an instance of this type pub struct ProfileDataViewBasicBuilder<'a, S: profile_data_view_basic_state::State> { _phantom_state: ::core::marker::PhantomData S>, - __unsafe_private_named: (::core::option::Option>,), + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ), _phantom: ::core::marker::PhantomData<&'a ()>, } @@ -1153,12 +1763,38 @@ impl<'a> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::Empty> { pub fn new() -> Self { ProfileDataViewBasicBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None,), + __unsafe_private_named: (None, None, None, None), _phantom: ::core::marker::PhantomData, } } } +impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> { + /// Set the `followerCount` field (optional) + pub fn follower_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `followerCount` field to an Option value (optional) + pub fn maybe_follower_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> { + /// Set the `followingCount` field (optional) + pub fn following_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `followingCount` field to an Option value (optional) + pub fn maybe_following_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + impl<'a, S> ProfileDataViewBasicBuilder<'a, S> where S: profile_data_view_basic_state::State, @@ -1169,7 +1805,7 @@ where mut self, value: impl Into>, ) -> ProfileDataViewBasicBuilder<'a, profile_data_view_basic_state::SetInner> { - self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); ProfileDataViewBasicBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, @@ -1178,6 +1814,25 @@ where } } +impl<'a, S: profile_data_view_basic_state::State> ProfileDataViewBasicBuilder<'a, S> { + /// Set the `viewer` field (optional) + pub fn viewer( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `viewer` field to an Option value (optional) + pub fn maybe_viewer( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + impl<'a, S> ProfileDataViewBasicBuilder<'a, S> where S: profile_data_view_basic_state::State, @@ -1186,7 +1841,10 @@ where /// Build the final struct pub fn build(self) -> ProfileDataViewBasic<'a> { ProfileDataViewBasic { - inner: self.__unsafe_private_named.0.unwrap(), + follower_count: self.__unsafe_private_named.0, + following_count: self.__unsafe_private_named.1, + inner: self.__unsafe_private_named.2.unwrap(), + viewer: self.__unsafe_private_named.3, extra_data: Default::default(), } } @@ -1199,7 +1857,10 @@ where >, ) -> ProfileDataViewBasic<'a> { ProfileDataViewBasic { - inner: self.__unsafe_private_named.0.unwrap(), + follower_count: self.__unsafe_private_named.0, + following_count: self.__unsafe_private_named.1, + inner: self.__unsafe_private_named.2.unwrap(), + viewer: self.__unsafe_private_named.3, extra_data: Some(extra_data), } } @@ -2106,99 +2767,318 @@ impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { } } -impl<'a, S> ProfileViewBasicBuilder<'a, S> -where - S: profile_view_basic_state::State, - S::Handle: profile_view_basic_state::IsUnset, -{ - /// Set the `handle` field (required) - pub fn handle( - mut self, - value: impl Into>, - ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetHandle> { - self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); - ProfileViewBasicBuilder { +impl<'a, S> ProfileViewBasicBuilder<'a, S> +where + S: profile_view_basic_state::State, + S::Handle: profile_view_basic_state::IsUnset, +{ + /// Set the `handle` field (required) + pub fn handle( + mut self, + value: impl Into>, + ) -> ProfileViewBasicBuilder<'a, profile_view_basic_state::SetHandle> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ProfileViewBasicBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `indexedAt` field (optional) + pub fn indexed_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `indexedAt` field to an Option value (optional) + pub fn maybe_indexed_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `labels` field (optional) + pub fn labels( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `labels` field to an Option value (optional) + pub fn maybe_labels( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { + /// Set the `pronouns` field (optional) + pub fn pronouns( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `pronouns` field to an Option value (optional) + pub fn maybe_pronouns( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S> ProfileViewBasicBuilder<'a, S> +where + S: profile_view_basic_state::State, + S::Did: profile_view_basic_state::IsSet, + S::Handle: profile_view_basic_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ProfileViewBasic<'a> { + ProfileViewBasic { + avatar: self.__unsafe_private_named.0, + created_at: self.__unsafe_private_named.1, + did: self.__unsafe_private_named.2.unwrap(), + display_name: self.__unsafe_private_named.3, + handle: self.__unsafe_private_named.4.unwrap(), + indexed_at: self.__unsafe_private_named.5, + labels: self.__unsafe_private_named.6, + pronouns: self.__unsafe_private_named.7, + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> ProfileViewBasic<'a> { + ProfileViewBasic { + avatar: self.__unsafe_private_named.0, + created_at: self.__unsafe_private_named.1, + did: self.__unsafe_private_named.2.unwrap(), + display_name: self.__unsafe_private_named.3, + handle: self.__unsafe_private_named.4.unwrap(), + indexed_at: self.__unsafe_private_named.5, + labels: self.__unsafe_private_named.6, + pronouns: self.__unsafe_private_named.7, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileViewBasic<'a> { + fn nsid() -> &'static str { + "sh.weaver.actor.defs" + } + fn def_name() -> &'static str { + "profileViewBasic" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.display_name { + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 640usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "display_name", + ), + max: 640usize, + actual: ::len(value.as_ref()), + }); + } + } + if let Some(ref value) = self.display_name { + { + let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( + value.as_ref(), + true, + ) + .count(); + if count > 64usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "display_name", + ), + max: 64usize, + actual: count, + }); + } + } + } + Ok(()) + } +} + +pub type PronounsList<'a> = Vec>; +/// A notebook the viewer subscribes to without a global follow. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SubscribedNotebook<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub path: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub title: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod subscribed_notebook_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Uri; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `uri` field + pub struct uri(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SubscribedNotebookBuilder<'a, S: subscribed_notebook_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SubscribedNotebook<'a> { + /// Create a new builder for this type + pub fn new() -> SubscribedNotebookBuilder<'a, subscribed_notebook_state::Empty> { + SubscribedNotebookBuilder::new() + } +} + +impl<'a> SubscribedNotebookBuilder<'a, subscribed_notebook_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SubscribedNotebookBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: self.__unsafe_private_named, + __unsafe_private_named: (None, None, None), _phantom: ::core::marker::PhantomData, } } } -impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { - /// Set the `indexedAt` field (optional) - pub fn indexed_at( +impl<'a, S: subscribed_notebook_state::State> SubscribedNotebookBuilder<'a, S> { + /// Set the `path` field (optional) + pub fn path( mut self, - value: impl Into>, + value: impl Into>>, ) -> Self { - self.__unsafe_private_named.5 = value.into(); + self.__unsafe_private_named.0 = value.into(); self } - /// Set the `indexedAt` field to an Option value (optional) - pub fn maybe_indexed_at( - mut self, - value: Option, - ) -> Self { - self.__unsafe_private_named.5 = value; + /// Set the `path` field to an Option value (optional) + pub fn maybe_path(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; self } } -impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { - /// Set the `labels` field (optional) - pub fn labels( +impl<'a, S: subscribed_notebook_state::State> SubscribedNotebookBuilder<'a, S> { + /// Set the `title` field (optional) + pub fn title( mut self, - value: impl Into>>>, + value: impl Into>>, ) -> Self { - self.__unsafe_private_named.6 = value.into(); + self.__unsafe_private_named.1 = value.into(); self } - /// Set the `labels` field to an Option value (optional) - pub fn maybe_labels( - mut self, - value: Option>>, - ) -> Self { - self.__unsafe_private_named.6 = value; + /// Set the `title` field to an Option value (optional) + pub fn maybe_title(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; self } } -impl<'a, S: profile_view_basic_state::State> ProfileViewBasicBuilder<'a, S> { - /// Set the `pronouns` field (optional) - pub fn pronouns( - mut self, - value: impl Into>>, - ) -> Self { - self.__unsafe_private_named.7 = value.into(); - self - } - /// Set the `pronouns` field to an Option value (optional) - pub fn maybe_pronouns( +impl<'a, S> SubscribedNotebookBuilder<'a, S> +where + S: subscribed_notebook_state::State, + S::Uri: subscribed_notebook_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( mut self, - value: Option>, - ) -> Self { - self.__unsafe_private_named.7 = value; - self + value: impl Into>, + ) -> SubscribedNotebookBuilder<'a, subscribed_notebook_state::SetUri> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SubscribedNotebookBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } } } -impl<'a, S> ProfileViewBasicBuilder<'a, S> +impl<'a, S> SubscribedNotebookBuilder<'a, S> where - S: profile_view_basic_state::State, - S::Did: profile_view_basic_state::IsSet, - S::Handle: profile_view_basic_state::IsSet, + S: subscribed_notebook_state::State, + S::Uri: subscribed_notebook_state::IsSet, { /// Build the final struct - pub fn build(self) -> ProfileViewBasic<'a> { - ProfileViewBasic { - avatar: self.__unsafe_private_named.0, - created_at: self.__unsafe_private_named.1, - did: self.__unsafe_private_named.2.unwrap(), - display_name: self.__unsafe_private_named.3, - handle: self.__unsafe_private_named.4.unwrap(), - indexed_at: self.__unsafe_private_named.5, - labels: self.__unsafe_private_named.6, - pronouns: self.__unsafe_private_named.7, + pub fn build(self) -> SubscribedNotebook<'a> { + SubscribedNotebook { + path: self.__unsafe_private_named.0, + title: self.__unsafe_private_named.1, + uri: self.__unsafe_private_named.2.unwrap(), extra_data: Default::default(), } } @@ -2209,27 +3089,22 @@ where jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, - ) -> ProfileViewBasic<'a> { - ProfileViewBasic { - avatar: self.__unsafe_private_named.0, - created_at: self.__unsafe_private_named.1, - did: self.__unsafe_private_named.2.unwrap(), - display_name: self.__unsafe_private_named.3, - handle: self.__unsafe_private_named.4.unwrap(), - indexed_at: self.__unsafe_private_named.5, - labels: self.__unsafe_private_named.6, - pronouns: self.__unsafe_private_named.7, + ) -> SubscribedNotebook<'a> { + SubscribedNotebook { + path: self.__unsafe_private_named.0, + title: self.__unsafe_private_named.1, + uri: self.__unsafe_private_named.2.unwrap(), extra_data: Some(extra_data), } } } -impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileViewBasic<'a> { +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SubscribedNotebook<'a> { fn nsid() -> &'static str { "sh.weaver.actor.defs" } fn def_name() -> &'static str { - "profileViewBasic" + "subscribedNotebook" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_actor_defs() @@ -2237,41 +3112,10 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ProfileViewBasic<'a> { fn validate( &self, ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { - if let Some(ref value) = self.display_name { - #[allow(unused_comparisons)] - if ::len(value.as_ref()) > 640usize { - return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { - path: ::jacquard_lexicon::validation::ValidationPath::from_field( - "display_name", - ), - max: 640usize, - actual: ::len(value.as_ref()), - }); - } - } - if let Some(ref value) = self.display_name { - { - let count = ::unicode_segmentation::UnicodeSegmentation::graphemes( - value.as_ref(), - true, - ) - .count(); - if count > 64usize { - return Err(::jacquard_lexicon::validation::ConstraintError::MaxGraphemes { - path: ::jacquard_lexicon::validation::ValidationPath::from_field( - "display_name", - ), - max: 64usize, - actual: count, - }); - } - } - } Ok(()) } } -pub type PronounsList<'a> = Vec>; #[jacquard_derive::lexicon] #[derive( serde::Serialize, @@ -2322,51 +3166,51 @@ pub mod tangled_profile_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; - type Bluesky; type Handle; + type Bluesky; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; - type Bluesky = Unset; type Handle = Unset; + type Bluesky = Unset; + type Did = Unset; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type Handle = Set; type Bluesky = S::Bluesky; - type Handle = S::Handle; + type Did = S::Did; } ///State transition - sets the `bluesky` field to Set pub struct SetBluesky(PhantomData S>); impl sealed::Sealed for SetBluesky {} impl State for SetBluesky { - type Did = S::Did; - type Bluesky = Set; type Handle = S::Handle; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { + type Bluesky = Set; type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Handle = S::Handle; type Bluesky = S::Bluesky; - type Handle = Set; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); - ///Marker type for the `bluesky` field - pub struct bluesky(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `bluesky` field + pub struct bluesky(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -2556,9 +3400,9 @@ impl<'a, S: tangled_profile_view_state::State> TangledProfileViewBuilder<'a, S> impl<'a, S> TangledProfileViewBuilder<'a, S> where S: tangled_profile_view_state::State, - S::Did: tangled_profile_view_state::IsSet, - S::Bluesky: tangled_profile_view_state::IsSet, S::Handle: tangled_profile_view_state::IsSet, + S::Bluesky: tangled_profile_view_state::IsSet, + S::Did: tangled_profile_view_state::IsSet, { /// Build the final struct pub fn build(self) -> TangledProfileView<'a> { @@ -2743,4 +3587,121 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for TangledProfileView<'a> { } Ok(()) } +} + +/// Viewer's relationship state with an actor (detailed version). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ViewerState<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub blocked: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub blocked_by: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub follow_requested: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub follow_requested_by: std::option::Option< + jacquard_common::types::string::AtUri<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub followed_by: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub following: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub muted: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub subscribed_notebooks: std::option::Option< + Vec>, + >, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewerState<'a> { + fn nsid() -> &'static str { + "sh.weaver.actor.defs" + } + fn def_name() -> &'static str { + "viewerState" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Viewer's relationship state with an actor (basic version). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct ViewerStateBasic<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub blocked: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub blocked_by: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub follow_requested: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub follow_requested_by: std::option::Option< + jacquard_common::types::string::AtUri<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub followed_by: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub following: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub muted: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub subscribed_notebook_count: std::option::Option, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ViewerStateBasic<'a> { + fn nsid() -> &'static str { + "sh.weaver.actor.defs" + } + fn def_name() -> &'static str { + "viewerStateBasic" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_actor_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } } \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/actor/get_actor_entries.rs b/crates/weaver-api/src/sh_weaver/actor/get_actor_entries.rs new file mode 100644 index 0000000..03d3a6a --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/actor/get_actor_entries.rs @@ -0,0 +1,214 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.actor.getActorEntries +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorEntries<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// (default: false) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_collaborations: std::option::Option, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_actor_entries_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetActorEntriesBuilder<'a, S: get_actor_entries_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetActorEntries<'a> { + /// Create a new builder for this type + pub fn new() -> GetActorEntriesBuilder<'a, get_actor_entries_state::Empty> { + GetActorEntriesBuilder::new() + } +} + +impl<'a> GetActorEntriesBuilder<'a, get_actor_entries_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetActorEntriesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetActorEntriesBuilder<'a, S> +where + S: get_actor_entries_state::State, + S::Actor: get_actor_entries_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetActorEntriesBuilder<'a, get_actor_entries_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetActorEntriesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_actor_entries_state::State> GetActorEntriesBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_actor_entries_state::State> GetActorEntriesBuilder<'a, S> { + /// Set the `includeCollaborations` field (optional) + pub fn include_collaborations(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `includeCollaborations` field to an Option value (optional) + pub fn maybe_include_collaborations(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_actor_entries_state::State> GetActorEntriesBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> GetActorEntriesBuilder<'a, S> +where + S: get_actor_entries_state::State, + S::Actor: get_actor_entries_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetActorEntries<'a> { + GetActorEntries { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + include_collaborations: self.__unsafe_private_named.2, + limit: self.__unsafe_private_named.3, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorEntriesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub entries: Vec>, +} + +/// Response type for +///sh.weaver.actor.getActorEntries +pub struct GetActorEntriesResponse; +impl jacquard_common::xrpc::XrpcResp for GetActorEntriesResponse { + const NSID: &'static str = "sh.weaver.actor.getActorEntries"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetActorEntriesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorEntries<'a> { + const NSID: &'static str = "sh.weaver.actor.getActorEntries"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetActorEntriesResponse; +} + +/// Endpoint type for +///sh.weaver.actor.getActorEntries +pub struct GetActorEntriesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetActorEntriesRequest { + const PATH: &'static str = "/xrpc/sh.weaver.actor.getActorEntries"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetActorEntries<'de>; + type Response = GetActorEntriesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/actor/get_actor_notebooks.rs b/crates/weaver-api/src/sh_weaver/actor/get_actor_notebooks.rs new file mode 100644 index 0000000..fe937ce --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/actor/get_actor_notebooks.rs @@ -0,0 +1,214 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.actor.getActorNotebooks +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorNotebooks<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// (default: false) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_collaborations: std::option::Option, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_actor_notebooks_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetActorNotebooksBuilder<'a, S: get_actor_notebooks_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetActorNotebooks<'a> { + /// Create a new builder for this type + pub fn new() -> GetActorNotebooksBuilder<'a, get_actor_notebooks_state::Empty> { + GetActorNotebooksBuilder::new() + } +} + +impl<'a> GetActorNotebooksBuilder<'a, get_actor_notebooks_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetActorNotebooksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetActorNotebooksBuilder<'a, S> +where + S: get_actor_notebooks_state::State, + S::Actor: get_actor_notebooks_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetActorNotebooksBuilder<'a, get_actor_notebooks_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetActorNotebooksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_actor_notebooks_state::State> GetActorNotebooksBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_actor_notebooks_state::State> GetActorNotebooksBuilder<'a, S> { + /// Set the `includeCollaborations` field (optional) + pub fn include_collaborations(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `includeCollaborations` field to an Option value (optional) + pub fn maybe_include_collaborations(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_actor_notebooks_state::State> GetActorNotebooksBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> GetActorNotebooksBuilder<'a, S> +where + S: get_actor_notebooks_state::State, + S::Actor: get_actor_notebooks_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetActorNotebooks<'a> { + GetActorNotebooks { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + include_collaborations: self.__unsafe_private_named.2, + limit: self.__unsafe_private_named.3, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorNotebooksOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub notebooks: Vec>, +} + +/// Response type for +///sh.weaver.actor.getActorNotebooks +pub struct GetActorNotebooksResponse; +impl jacquard_common::xrpc::XrpcResp for GetActorNotebooksResponse { + const NSID: &'static str = "sh.weaver.actor.getActorNotebooks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetActorNotebooksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorNotebooks<'a> { + const NSID: &'static str = "sh.weaver.actor.getActorNotebooks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetActorNotebooksResponse; +} + +/// Endpoint type for +///sh.weaver.actor.getActorNotebooks +pub struct GetActorNotebooksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetActorNotebooksRequest { + const PATH: &'static str = "/xrpc/sh.weaver.actor.getActorNotebooks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetActorNotebooks<'de>; + type Response = GetActorNotebooksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/actor/get_suggested_authors.rs b/crates/weaver-api/src/sh_weaver/actor/get_suggested_authors.rs new file mode 100644 index 0000000..fd950af --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/actor/get_suggested_authors.rs @@ -0,0 +1,131 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.actor.getSuggestedAuthors +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetSuggestedAuthors { + ///(default: 20, min: 1, max: 50) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_suggested_authors_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct GetSuggestedAuthorsBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), +} + +impl GetSuggestedAuthors { + /// Create a new builder for this type + pub fn new() -> GetSuggestedAuthorsBuilder { + GetSuggestedAuthorsBuilder::new() + } +} + +impl GetSuggestedAuthorsBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSuggestedAuthorsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl GetSuggestedAuthorsBuilder { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl GetSuggestedAuthorsBuilder +where + S: get_suggested_authors_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSuggestedAuthors { + GetSuggestedAuthors { + limit: self.__unsafe_private_named.0, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetSuggestedAuthorsOutput<'a> { + #[serde(borrow)] + pub authors: Vec>, +} + +/// Response type for +///sh.weaver.actor.getSuggestedAuthors +pub struct GetSuggestedAuthorsResponse; +impl jacquard_common::xrpc::XrpcResp for GetSuggestedAuthorsResponse { + const NSID: &'static str = "sh.weaver.actor.getSuggestedAuthors"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSuggestedAuthorsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetSuggestedAuthors { + const NSID: &'static str = "sh.weaver.actor.getSuggestedAuthors"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSuggestedAuthorsResponse; +} + +/// Endpoint type for +///sh.weaver.actor.getSuggestedAuthors +pub struct GetSuggestedAuthorsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSuggestedAuthorsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.actor.getSuggestedAuthors"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSuggestedAuthors; + type Response = GetSuggestedAuthorsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/actor/search_actors.rs b/crates/weaver-api/src/sh_weaver/actor/search_actors.rs new file mode 100644 index 0000000..dae1bda --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/actor/search_actors.rs @@ -0,0 +1,196 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.actor.searchActors +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SearchActors<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 25, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub q: jacquard_common::CowStr<'a>, +} + +pub mod search_actors_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Q; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Q = Unset; + } + ///State transition - sets the `q` field to Set + pub struct SetQ(PhantomData S>); + impl sealed::Sealed for SetQ {} + impl State for SetQ { + type Q = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `q` field + pub struct q(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SearchActorsBuilder<'a, S: search_actors_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SearchActors<'a> { + /// Create a new builder for this type + pub fn new() -> SearchActorsBuilder<'a, search_actors_state::Empty> { + SearchActorsBuilder::new() + } +} + +impl<'a> SearchActorsBuilder<'a, search_actors_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchActorsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_actors_state::State> SearchActorsBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: search_actors_state::State> SearchActorsBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> SearchActorsBuilder<'a, S> +where + S: search_actors_state::State, + S::Q: search_actors_state::IsUnset, +{ + /// Set the `q` field (required) + pub fn q( + mut self, + value: impl Into>, + ) -> SearchActorsBuilder<'a, search_actors_state::SetQ> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SearchActorsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SearchActorsBuilder<'a, S> +where + S: search_actors_state::State, + S::Q: search_actors_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SearchActors<'a> { + SearchActors { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + q: self.__unsafe_private_named.2.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SearchActorsOutput<'a> { + #[serde(borrow)] + pub actors: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///sh.weaver.actor.searchActors +pub struct SearchActorsResponse; +impl jacquard_common::xrpc::XrpcResp for SearchActorsResponse { + const NSID: &'static str = "sh.weaver.actor.searchActors"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchActorsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchActors<'a> { + const NSID: &'static str = "sh.weaver.actor.searchActors"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchActorsResponse; +} + +/// Endpoint type for +///sh.weaver.actor.searchActors +pub struct SearchActorsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchActorsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.actor.searchActors"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchActors<'de>; + type Response = SearchActorsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/actor/search_actors_typeahead.rs b/crates/weaver-api/src/sh_weaver/actor/search_actors_typeahead.rs new file mode 100644 index 0000000..13a9233 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/actor/search_actors_typeahead.rs @@ -0,0 +1,175 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.actor.searchActorsTypeahead +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SearchActorsTypeahead<'a> { + ///(default: 10, min: 1, max: 25) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub q: jacquard_common::CowStr<'a>, +} + +pub mod search_actors_typeahead_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Q; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Q = Unset; + } + ///State transition - sets the `q` field to Set + pub struct SetQ(PhantomData S>); + impl sealed::Sealed for SetQ {} + impl State for SetQ { + type Q = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `q` field + pub struct q(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SearchActorsTypeaheadBuilder<'a, S: search_actors_typeahead_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SearchActorsTypeahead<'a> { + /// Create a new builder for this type + pub fn new() -> SearchActorsTypeaheadBuilder< + 'a, + search_actors_typeahead_state::Empty, + > { + SearchActorsTypeaheadBuilder::new() + } +} + +impl<'a> SearchActorsTypeaheadBuilder<'a, search_actors_typeahead_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchActorsTypeaheadBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_actors_typeahead_state::State> SearchActorsTypeaheadBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> SearchActorsTypeaheadBuilder<'a, S> +where + S: search_actors_typeahead_state::State, + S::Q: search_actors_typeahead_state::IsUnset, +{ + /// Set the `q` field (required) + pub fn q( + mut self, + value: impl Into>, + ) -> SearchActorsTypeaheadBuilder<'a, search_actors_typeahead_state::SetQ> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SearchActorsTypeaheadBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SearchActorsTypeaheadBuilder<'a, S> +where + S: search_actors_typeahead_state::State, + S::Q: search_actors_typeahead_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SearchActorsTypeahead<'a> { + SearchActorsTypeahead { + limit: self.__unsafe_private_named.0, + q: self.__unsafe_private_named.1.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SearchActorsTypeaheadOutput<'a> { + #[serde(borrow)] + pub actors: Vec>, +} + +/// Response type for +///sh.weaver.actor.searchActorsTypeahead +pub struct SearchActorsTypeaheadResponse; +impl jacquard_common::xrpc::XrpcResp for SearchActorsTypeaheadResponse { + const NSID: &'static str = "sh.weaver.actor.searchActorsTypeahead"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchActorsTypeaheadOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchActorsTypeahead<'a> { + const NSID: &'static str = "sh.weaver.actor.searchActorsTypeahead"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchActorsTypeaheadResponse; +} + +/// Endpoint type for +///sh.weaver.actor.searchActorsTypeahead +pub struct SearchActorsTypeaheadRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchActorsTypeaheadRequest { + const PATH: &'static str = "/xrpc/sh.weaver.actor.searchActorsTypeahead"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchActorsTypeahead<'de>; + type Response = SearchActorsTypeaheadResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/collab.rs b/crates/weaver-api/src/sh_weaver/collab.rs index 643082f..c4de5cb 100644 --- a/crates/weaver-api/src/sh_weaver/collab.rs +++ b/crates/weaver-api/src/sh_weaver/collab.rs @@ -6,6 +6,10 @@ // Any manual changes will be overwritten on the next regeneration. pub mod accept; +pub mod get_collaboration_state; +pub mod get_invites; +pub mod get_resource_participants; +pub mod get_resource_sessions; pub mod invite; pub mod session; @@ -27,6 +31,1421 @@ impl std::fmt::Display for Chapter { } } +/// Full state of a collaboration relationship including version reconciliation. Tracks both current and former collaborators. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct CollaborationStateView<'a> { + /// The 'canonical' version URI (usually owner's) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub canonical_uri: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub created_at: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub first_collaborator_added_at: std::option::Option< + jacquard_common::types::string::Datetime, + >, + /// People who used to collaborate but relationship ended + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub former_participants: std::option::Option< + Vec>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub has_divergence: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub has_former_collaborators: std::option::Option, + /// Published versions from former collaborators still exist + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub has_orphaned_versions: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub last_synced_at: std::option::Option, + /// Current active + invited participants + #[serde(borrow)] + pub participants: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub published_versions: std::option::Option< + Vec>, + >, + #[serde(borrow)] + pub resource: crate::com_atproto::repo::strong_ref::StrongRef<'a>, + /// active=normal, broken=all invites revoked/expired, diverged=versions differ, reconciled=was diverged but resolved + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, +} + +pub mod collaboration_state_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Participants; + type Status; + type Resource; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Participants = Unset; + type Status = Unset; + type Resource = Unset; + } + ///State transition - sets the `participants` field to Set + pub struct SetParticipants(PhantomData S>); + impl sealed::Sealed for SetParticipants {} + impl State for SetParticipants { + type Participants = Set; + type Status = S::Status; + type Resource = S::Resource; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type Participants = S::Participants; + type Status = Set; + type Resource = S::Resource; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Participants = S::Participants; + type Status = S::Status; + type Resource = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `participants` field + pub struct participants(()); + ///Marker type for the `status` field + pub struct status(()); + ///Marker type for the `resource` field + pub struct resource(()); + } +} + +/// Builder for constructing an instance of this type +pub struct CollaborationStateViewBuilder<'a, S: collaboration_state_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option< + Vec>, + >, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>>, + ::core::option::Option< + Vec>, + >, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> CollaborationStateView<'a> { + /// Create a new builder for this type + pub fn new() -> CollaborationStateViewBuilder< + 'a, + collaboration_state_view_state::Empty, + > { + CollaborationStateViewBuilder::new() + } +} + +impl<'a> CollaborationStateViewBuilder<'a, collaboration_state_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + CollaborationStateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: collaboration_state_view_state::State> CollaborationStateViewBuilder<'a, S> { + /// Set the `canonicalUri` field (optional) + pub fn canonical_uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `canonicalUri` field to an Option value (optional) + pub fn maybe_canonical_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: collaboration_state_view_state::State> CollaborationStateViewBuilder<'a, S> { + /// Set the `createdAt` field (optional) + pub fn created_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `createdAt` field to an Option value (optional) + pub fn maybe_created_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: collaboration_state_view_state::State> CollaborationStateViewBuilder<'a, S> { + /// Set the `firstCollaboratorAddedAt` field (optional) + pub fn first_collaborator_added_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `firstCollaboratorAddedAt` field to an Option value (optional) + pub fn maybe_first_collaborator_added_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: collaboration_state_view_state::State> CollaborationStateViewBuilder<'a, S> { + /// Set the `formerParticipants` field (optional) + pub fn former_participants( + mut self, + value: impl Into< + Option>>, + >, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `formerParticipants` field to an Option value (optional) + pub fn maybe_former_participants( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: collaboration_state_view_state::State> CollaborationStateViewBuilder<'a, S> { + /// Set the `hasDivergence` field (optional) + pub fn has_divergence(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `hasDivergence` field to an Option value (optional) + pub fn maybe_has_divergence(mut self, value: Option) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: collaboration_state_view_state::State> CollaborationStateViewBuilder<'a, S> { + /// Set the `hasFormerCollaborators` field (optional) + pub fn has_former_collaborators(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `hasFormerCollaborators` field to an Option value (optional) + pub fn maybe_has_former_collaborators(mut self, value: Option) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: collaboration_state_view_state::State> CollaborationStateViewBuilder<'a, S> { + /// Set the `hasOrphanedVersions` field (optional) + pub fn has_orphaned_versions(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `hasOrphanedVersions` field to an Option value (optional) + pub fn maybe_has_orphaned_versions(mut self, value: Option) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: collaboration_state_view_state::State> CollaborationStateViewBuilder<'a, S> { + /// Set the `lastSyncedAt` field (optional) + pub fn last_synced_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `lastSyncedAt` field to an Option value (optional) + pub fn maybe_last_synced_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S> CollaborationStateViewBuilder<'a, S> +where + S: collaboration_state_view_state::State, + S::Participants: collaboration_state_view_state::IsUnset, +{ + /// Set the `participants` field (required) + pub fn participants( + mut self, + value: impl Into>>, + ) -> CollaborationStateViewBuilder< + 'a, + collaboration_state_view_state::SetParticipants, + > { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + CollaborationStateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: collaboration_state_view_state::State> CollaborationStateViewBuilder<'a, S> { + /// Set the `publishedVersions` field (optional) + pub fn published_versions( + mut self, + value: impl Into< + Option>>, + >, + ) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `publishedVersions` field to an Option value (optional) + pub fn maybe_published_versions( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S> CollaborationStateViewBuilder<'a, S> +where + S: collaboration_state_view_state::State, + S::Resource: collaboration_state_view_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> CollaborationStateViewBuilder< + 'a, + collaboration_state_view_state::SetResource, + > { + self.__unsafe_private_named.10 = ::core::option::Option::Some(value.into()); + CollaborationStateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CollaborationStateViewBuilder<'a, S> +where + S: collaboration_state_view_state::State, + S::Status: collaboration_state_view_state::IsUnset, +{ + /// Set the `status` field (required) + pub fn status( + mut self, + value: impl Into>, + ) -> CollaborationStateViewBuilder< + 'a, + collaboration_state_view_state::SetStatus, + > { + self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); + CollaborationStateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> CollaborationStateViewBuilder<'a, S> +where + S: collaboration_state_view_state::State, + S::Participants: collaboration_state_view_state::IsSet, + S::Status: collaboration_state_view_state::IsSet, + S::Resource: collaboration_state_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> CollaborationStateView<'a> { + CollaborationStateView { + canonical_uri: self.__unsafe_private_named.0, + created_at: self.__unsafe_private_named.1, + first_collaborator_added_at: self.__unsafe_private_named.2, + former_participants: self.__unsafe_private_named.3, + has_divergence: self.__unsafe_private_named.4, + has_former_collaborators: self.__unsafe_private_named.5, + has_orphaned_versions: self.__unsafe_private_named.6, + last_synced_at: self.__unsafe_private_named.7, + participants: self.__unsafe_private_named.8.unwrap(), + published_versions: self.__unsafe_private_named.9, + resource: self.__unsafe_private_named.10.unwrap(), + status: self.__unsafe_private_named.11.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> CollaborationStateView<'a> { + CollaborationStateView { + canonical_uri: self.__unsafe_private_named.0, + created_at: self.__unsafe_private_named.1, + first_collaborator_added_at: self.__unsafe_private_named.2, + former_participants: self.__unsafe_private_named.3, + has_divergence: self.__unsafe_private_named.4, + has_former_collaborators: self.__unsafe_private_named.5, + has_orphaned_versions: self.__unsafe_private_named.6, + last_synced_at: self.__unsafe_private_named.7, + participants: self.__unsafe_private_named.8.unwrap(), + published_versions: self.__unsafe_private_named.9, + resource: self.__unsafe_private_named.10.unwrap(), + status: self.__unsafe_private_named.11.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_collab_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.collab.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("chapter"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "collaborationStateView", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Full state of a collaboration relationship including version reconciliation. Tracks both current and former collaborators.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("resource"), + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::jacquard_common::smol_str::SmolStr::new_static("participants") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "canonicalUri", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The 'canonical' version URI (usually owner's)", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "firstCollaboratorAddedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "formerParticipants", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "People who used to collaborate but relationship ended", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#formerCollaboratorView", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "hasDivergence", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "hasFormerCollaborators", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "hasOrphanedVersions", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "lastSyncedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "participants", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Current active + invited participants", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#participantStateView", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "publishedVersions", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#publishedVersionView", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("resource"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "active=normal, broken=all invites revoked/expired, diverged=versions differ, reconciled=was diverged but resolved", + ), + ), + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entry"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "formerCollaboratorView", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Lightweight view for 'this person used to collaborate but doesn't anymore'.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("user"), + ::jacquard_common::smol_str::SmolStr::new_static("wasActiveFrom"), + ::jacquard_common::smol_str::SmolStr::new_static("wasActiveUntil"), + ::jacquard_common::smol_str::SmolStr::new_static("endReason") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "contributionCount", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "endReason", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "hasPublishedVersion", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "publishedVersionUri", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("user"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "wasActiveFrom", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "wasActiveUntil", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("inviteView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Hydrated view of a collaboration invite with status.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("inviter"), + ::jacquard_common::smol_str::SmolStr::new_static("invitee"), + ::jacquard_common::smol_str::SmolStr::new_static("resource"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::jacquard_common::smol_str::SmolStr::new_static("status") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "acceptUri", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "acceptedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "expiresAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("invitee"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("inviter"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("message"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("resource"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "resourceTitle", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("scope"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notebook"), + ::jacquard_lexicon::lexicon::LexUserType::Token(::jacquard_lexicon::lexicon::LexToken { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("participantStateView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Individual participant's state in a collaboration. Distinguishes 'was collaborator' vs 'never was'.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("user"), + ::jacquard_common::smol_str::SmolStr::new_static("role"), + ::jacquard_common::smol_str::SmolStr::new_static("status") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "acceptUri", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "If they accepted (even if later broken)", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "endReason", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Why the relationship ended, if applicable", + ), + ), + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "firstEditAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "When they first contributed", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "inviteUri", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "lastEditAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "publishedVersion", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "relationshipEndedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "When left/removed/expired", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("role"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "active=can edit, invited=pending, left=voluntarily departed, removed=invite revoked, expired=invite timed out", + ), + ), + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("user"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "wasCollaborator", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("sessionView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Active real-time collaboration session.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("user"), + ::jacquard_common::smol_str::SmolStr::new_static("resource"), + ::jacquard_common::smol_str::SmolStr::new_static("nodeId"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "expiresAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("nodeId"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("relayUrl"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Uri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("resource"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("user"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for CollaborationStateView<'a> { + fn nsid() -> &'static str { + "sh.weaver.collab.defs" + } + fn def_name() -> &'static str { + "collaborationStateView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_collab_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + /// Collaboration scoped to a single entry. #[derive( serde::Serialize, @@ -45,6 +1464,882 @@ impl std::fmt::Display for Entry { } } +/// Lightweight view for 'this person used to collaborate but doesn't anymore'. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct FormerCollaboratorView<'a> { + /// Number of diffs they created while active + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub contribution_count: std::option::Option, + #[serde(borrow)] + pub end_reason: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub has_published_version: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub published_version_uri: std::option::Option< + jacquard_common::types::string::AtUri<'a>, + >, + #[serde(borrow)] + pub user: crate::sh_weaver::actor::ProfileViewBasic<'a>, + pub was_active_from: jacquard_common::types::string::Datetime, + pub was_active_until: jacquard_common::types::string::Datetime, +} + +pub mod former_collaborator_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type User; + type WasActiveUntil; + type WasActiveFrom; + type EndReason; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type User = Unset; + type WasActiveUntil = Unset; + type WasActiveFrom = Unset; + type EndReason = Unset; + } + ///State transition - sets the `user` field to Set + pub struct SetUser(PhantomData S>); + impl sealed::Sealed for SetUser {} + impl State for SetUser { + type User = Set; + type WasActiveUntil = S::WasActiveUntil; + type WasActiveFrom = S::WasActiveFrom; + type EndReason = S::EndReason; + } + ///State transition - sets the `was_active_until` field to Set + pub struct SetWasActiveUntil(PhantomData S>); + impl sealed::Sealed for SetWasActiveUntil {} + impl State for SetWasActiveUntil { + type User = S::User; + type WasActiveUntil = Set; + type WasActiveFrom = S::WasActiveFrom; + type EndReason = S::EndReason; + } + ///State transition - sets the `was_active_from` field to Set + pub struct SetWasActiveFrom(PhantomData S>); + impl sealed::Sealed for SetWasActiveFrom {} + impl State for SetWasActiveFrom { + type User = S::User; + type WasActiveUntil = S::WasActiveUntil; + type WasActiveFrom = Set; + type EndReason = S::EndReason; + } + ///State transition - sets the `end_reason` field to Set + pub struct SetEndReason(PhantomData S>); + impl sealed::Sealed for SetEndReason {} + impl State for SetEndReason { + type User = S::User; + type WasActiveUntil = S::WasActiveUntil; + type WasActiveFrom = S::WasActiveFrom; + type EndReason = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `user` field + pub struct user(()); + ///Marker type for the `was_active_until` field + pub struct was_active_until(()); + ///Marker type for the `was_active_from` field + pub struct was_active_from(()); + ///Marker type for the `end_reason` field + pub struct end_reason(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FormerCollaboratorViewBuilder<'a, S: former_collaborator_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> FormerCollaboratorView<'a> { + /// Create a new builder for this type + pub fn new() -> FormerCollaboratorViewBuilder< + 'a, + former_collaborator_view_state::Empty, + > { + FormerCollaboratorViewBuilder::new() + } +} + +impl<'a> FormerCollaboratorViewBuilder<'a, former_collaborator_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FormerCollaboratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: former_collaborator_view_state::State> FormerCollaboratorViewBuilder<'a, S> { + /// Set the `contributionCount` field (optional) + pub fn contribution_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `contributionCount` field to an Option value (optional) + pub fn maybe_contribution_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> FormerCollaboratorViewBuilder<'a, S> +where + S: former_collaborator_view_state::State, + S::EndReason: former_collaborator_view_state::IsUnset, +{ + /// Set the `endReason` field (required) + pub fn end_reason( + mut self, + value: impl Into>, + ) -> FormerCollaboratorViewBuilder< + 'a, + former_collaborator_view_state::SetEndReason, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + FormerCollaboratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: former_collaborator_view_state::State> FormerCollaboratorViewBuilder<'a, S> { + /// Set the `hasPublishedVersion` field (optional) + pub fn has_published_version(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `hasPublishedVersion` field to an Option value (optional) + pub fn maybe_has_published_version(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: former_collaborator_view_state::State> FormerCollaboratorViewBuilder<'a, S> { + /// Set the `publishedVersionUri` field (optional) + pub fn published_version_uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `publishedVersionUri` field to an Option value (optional) + pub fn maybe_published_version_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> FormerCollaboratorViewBuilder<'a, S> +where + S: former_collaborator_view_state::State, + S::User: former_collaborator_view_state::IsUnset, +{ + /// Set the `user` field (required) + pub fn user( + mut self, + value: impl Into>, + ) -> FormerCollaboratorViewBuilder<'a, former_collaborator_view_state::SetUser> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + FormerCollaboratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FormerCollaboratorViewBuilder<'a, S> +where + S: former_collaborator_view_state::State, + S::WasActiveFrom: former_collaborator_view_state::IsUnset, +{ + /// Set the `wasActiveFrom` field (required) + pub fn was_active_from( + mut self, + value: impl Into, + ) -> FormerCollaboratorViewBuilder< + 'a, + former_collaborator_view_state::SetWasActiveFrom, + > { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + FormerCollaboratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FormerCollaboratorViewBuilder<'a, S> +where + S: former_collaborator_view_state::State, + S::WasActiveUntil: former_collaborator_view_state::IsUnset, +{ + /// Set the `wasActiveUntil` field (required) + pub fn was_active_until( + mut self, + value: impl Into, + ) -> FormerCollaboratorViewBuilder< + 'a, + former_collaborator_view_state::SetWasActiveUntil, + > { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + FormerCollaboratorViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FormerCollaboratorViewBuilder<'a, S> +where + S: former_collaborator_view_state::State, + S::User: former_collaborator_view_state::IsSet, + S::WasActiveUntil: former_collaborator_view_state::IsSet, + S::WasActiveFrom: former_collaborator_view_state::IsSet, + S::EndReason: former_collaborator_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> FormerCollaboratorView<'a> { + FormerCollaboratorView { + contribution_count: self.__unsafe_private_named.0, + end_reason: self.__unsafe_private_named.1.unwrap(), + has_published_version: self.__unsafe_private_named.2, + published_version_uri: self.__unsafe_private_named.3, + user: self.__unsafe_private_named.4.unwrap(), + was_active_from: self.__unsafe_private_named.5.unwrap(), + was_active_until: self.__unsafe_private_named.6.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> FormerCollaboratorView<'a> { + FormerCollaboratorView { + contribution_count: self.__unsafe_private_named.0, + end_reason: self.__unsafe_private_named.1.unwrap(), + has_published_version: self.__unsafe_private_named.2, + published_version_uri: self.__unsafe_private_named.3, + user: self.__unsafe_private_named.4.unwrap(), + was_active_from: self.__unsafe_private_named.5.unwrap(), + was_active_until: self.__unsafe_private_named.6.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FormerCollaboratorView<'a> { + fn nsid() -> &'static str { + "sh.weaver.collab.defs" + } + fn def_name() -> &'static str { + "formerCollaboratorView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_collab_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Hydrated view of a collaboration invite with status. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct InviteView<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub accept_uri: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub accepted_at: std::option::Option, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub created_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub expires_at: std::option::Option, + #[serde(borrow)] + pub invitee: crate::sh_weaver::actor::ProfileViewBasic<'a>, + #[serde(borrow)] + pub inviter: crate::sh_weaver::actor::ProfileViewBasic<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub message: std::option::Option>, + #[serde(borrow)] + pub resource: crate::com_atproto::repo::strong_ref::StrongRef<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub resource_title: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub scope: std::option::Option>, + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod invite_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Status; + type Uri; + type Cid; + type Resource; + type Invitee; + type CreatedAt; + type Inviter; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Status = Unset; + type Uri = Unset; + type Cid = Unset; + type Resource = Unset; + type Invitee = Unset; + type CreatedAt = Unset; + type Inviter = Unset; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type Status = Set; + type Uri = S::Uri; + type Cid = S::Cid; + type Resource = S::Resource; + type Invitee = S::Invitee; + type CreatedAt = S::CreatedAt; + type Inviter = S::Inviter; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Status = S::Status; + type Uri = Set; + type Cid = S::Cid; + type Resource = S::Resource; + type Invitee = S::Invitee; + type CreatedAt = S::CreatedAt; + type Inviter = S::Inviter; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Status = S::Status; + type Uri = S::Uri; + type Cid = Set; + type Resource = S::Resource; + type Invitee = S::Invitee; + type CreatedAt = S::CreatedAt; + type Inviter = S::Inviter; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Status = S::Status; + type Uri = S::Uri; + type Cid = S::Cid; + type Resource = Set; + type Invitee = S::Invitee; + type CreatedAt = S::CreatedAt; + type Inviter = S::Inviter; + } + ///State transition - sets the `invitee` field to Set + pub struct SetInvitee(PhantomData S>); + impl sealed::Sealed for SetInvitee {} + impl State for SetInvitee { + type Status = S::Status; + type Uri = S::Uri; + type Cid = S::Cid; + type Resource = S::Resource; + type Invitee = Set; + type CreatedAt = S::CreatedAt; + type Inviter = S::Inviter; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Status = S::Status; + type Uri = S::Uri; + type Cid = S::Cid; + type Resource = S::Resource; + type Invitee = S::Invitee; + type CreatedAt = Set; + type Inviter = S::Inviter; + } + ///State transition - sets the `inviter` field to Set + pub struct SetInviter(PhantomData S>); + impl sealed::Sealed for SetInviter {} + impl State for SetInviter { + type Status = S::Status; + type Uri = S::Uri; + type Cid = S::Cid; + type Resource = S::Resource; + type Invitee = S::Invitee; + type CreatedAt = S::CreatedAt; + type Inviter = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `status` field + pub struct status(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `resource` field + pub struct resource(()); + ///Marker type for the `invitee` field + pub struct invitee(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `inviter` field + pub struct inviter(()); + } +} + +/// Builder for constructing an instance of this type +pub struct InviteViewBuilder<'a, S: invite_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> InviteView<'a> { + /// Create a new builder for this type + pub fn new() -> InviteViewBuilder<'a, invite_view_state::Empty> { + InviteViewBuilder::new() + } +} + +impl<'a> InviteViewBuilder<'a, invite_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + InviteViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: invite_view_state::State> InviteViewBuilder<'a, S> { + /// Set the `acceptUri` field (optional) + pub fn accept_uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `acceptUri` field to an Option value (optional) + pub fn maybe_accept_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: invite_view_state::State> InviteViewBuilder<'a, S> { + /// Set the `acceptedAt` field (optional) + pub fn accepted_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `acceptedAt` field to an Option value (optional) + pub fn maybe_accepted_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> InviteViewBuilder<'a, S> +where + S: invite_view_state::State, + S::Cid: invite_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> InviteViewBuilder<'a, invite_view_state::SetCid> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + InviteViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteViewBuilder<'a, S> +where + S: invite_view_state::State, + S::CreatedAt: invite_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> InviteViewBuilder<'a, invite_view_state::SetCreatedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + InviteViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: invite_view_state::State> InviteViewBuilder<'a, S> { + /// Set the `expiresAt` field (optional) + pub fn expires_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `expiresAt` field to an Option value (optional) + pub fn maybe_expires_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> InviteViewBuilder<'a, S> +where + S: invite_view_state::State, + S::Invitee: invite_view_state::IsUnset, +{ + /// Set the `invitee` field (required) + pub fn invitee( + mut self, + value: impl Into>, + ) -> InviteViewBuilder<'a, invite_view_state::SetInvitee> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + InviteViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteViewBuilder<'a, S> +where + S: invite_view_state::State, + S::Inviter: invite_view_state::IsUnset, +{ + /// Set the `inviter` field (required) + pub fn inviter( + mut self, + value: impl Into>, + ) -> InviteViewBuilder<'a, invite_view_state::SetInviter> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + InviteViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: invite_view_state::State> InviteViewBuilder<'a, S> { + /// Set the `message` field (optional) + pub fn message( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `message` field to an Option value (optional) + pub fn maybe_message(mut self, value: Option>) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S> InviteViewBuilder<'a, S> +where + S: invite_view_state::State, + S::Resource: invite_view_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> InviteViewBuilder<'a, invite_view_state::SetResource> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + InviteViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: invite_view_state::State> InviteViewBuilder<'a, S> { + /// Set the `resourceTitle` field (optional) + pub fn resource_title( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `resourceTitle` field to an Option value (optional) + pub fn maybe_resource_title( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: invite_view_state::State> InviteViewBuilder<'a, S> { + /// Set the `scope` field (optional) + pub fn scope( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `scope` field to an Option value (optional) + pub fn maybe_scope(mut self, value: Option>) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S> InviteViewBuilder<'a, S> +where + S: invite_view_state::State, + S::Status: invite_view_state::IsUnset, +{ + /// Set the `status` field (required) + pub fn status( + mut self, + value: impl Into>, + ) -> InviteViewBuilder<'a, invite_view_state::SetStatus> { + self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); + InviteViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteViewBuilder<'a, S> +where + S: invite_view_state::State, + S::Uri: invite_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> InviteViewBuilder<'a, invite_view_state::SetUri> { + self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into()); + InviteViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> InviteViewBuilder<'a, S> +where + S: invite_view_state::State, + S::Status: invite_view_state::IsSet, + S::Uri: invite_view_state::IsSet, + S::Cid: invite_view_state::IsSet, + S::Resource: invite_view_state::IsSet, + S::Invitee: invite_view_state::IsSet, + S::CreatedAt: invite_view_state::IsSet, + S::Inviter: invite_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> InviteView<'a> { + InviteView { + accept_uri: self.__unsafe_private_named.0, + accepted_at: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + created_at: self.__unsafe_private_named.3.unwrap(), + expires_at: self.__unsafe_private_named.4, + invitee: self.__unsafe_private_named.5.unwrap(), + inviter: self.__unsafe_private_named.6.unwrap(), + message: self.__unsafe_private_named.7, + resource: self.__unsafe_private_named.8.unwrap(), + resource_title: self.__unsafe_private_named.9, + scope: self.__unsafe_private_named.10, + status: self.__unsafe_private_named.11.unwrap(), + uri: self.__unsafe_private_named.12.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> InviteView<'a> { + InviteView { + accept_uri: self.__unsafe_private_named.0, + accepted_at: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + created_at: self.__unsafe_private_named.3.unwrap(), + expires_at: self.__unsafe_private_named.4, + invitee: self.__unsafe_private_named.5.unwrap(), + inviter: self.__unsafe_private_named.6.unwrap(), + message: self.__unsafe_private_named.7, + resource: self.__unsafe_private_named.8.unwrap(), + resource_title: self.__unsafe_private_named.9, + scope: self.__unsafe_private_named.10, + status: self.__unsafe_private_named.11.unwrap(), + uri: self.__unsafe_private_named.12.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for InviteView<'a> { + fn nsid() -> &'static str { + "sh.weaver.collab.defs" + } + fn def_name() -> &'static str { + "inviteView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_collab_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + /// Collaboration scoped to an entire notebook. #[derive( serde::Serialize, @@ -61,4 +2356,782 @@ impl std::fmt::Display for Notebook { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "notebook") } +} + +/// Individual participant's state in a collaboration. Distinguishes 'was collaborator' vs 'never was'. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ParticipantStateView<'a> { + /// If they accepted (even if later broken) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub accept_uri: std::option::Option>, + /// Why the relationship ended, if applicable + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub end_reason: std::option::Option>, + /// When they first contributed + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub first_edit_at: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub invite_uri: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub last_edit_at: std::option::Option, + /// Their published copy if any + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub published_version: std::option::Option< + crate::com_atproto::repo::strong_ref::StrongRef<'a>, + >, + /// When left/removed/expired + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub relationship_ended_at: std::option::Option< + jacquard_common::types::string::Datetime, + >, + #[serde(borrow)] + pub role: jacquard_common::CowStr<'a>, + /// active=can edit, invited=pending, left=voluntarily departed, removed=invite revoked, expired=invite timed out + #[serde(borrow)] + pub status: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub user: crate::sh_weaver::actor::ProfileViewBasic<'a>, + /// True if they ever had active collaboration status + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub was_collaborator: std::option::Option, +} + +pub mod participant_state_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type User; + type Status; + type Role; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type User = Unset; + type Status = Unset; + type Role = Unset; + } + ///State transition - sets the `user` field to Set + pub struct SetUser(PhantomData S>); + impl sealed::Sealed for SetUser {} + impl State for SetUser { + type User = Set; + type Status = S::Status; + type Role = S::Role; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type User = S::User; + type Status = Set; + type Role = S::Role; + } + ///State transition - sets the `role` field to Set + pub struct SetRole(PhantomData S>); + impl sealed::Sealed for SetRole {} + impl State for SetRole { + type User = S::User; + type Status = S::Status; + type Role = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `user` field + pub struct user(()); + ///Marker type for the `status` field + pub struct status(()); + ///Marker type for the `role` field + pub struct role(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ParticipantStateViewBuilder<'a, S: participant_state_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ParticipantStateView<'a> { + /// Create a new builder for this type + pub fn new() -> ParticipantStateViewBuilder< + 'a, + participant_state_view_state::Empty, + > { + ParticipantStateViewBuilder::new() + } +} + +impl<'a> ParticipantStateViewBuilder<'a, participant_state_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ParticipantStateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: participant_state_view_state::State> ParticipantStateViewBuilder<'a, S> { + /// Set the `acceptUri` field (optional) + pub fn accept_uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `acceptUri` field to an Option value (optional) + pub fn maybe_accept_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: participant_state_view_state::State> ParticipantStateViewBuilder<'a, S> { + /// Set the `endReason` field (optional) + pub fn end_reason( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `endReason` field to an Option value (optional) + pub fn maybe_end_reason( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: participant_state_view_state::State> ParticipantStateViewBuilder<'a, S> { + /// Set the `firstEditAt` field (optional) + pub fn first_edit_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `firstEditAt` field to an Option value (optional) + pub fn maybe_first_edit_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: participant_state_view_state::State> ParticipantStateViewBuilder<'a, S> { + /// Set the `inviteUri` field (optional) + pub fn invite_uri( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `inviteUri` field to an Option value (optional) + pub fn maybe_invite_uri( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: participant_state_view_state::State> ParticipantStateViewBuilder<'a, S> { + /// Set the `lastEditAt` field (optional) + pub fn last_edit_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `lastEditAt` field to an Option value (optional) + pub fn maybe_last_edit_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: participant_state_view_state::State> ParticipantStateViewBuilder<'a, S> { + /// Set the `publishedVersion` field (optional) + pub fn published_version( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `publishedVersion` field to an Option value (optional) + pub fn maybe_published_version( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: participant_state_view_state::State> ParticipantStateViewBuilder<'a, S> { + /// Set the `relationshipEndedAt` field (optional) + pub fn relationship_ended_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `relationshipEndedAt` field to an Option value (optional) + pub fn maybe_relationship_ended_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> ParticipantStateViewBuilder<'a, S> +where + S: participant_state_view_state::State, + S::Role: participant_state_view_state::IsUnset, +{ + /// Set the `role` field (required) + pub fn role( + mut self, + value: impl Into>, + ) -> ParticipantStateViewBuilder<'a, participant_state_view_state::SetRole> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + ParticipantStateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ParticipantStateViewBuilder<'a, S> +where + S: participant_state_view_state::State, + S::Status: participant_state_view_state::IsUnset, +{ + /// Set the `status` field (required) + pub fn status( + mut self, + value: impl Into>, + ) -> ParticipantStateViewBuilder<'a, participant_state_view_state::SetStatus> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + ParticipantStateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ParticipantStateViewBuilder<'a, S> +where + S: participant_state_view_state::State, + S::User: participant_state_view_state::IsUnset, +{ + /// Set the `user` field (required) + pub fn user( + mut self, + value: impl Into>, + ) -> ParticipantStateViewBuilder<'a, participant_state_view_state::SetUser> { + self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); + ParticipantStateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: participant_state_view_state::State> ParticipantStateViewBuilder<'a, S> { + /// Set the `wasCollaborator` field (optional) + pub fn was_collaborator(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `wasCollaborator` field to an Option value (optional) + pub fn maybe_was_collaborator(mut self, value: Option) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S> ParticipantStateViewBuilder<'a, S> +where + S: participant_state_view_state::State, + S::User: participant_state_view_state::IsSet, + S::Status: participant_state_view_state::IsSet, + S::Role: participant_state_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ParticipantStateView<'a> { + ParticipantStateView { + accept_uri: self.__unsafe_private_named.0, + end_reason: self.__unsafe_private_named.1, + first_edit_at: self.__unsafe_private_named.2, + invite_uri: self.__unsafe_private_named.3, + last_edit_at: self.__unsafe_private_named.4, + published_version: self.__unsafe_private_named.5, + relationship_ended_at: self.__unsafe_private_named.6, + role: self.__unsafe_private_named.7.unwrap(), + status: self.__unsafe_private_named.8.unwrap(), + user: self.__unsafe_private_named.9.unwrap(), + was_collaborator: self.__unsafe_private_named.10, + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> ParticipantStateView<'a> { + ParticipantStateView { + accept_uri: self.__unsafe_private_named.0, + end_reason: self.__unsafe_private_named.1, + first_edit_at: self.__unsafe_private_named.2, + invite_uri: self.__unsafe_private_named.3, + last_edit_at: self.__unsafe_private_named.4, + published_version: self.__unsafe_private_named.5, + relationship_ended_at: self.__unsafe_private_named.6, + role: self.__unsafe_private_named.7.unwrap(), + status: self.__unsafe_private_named.8.unwrap(), + user: self.__unsafe_private_named.9.unwrap(), + was_collaborator: self.__unsafe_private_named.10, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ParticipantStateView<'a> { + fn nsid() -> &'static str { + "sh.weaver.collab.defs" + } + fn def_name() -> &'static str { + "participantStateView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_collab_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Active real-time collaboration session. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SessionView<'a> { + pub created_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub expires_at: std::option::Option, + #[serde(borrow)] + pub node_id: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub relay_url: std::option::Option>, + #[serde(borrow)] + pub resource: crate::com_atproto::repo::strong_ref::StrongRef<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub user: crate::sh_weaver::actor::ProfileViewBasic<'a>, +} + +pub mod session_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Resource; + type Uri; + type User; + type CreatedAt; + type NodeId; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Resource = Unset; + type Uri = Unset; + type User = Unset; + type CreatedAt = Unset; + type NodeId = Unset; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; + type Uri = S::Uri; + type User = S::User; + type CreatedAt = S::CreatedAt; + type NodeId = S::NodeId; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Resource = S::Resource; + type Uri = Set; + type User = S::User; + type CreatedAt = S::CreatedAt; + type NodeId = S::NodeId; + } + ///State transition - sets the `user` field to Set + pub struct SetUser(PhantomData S>); + impl sealed::Sealed for SetUser {} + impl State for SetUser { + type Resource = S::Resource; + type Uri = S::Uri; + type User = Set; + type CreatedAt = S::CreatedAt; + type NodeId = S::NodeId; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Resource = S::Resource; + type Uri = S::Uri; + type User = S::User; + type CreatedAt = Set; + type NodeId = S::NodeId; + } + ///State transition - sets the `node_id` field to Set + pub struct SetNodeId(PhantomData S>); + impl sealed::Sealed for SetNodeId {} + impl State for SetNodeId { + type Resource = S::Resource; + type Uri = S::Uri; + type User = S::User; + type CreatedAt = S::CreatedAt; + type NodeId = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `resource` field + pub struct resource(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `user` field + pub struct user(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `node_id` field + pub struct node_id(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SessionViewBuilder<'a, S: session_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SessionView<'a> { + /// Create a new builder for this type + pub fn new() -> SessionViewBuilder<'a, session_view_state::Empty> { + SessionViewBuilder::new() + } +} + +impl<'a> SessionViewBuilder<'a, session_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SessionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SessionViewBuilder<'a, S> +where + S: session_view_state::State, + S::CreatedAt: session_view_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> SessionViewBuilder<'a, session_view_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SessionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: session_view_state::State> SessionViewBuilder<'a, S> { + /// Set the `expiresAt` field (optional) + pub fn expires_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `expiresAt` field to an Option value (optional) + pub fn maybe_expires_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> SessionViewBuilder<'a, S> +where + S: session_view_state::State, + S::NodeId: session_view_state::IsUnset, +{ + /// Set the `nodeId` field (required) + pub fn node_id( + mut self, + value: impl Into>, + ) -> SessionViewBuilder<'a, session_view_state::SetNodeId> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SessionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: session_view_state::State> SessionViewBuilder<'a, S> { + /// Set the `relayUrl` field (optional) + pub fn relay_url( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `relayUrl` field to an Option value (optional) + pub fn maybe_relay_url( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> SessionViewBuilder<'a, S> +where + S: session_view_state::State, + S::Resource: session_view_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> SessionViewBuilder<'a, session_view_state::SetResource> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + SessionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SessionViewBuilder<'a, S> +where + S: session_view_state::State, + S::Uri: session_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> SessionViewBuilder<'a, session_view_state::SetUri> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + SessionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SessionViewBuilder<'a, S> +where + S: session_view_state::State, + S::User: session_view_state::IsUnset, +{ + /// Set the `user` field (required) + pub fn user( + mut self, + value: impl Into>, + ) -> SessionViewBuilder<'a, session_view_state::SetUser> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + SessionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SessionViewBuilder<'a, S> +where + S: session_view_state::State, + S::Resource: session_view_state::IsSet, + S::Uri: session_view_state::IsSet, + S::User: session_view_state::IsSet, + S::CreatedAt: session_view_state::IsSet, + S::NodeId: session_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SessionView<'a> { + SessionView { + created_at: self.__unsafe_private_named.0.unwrap(), + expires_at: self.__unsafe_private_named.1, + node_id: self.__unsafe_private_named.2.unwrap(), + relay_url: self.__unsafe_private_named.3, + resource: self.__unsafe_private_named.4.unwrap(), + uri: self.__unsafe_private_named.5.unwrap(), + user: self.__unsafe_private_named.6.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> SessionView<'a> { + SessionView { + created_at: self.__unsafe_private_named.0.unwrap(), + expires_at: self.__unsafe_private_named.1, + node_id: self.__unsafe_private_named.2.unwrap(), + relay_url: self.__unsafe_private_named.3, + resource: self.__unsafe_private_named.4.unwrap(), + uri: self.__unsafe_private_named.5.unwrap(), + user: self.__unsafe_private_named.6.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SessionView<'a> { + fn nsid() -> &'static str { + "sh.weaver.collab.defs" + } + fn def_name() -> &'static str { + "sessionView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_collab_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } } \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/collab/accept.rs b/crates/weaver-api/src/sh_weaver/collab/accept.rs index d347076..e3b0e42 100644 --- a/crates/weaver-api/src/sh_weaver/collab/accept.rs +++ b/crates/weaver-api/src/sh_weaver/collab/accept.rs @@ -37,49 +37,49 @@ pub mod accept_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Invite; type Resource; + type Invite; type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Invite = Unset; type Resource = Unset; + type Invite = Unset; type CreatedAt = Unset; } - ///State transition - sets the `invite` field to Set - pub struct SetInvite(PhantomData S>); - impl sealed::Sealed for SetInvite {} - impl State for SetInvite { - type Invite = Set; - type Resource = S::Resource; - type CreatedAt = S::CreatedAt; - } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { - type Invite = S::Invite; type Resource = Set; + type Invite = S::Invite; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `invite` field to Set + pub struct SetInvite(PhantomData S>); + impl sealed::Sealed for SetInvite {} + impl State for SetInvite { + type Resource = S::Resource; + type Invite = Set; type CreatedAt = S::CreatedAt; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Invite = S::Invite; type Resource = S::Resource; + type Invite = S::Invite; type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `invite` field - pub struct invite(()); ///Marker type for the `resource` field pub struct resource(()); + ///Marker type for the `invite` field + pub struct invite(()); ///Marker type for the `created_at` field pub struct created_at(()); } @@ -174,8 +174,8 @@ where impl<'a, S> AcceptBuilder<'a, S> where S: accept_state::State, - S::Invite: accept_state::IsSet, S::Resource: accept_state::IsSet, + S::Invite: accept_state::IsSet, S::CreatedAt: accept_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/collab/get_collaboration_state.rs b/crates/weaver-api/src/sh_weaver/collab/get_collaboration_state.rs new file mode 100644 index 0000000..653fffa --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/collab/get_collaboration_state.rs @@ -0,0 +1,161 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.collab.getCollaborationState +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetCollaborationState<'a> { + #[serde(borrow)] + pub resource: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_collaboration_state_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Resource; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Resource = Unset; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `resource` field + pub struct resource(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetCollaborationStateBuilder<'a, S: get_collaboration_state_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetCollaborationState<'a> { + /// Create a new builder for this type + pub fn new() -> GetCollaborationStateBuilder< + 'a, + get_collaboration_state_state::Empty, + > { + GetCollaborationStateBuilder::new() + } +} + +impl<'a> GetCollaborationStateBuilder<'a, get_collaboration_state_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetCollaborationStateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetCollaborationStateBuilder<'a, S> +where + S: get_collaboration_state_state::State, + S::Resource: get_collaboration_state_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> GetCollaborationStateBuilder< + 'a, + get_collaboration_state_state::SetResource, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetCollaborationStateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetCollaborationStateBuilder<'a, S> +where + S: get_collaboration_state_state::State, + S::Resource: get_collaboration_state_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetCollaborationState<'a> { + GetCollaborationState { + resource: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetCollaborationStateOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::sh_weaver::collab::CollaborationStateView<'a>, +} + +/// Response type for +///sh.weaver.collab.getCollaborationState +pub struct GetCollaborationStateResponse; +impl jacquard_common::xrpc::XrpcResp for GetCollaborationStateResponse { + const NSID: &'static str = "sh.weaver.collab.getCollaborationState"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetCollaborationStateOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetCollaborationState<'a> { + const NSID: &'static str = "sh.weaver.collab.getCollaborationState"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetCollaborationStateResponse; +} + +/// Endpoint type for +///sh.weaver.collab.getCollaborationState +pub struct GetCollaborationStateRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetCollaborationStateRequest { + const PATH: &'static str = "/xrpc/sh.weaver.collab.getCollaborationState"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetCollaborationState<'de>; + type Response = GetCollaborationStateResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/collab/get_invites.rs b/crates/weaver-api/src/sh_weaver/collab/get_invites.rs new file mode 100644 index 0000000..381735f --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/collab/get_invites.rs @@ -0,0 +1,243 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.collab.getInvites +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetInvites<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: "all") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub direction: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + ///(default: "all") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: std::option::Option>, +} + +pub mod get_invites_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetInvitesBuilder<'a, S: get_invites_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetInvites<'a> { + /// Create a new builder for this type + pub fn new() -> GetInvitesBuilder<'a, get_invites_state::Empty> { + GetInvitesBuilder::new() + } +} + +impl<'a> GetInvitesBuilder<'a, get_invites_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetInvitesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetInvitesBuilder<'a, S> +where + S: get_invites_state::State, + S::Actor: get_invites_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetInvitesBuilder<'a, get_invites_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetInvitesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_invites_state::State> GetInvitesBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_invites_state::State> GetInvitesBuilder<'a, S> { + /// Set the `direction` field (optional) + pub fn direction( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `direction` field to an Option value (optional) + pub fn maybe_direction( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_invites_state::State> GetInvitesBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: get_invites_state::State> GetInvitesBuilder<'a, S> { + /// Set the `status` field (optional) + pub fn status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `status` field to an Option value (optional) + pub fn maybe_status(mut self, value: Option>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> GetInvitesBuilder<'a, S> +where + S: get_invites_state::State, + S::Actor: get_invites_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetInvites<'a> { + GetInvites { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + direction: self.__unsafe_private_named.2, + limit: self.__unsafe_private_named.3, + status: self.__unsafe_private_named.4, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetInvitesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub invites: Vec>, +} + +/// Response type for +///sh.weaver.collab.getInvites +pub struct GetInvitesResponse; +impl jacquard_common::xrpc::XrpcResp for GetInvitesResponse { + const NSID: &'static str = "sh.weaver.collab.getInvites"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetInvitesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetInvites<'a> { + const NSID: &'static str = "sh.weaver.collab.getInvites"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetInvitesResponse; +} + +/// Endpoint type for +///sh.weaver.collab.getInvites +pub struct GetInvitesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetInvitesRequest { + const PATH: &'static str = "/xrpc/sh.weaver.collab.getInvites"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetInvites<'de>; + type Response = GetInvitesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/collab/get_resource_participants.rs b/crates/weaver-api/src/sh_weaver/collab/get_resource_participants.rs new file mode 100644 index 0000000..ab7b427 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/collab/get_resource_participants.rs @@ -0,0 +1,167 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.collab.getResourceParticipants +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetResourceParticipants<'a> { + #[serde(borrow)] + pub resource: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_resource_participants_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Resource; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Resource = Unset; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `resource` field + pub struct resource(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetResourceParticipantsBuilder< + 'a, + S: get_resource_participants_state::State, +> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetResourceParticipants<'a> { + /// Create a new builder for this type + pub fn new() -> GetResourceParticipantsBuilder< + 'a, + get_resource_participants_state::Empty, + > { + GetResourceParticipantsBuilder::new() + } +} + +impl<'a> GetResourceParticipantsBuilder<'a, get_resource_participants_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetResourceParticipantsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetResourceParticipantsBuilder<'a, S> +where + S: get_resource_participants_state::State, + S::Resource: get_resource_participants_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> GetResourceParticipantsBuilder< + 'a, + get_resource_participants_state::SetResource, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetResourceParticipantsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetResourceParticipantsBuilder<'a, S> +where + S: get_resource_participants_state::State, + S::Resource: get_resource_participants_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetResourceParticipants<'a> { + GetResourceParticipants { + resource: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetResourceParticipantsOutput<'a> { + #[serde(borrow)] + pub owner: crate::sh_weaver::actor::ProfileViewBasic<'a>, + #[serde(borrow)] + pub participants: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub viewer_can_edit: std::option::Option, +} + +/// Response type for +///sh.weaver.collab.getResourceParticipants +pub struct GetResourceParticipantsResponse; +impl jacquard_common::xrpc::XrpcResp for GetResourceParticipantsResponse { + const NSID: &'static str = "sh.weaver.collab.getResourceParticipants"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetResourceParticipantsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetResourceParticipants<'a> { + const NSID: &'static str = "sh.weaver.collab.getResourceParticipants"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetResourceParticipantsResponse; +} + +/// Endpoint type for +///sh.weaver.collab.getResourceParticipants +pub struct GetResourceParticipantsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetResourceParticipantsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.collab.getResourceParticipants"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetResourceParticipants<'de>; + type Response = GetResourceParticipantsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/collab/get_resource_sessions.rs b/crates/weaver-api/src/sh_weaver/collab/get_resource_sessions.rs new file mode 100644 index 0000000..67e2c10 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/collab/get_resource_sessions.rs @@ -0,0 +1,154 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.collab.getResourceSessions +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetResourceSessions<'a> { + #[serde(borrow)] + pub resource: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_resource_sessions_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Resource; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Resource = Unset; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `resource` field + pub struct resource(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetResourceSessionsBuilder<'a, S: get_resource_sessions_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetResourceSessions<'a> { + /// Create a new builder for this type + pub fn new() -> GetResourceSessionsBuilder<'a, get_resource_sessions_state::Empty> { + GetResourceSessionsBuilder::new() + } +} + +impl<'a> GetResourceSessionsBuilder<'a, get_resource_sessions_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetResourceSessionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetResourceSessionsBuilder<'a, S> +where + S: get_resource_sessions_state::State, + S::Resource: get_resource_sessions_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> GetResourceSessionsBuilder<'a, get_resource_sessions_state::SetResource> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetResourceSessionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetResourceSessionsBuilder<'a, S> +where + S: get_resource_sessions_state::State, + S::Resource: get_resource_sessions_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetResourceSessions<'a> { + GetResourceSessions { + resource: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetResourceSessionsOutput<'a> { + #[serde(borrow)] + pub sessions: Vec>, +} + +/// Response type for +///sh.weaver.collab.getResourceSessions +pub struct GetResourceSessionsResponse; +impl jacquard_common::xrpc::XrpcResp for GetResourceSessionsResponse { + const NSID: &'static str = "sh.weaver.collab.getResourceSessions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetResourceSessionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetResourceSessions<'a> { + const NSID: &'static str = "sh.weaver.collab.getResourceSessions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetResourceSessionsResponse; +} + +/// Endpoint type for +///sh.weaver.collab.getResourceSessions +pub struct GetResourceSessionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetResourceSessionsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.collab.getResourceSessions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetResourceSessions<'de>; + type Response = GetResourceSessionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/collab/invite.rs b/crates/weaver-api/src/sh_weaver/collab/invite.rs index b5a4a05..ec74351 100644 --- a/crates/weaver-api/src/sh_weaver/collab/invite.rs +++ b/crates/weaver-api/src/sh_weaver/collab/invite.rs @@ -134,49 +134,49 @@ pub mod invite_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Resource; type CreatedAt; + type Resource; type Invitee; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Resource = Unset; type CreatedAt = Unset; + type Resource = Unset; type Invitee = Unset; } - ///State transition - sets the `resource` field to Set - pub struct SetResource(PhantomData S>); - impl sealed::Sealed for SetResource {} - impl State for SetResource { - type Resource = Set; - type CreatedAt = S::CreatedAt; - type Invitee = S::Invitee; - } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Resource = S::Resource; type CreatedAt = Set; + type Resource = S::Resource; + type Invitee = S::Invitee; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type CreatedAt = S::CreatedAt; + type Resource = Set; type Invitee = S::Invitee; } ///State transition - sets the `invitee` field to Set pub struct SetInvitee(PhantomData S>); impl sealed::Sealed for SetInvitee {} impl State for SetInvitee { - type Resource = S::Resource; type CreatedAt = S::CreatedAt; + type Resource = S::Resource; type Invitee = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `resource` field - pub struct resource(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `resource` field + pub struct resource(()); ///Marker type for the `invitee` field pub struct invitee(()); } @@ -328,8 +328,8 @@ impl<'a, S: invite_state::State> InviteBuilder<'a, S> { impl<'a, S> InviteBuilder<'a, S> where S: invite_state::State, - S::Resource: invite_state::IsSet, S::CreatedAt: invite_state::IsSet, + S::Resource: invite_state::IsSet, S::Invitee: invite_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/collab/session.rs b/crates/weaver-api/src/sh_weaver/collab/session.rs index f1b894d..1fb3e66 100644 --- a/crates/weaver-api/src/sh_weaver/collab/session.rs +++ b/crates/weaver-api/src/sh_weaver/collab/session.rs @@ -44,49 +44,49 @@ pub mod session_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Resource; + type CreatedAt; type NodeId; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Resource = Unset; + type CreatedAt = Unset; type NodeId = Unset; } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Resource = S::Resource; - type NodeId = S::NodeId; - } ///State transition - sets the `resource` field to Set pub struct SetResource(PhantomData S>); impl sealed::Sealed for SetResource {} impl State for SetResource { - type CreatedAt = S::CreatedAt; type Resource = Set; + type CreatedAt = S::CreatedAt; + type NodeId = S::NodeId; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Resource = S::Resource; + type CreatedAt = Set; type NodeId = S::NodeId; } ///State transition - sets the `node_id` field to Set pub struct SetNodeId(PhantomData S>); impl sealed::Sealed for SetNodeId {} impl State for SetNodeId { - type CreatedAt = S::CreatedAt; type Resource = S::Resource; + type CreatedAt = S::CreatedAt; type NodeId = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `resource` field pub struct resource(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `node_id` field pub struct node_id(()); } @@ -221,8 +221,8 @@ where impl<'a, S> SessionBuilder<'a, S> where S: session_state::State, - S::CreatedAt: session_state::IsSet, S::Resource: session_state::IsSet, + S::CreatedAt: session_state::IsSet, S::NodeId: session_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/edit.rs b/crates/weaver-api/src/sh_weaver/edit.rs index 4a15301..04c8e2f 100644 --- a/crates/weaver-api/src/sh_weaver/edit.rs +++ b/crates/weaver-api/src/sh_weaver/edit.rs @@ -8,6 +8,9 @@ pub mod cursor; pub mod diff; pub mod draft; +pub mod get_branch; +pub mod get_edit_history; +pub mod get_edit_tree; pub mod root; #[jacquard_derive::lexicon] @@ -219,6 +222,341 @@ fn lexicon_doc_sh_weaver_edit_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< }, }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("editBranchView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A branch/fork in edit history (for when collaborators diverge).", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("head"), + ::jacquard_common::smol_str::SmolStr::new_static("author"), + ::jacquard_common::smol_str::SmolStr::new_static("length"), + ::jacquard_common::smol_str::SmolStr::new_static("lastUpdated") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("author"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "divergesFrom", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("head"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("isMerged"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "lastUpdated", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("length"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("root"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("editHistoryEntry"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Summary of an edit (root or diff) for history queries.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("author"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt"), + ::jacquard_common::smol_str::SmolStr::new_static("type") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("author"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "hasInlineDiff", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("prevRef"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rootRef"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "snapshotCid", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("type"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("editTreeView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Full tree structure showing all branches for a resource.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("resource"), + ::jacquard_common::smol_str::SmolStr::new_static("branches") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("branches"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#editBranchView", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "conflictPoints", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Diffs where branches diverge", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "hasConflicts", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "mainBranch", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#editBranchView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("resource"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map + }, + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("entryRef"), ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { @@ -338,6 +676,986 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for DraftRef<'a> { } } +/// A branch/fork in edit history (for when collaborators diverge). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct EditBranchView<'a> { + #[serde(borrow)] + pub author: crate::sh_weaver::actor::ProfileViewBasic<'a>, + /// Common ancestor if this is a fork + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub diverges_from: std::option::Option< + crate::com_atproto::repo::strong_ref::StrongRef<'a>, + >, + #[serde(borrow)] + pub head: crate::com_atproto::repo::strong_ref::StrongRef<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub is_merged: std::option::Option, + pub last_updated: jacquard_common::types::string::Datetime, + /// Number of diffs in this branch + pub length: i64, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub root: std::option::Option>, +} + +pub mod edit_branch_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Head; + type Author; + type Length; + type LastUpdated; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Head = Unset; + type Author = Unset; + type Length = Unset; + type LastUpdated = Unset; + } + ///State transition - sets the `head` field to Set + pub struct SetHead(PhantomData S>); + impl sealed::Sealed for SetHead {} + impl State for SetHead { + type Head = Set; + type Author = S::Author; + type Length = S::Length; + type LastUpdated = S::LastUpdated; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type Head = S::Head; + type Author = Set; + type Length = S::Length; + type LastUpdated = S::LastUpdated; + } + ///State transition - sets the `length` field to Set + pub struct SetLength(PhantomData S>); + impl sealed::Sealed for SetLength {} + impl State for SetLength { + type Head = S::Head; + type Author = S::Author; + type Length = Set; + type LastUpdated = S::LastUpdated; + } + ///State transition - sets the `last_updated` field to Set + pub struct SetLastUpdated(PhantomData S>); + impl sealed::Sealed for SetLastUpdated {} + impl State for SetLastUpdated { + type Head = S::Head; + type Author = S::Author; + type Length = S::Length; + type LastUpdated = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `head` field + pub struct head(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `length` field + pub struct length(()); + ///Marker type for the `last_updated` field + pub struct last_updated(()); + } +} + +/// Builder for constructing an instance of this type +pub struct EditBranchViewBuilder<'a, S: edit_branch_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> EditBranchView<'a> { + /// Create a new builder for this type + pub fn new() -> EditBranchViewBuilder<'a, edit_branch_view_state::Empty> { + EditBranchViewBuilder::new() + } +} + +impl<'a> EditBranchViewBuilder<'a, edit_branch_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EditBranchViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EditBranchViewBuilder<'a, S> +where + S: edit_branch_view_state::State, + S::Author: edit_branch_view_state::IsUnset, +{ + /// Set the `author` field (required) + pub fn author( + mut self, + value: impl Into>, + ) -> EditBranchViewBuilder<'a, edit_branch_view_state::SetAuthor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EditBranchViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: edit_branch_view_state::State> EditBranchViewBuilder<'a, S> { + /// Set the `divergesFrom` field (optional) + pub fn diverges_from( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `divergesFrom` field to an Option value (optional) + pub fn maybe_diverges_from( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> EditBranchViewBuilder<'a, S> +where + S: edit_branch_view_state::State, + S::Head: edit_branch_view_state::IsUnset, +{ + /// Set the `head` field (required) + pub fn head( + mut self, + value: impl Into>, + ) -> EditBranchViewBuilder<'a, edit_branch_view_state::SetHead> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + EditBranchViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: edit_branch_view_state::State> EditBranchViewBuilder<'a, S> { + /// Set the `isMerged` field (optional) + pub fn is_merged(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `isMerged` field to an Option value (optional) + pub fn maybe_is_merged(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> EditBranchViewBuilder<'a, S> +where + S: edit_branch_view_state::State, + S::LastUpdated: edit_branch_view_state::IsUnset, +{ + /// Set the `lastUpdated` field (required) + pub fn last_updated( + mut self, + value: impl Into, + ) -> EditBranchViewBuilder<'a, edit_branch_view_state::SetLastUpdated> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + EditBranchViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EditBranchViewBuilder<'a, S> +where + S: edit_branch_view_state::State, + S::Length: edit_branch_view_state::IsUnset, +{ + /// Set the `length` field (required) + pub fn length( + mut self, + value: impl Into, + ) -> EditBranchViewBuilder<'a, edit_branch_view_state::SetLength> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + EditBranchViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: edit_branch_view_state::State> EditBranchViewBuilder<'a, S> { + /// Set the `root` field (optional) + pub fn root( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `root` field to an Option value (optional) + pub fn maybe_root( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> EditBranchViewBuilder<'a, S> +where + S: edit_branch_view_state::State, + S::Head: edit_branch_view_state::IsSet, + S::Author: edit_branch_view_state::IsSet, + S::Length: edit_branch_view_state::IsSet, + S::LastUpdated: edit_branch_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> EditBranchView<'a> { + EditBranchView { + author: self.__unsafe_private_named.0.unwrap(), + diverges_from: self.__unsafe_private_named.1, + head: self.__unsafe_private_named.2.unwrap(), + is_merged: self.__unsafe_private_named.3, + last_updated: self.__unsafe_private_named.4.unwrap(), + length: self.__unsafe_private_named.5.unwrap(), + root: self.__unsafe_private_named.6, + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> EditBranchView<'a> { + EditBranchView { + author: self.__unsafe_private_named.0.unwrap(), + diverges_from: self.__unsafe_private_named.1, + head: self.__unsafe_private_named.2.unwrap(), + is_merged: self.__unsafe_private_named.3, + last_updated: self.__unsafe_private_named.4.unwrap(), + length: self.__unsafe_private_named.5.unwrap(), + root: self.__unsafe_private_named.6, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EditBranchView<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.defs" + } + fn def_name() -> &'static str { + "editBranchView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Summary of an edit (root or diff) for history queries. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct EditHistoryEntry<'a> { + #[serde(borrow)] + pub author: crate::sh_weaver::actor::ProfileViewBasic<'a>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub created_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub has_inline_diff: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub prev_ref: std::option::Option< + crate::com_atproto::repo::strong_ref::StrongRef<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub root_ref: std::option::Option< + crate::com_atproto::repo::strong_ref::StrongRef<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub snapshot_cid: std::option::Option>, + #[serde(borrow)] + pub r#type: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod edit_history_entry_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Uri; + type Author; + type Cid; + type Type; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uri = Unset; + type Author = Unset; + type Cid = Unset; + type Type = Unset; + type CreatedAt = Unset; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Uri = Set; + type Author = S::Author; + type Cid = S::Cid; + type Type = S::Type; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type Uri = S::Uri; + type Author = Set; + type Cid = S::Cid; + type Type = S::Type; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Uri = S::Uri; + type Author = S::Author; + type Cid = Set; + type Type = S::Type; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `type` field to Set + pub struct SetType(PhantomData S>); + impl sealed::Sealed for SetType {} + impl State for SetType { + type Uri = S::Uri; + type Author = S::Author; + type Cid = S::Cid; + type Type = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Uri = S::Uri; + type Author = S::Author; + type Cid = S::Cid; + type Type = S::Type; + type CreatedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `author` field + pub struct author(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `type` field + pub struct r#type(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct EditHistoryEntryBuilder<'a, S: edit_history_entry_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> EditHistoryEntry<'a> { + /// Create a new builder for this type + pub fn new() -> EditHistoryEntryBuilder<'a, edit_history_entry_state::Empty> { + EditHistoryEntryBuilder::new() + } +} + +impl<'a> EditHistoryEntryBuilder<'a, edit_history_entry_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EditHistoryEntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EditHistoryEntryBuilder<'a, S> +where + S: edit_history_entry_state::State, + S::Author: edit_history_entry_state::IsUnset, +{ + /// Set the `author` field (required) + pub fn author( + mut self, + value: impl Into>, + ) -> EditHistoryEntryBuilder<'a, edit_history_entry_state::SetAuthor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EditHistoryEntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EditHistoryEntryBuilder<'a, S> +where + S: edit_history_entry_state::State, + S::Cid: edit_history_entry_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> EditHistoryEntryBuilder<'a, edit_history_entry_state::SetCid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + EditHistoryEntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EditHistoryEntryBuilder<'a, S> +where + S: edit_history_entry_state::State, + S::CreatedAt: edit_history_entry_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> EditHistoryEntryBuilder<'a, edit_history_entry_state::SetCreatedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + EditHistoryEntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: edit_history_entry_state::State> EditHistoryEntryBuilder<'a, S> { + /// Set the `hasInlineDiff` field (optional) + pub fn has_inline_diff(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `hasInlineDiff` field to an Option value (optional) + pub fn maybe_has_inline_diff(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: edit_history_entry_state::State> EditHistoryEntryBuilder<'a, S> { + /// Set the `prevRef` field (optional) + pub fn prev_ref( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `prevRef` field to an Option value (optional) + pub fn maybe_prev_ref( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: edit_history_entry_state::State> EditHistoryEntryBuilder<'a, S> { + /// Set the `rootRef` field (optional) + pub fn root_ref( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `rootRef` field to an Option value (optional) + pub fn maybe_root_ref( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: edit_history_entry_state::State> EditHistoryEntryBuilder<'a, S> { + /// Set the `snapshotCid` field (optional) + pub fn snapshot_cid( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `snapshotCid` field to an Option value (optional) + pub fn maybe_snapshot_cid( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> EditHistoryEntryBuilder<'a, S> +where + S: edit_history_entry_state::State, + S::Type: edit_history_entry_state::IsUnset, +{ + /// Set the `type` field (required) + pub fn r#type( + mut self, + value: impl Into>, + ) -> EditHistoryEntryBuilder<'a, edit_history_entry_state::SetType> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + EditHistoryEntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EditHistoryEntryBuilder<'a, S> +where + S: edit_history_entry_state::State, + S::Uri: edit_history_entry_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> EditHistoryEntryBuilder<'a, edit_history_entry_state::SetUri> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + EditHistoryEntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EditHistoryEntryBuilder<'a, S> +where + S: edit_history_entry_state::State, + S::Uri: edit_history_entry_state::IsSet, + S::Author: edit_history_entry_state::IsSet, + S::Cid: edit_history_entry_state::IsSet, + S::Type: edit_history_entry_state::IsSet, + S::CreatedAt: edit_history_entry_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> EditHistoryEntry<'a> { + EditHistoryEntry { + author: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + created_at: self.__unsafe_private_named.2.unwrap(), + has_inline_diff: self.__unsafe_private_named.3, + prev_ref: self.__unsafe_private_named.4, + root_ref: self.__unsafe_private_named.5, + snapshot_cid: self.__unsafe_private_named.6, + r#type: self.__unsafe_private_named.7.unwrap(), + uri: self.__unsafe_private_named.8.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> EditHistoryEntry<'a> { + EditHistoryEntry { + author: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + created_at: self.__unsafe_private_named.2.unwrap(), + has_inline_diff: self.__unsafe_private_named.3, + prev_ref: self.__unsafe_private_named.4, + root_ref: self.__unsafe_private_named.5, + snapshot_cid: self.__unsafe_private_named.6, + r#type: self.__unsafe_private_named.7.unwrap(), + uri: self.__unsafe_private_named.8.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EditHistoryEntry<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.defs" + } + fn def_name() -> &'static str { + "editHistoryEntry" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Full tree structure showing all branches for a resource. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct EditTreeView<'a> { + #[serde(borrow)] + pub branches: Vec>, + /// Diffs where branches diverge + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub conflict_points: std::option::Option< + Vec>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub has_conflicts: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub main_branch: std::option::Option>, + #[serde(borrow)] + pub resource: crate::com_atproto::repo::strong_ref::StrongRef<'a>, +} + +pub mod edit_tree_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Branches; + type Resource; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Branches = Unset; + type Resource = Unset; + } + ///State transition - sets the `branches` field to Set + pub struct SetBranches(PhantomData S>); + impl sealed::Sealed for SetBranches {} + impl State for SetBranches { + type Branches = Set; + type Resource = S::Resource; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Branches = S::Branches; + type Resource = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `branches` field + pub struct branches(()); + ///Marker type for the `resource` field + pub struct resource(()); + } +} + +/// Builder for constructing an instance of this type +pub struct EditTreeViewBuilder<'a, S: edit_tree_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option>>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> EditTreeView<'a> { + /// Create a new builder for this type + pub fn new() -> EditTreeViewBuilder<'a, edit_tree_view_state::Empty> { + EditTreeViewBuilder::new() + } +} + +impl<'a> EditTreeViewBuilder<'a, edit_tree_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EditTreeViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EditTreeViewBuilder<'a, S> +where + S: edit_tree_view_state::State, + S::Branches: edit_tree_view_state::IsUnset, +{ + /// Set the `branches` field (required) + pub fn branches( + mut self, + value: impl Into>>, + ) -> EditTreeViewBuilder<'a, edit_tree_view_state::SetBranches> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EditTreeViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: edit_tree_view_state::State> EditTreeViewBuilder<'a, S> { + /// Set the `conflictPoints` field (optional) + pub fn conflict_points( + mut self, + value: impl Into< + Option>>, + >, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `conflictPoints` field to an Option value (optional) + pub fn maybe_conflict_points( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: edit_tree_view_state::State> EditTreeViewBuilder<'a, S> { + /// Set the `hasConflicts` field (optional) + pub fn has_conflicts(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `hasConflicts` field to an Option value (optional) + pub fn maybe_has_conflicts(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: edit_tree_view_state::State> EditTreeViewBuilder<'a, S> { + /// Set the `mainBranch` field (optional) + pub fn main_branch( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `mainBranch` field to an Option value (optional) + pub fn maybe_main_branch( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> EditTreeViewBuilder<'a, S> +where + S: edit_tree_view_state::State, + S::Resource: edit_tree_view_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> EditTreeViewBuilder<'a, edit_tree_view_state::SetResource> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + EditTreeViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EditTreeViewBuilder<'a, S> +where + S: edit_tree_view_state::State, + S::Branches: edit_tree_view_state::IsSet, + S::Resource: edit_tree_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> EditTreeView<'a> { + EditTreeView { + branches: self.__unsafe_private_named.0.unwrap(), + conflict_points: self.__unsafe_private_named.1, + has_conflicts: self.__unsafe_private_named.2, + main_branch: self.__unsafe_private_named.3, + resource: self.__unsafe_private_named.4.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> EditTreeView<'a> { + EditTreeView { + branches: self.__unsafe_private_named.0.unwrap(), + conflict_points: self.__unsafe_private_named.1, + has_conflicts: self.__unsafe_private_named.2, + main_branch: self.__unsafe_private_named.3, + resource: self.__unsafe_private_named.4.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EditTreeView<'a> { + fn nsid() -> &'static str { + "sh.weaver.edit.defs" + } + fn def_name() -> &'static str { + "editTreeView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_edit_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + #[jacquard_derive::lexicon] #[derive( serde::Serialize, diff --git a/crates/weaver-api/src/sh_weaver/edit/cursor.rs b/crates/weaver-api/src/sh_weaver/edit/cursor.rs index 3fec0e8..00f070f 100644 --- a/crates/weaver-api/src/sh_weaver/edit/cursor.rs +++ b/crates/weaver-api/src/sh_weaver/edit/cursor.rs @@ -586,37 +586,37 @@ pub mod id_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Counter; type Peer; + type Counter; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Counter = Unset; type Peer = Unset; - } - ///State transition - sets the `counter` field to Set - pub struct SetCounter(PhantomData S>); - impl sealed::Sealed for SetCounter {} - impl State for SetCounter { - type Counter = Set; - type Peer = S::Peer; + type Counter = Unset; } ///State transition - sets the `peer` field to Set pub struct SetPeer(PhantomData S>); impl sealed::Sealed for SetPeer {} impl State for SetPeer { - type Counter = S::Counter; type Peer = Set; + type Counter = S::Counter; + } + ///State transition - sets the `counter` field to Set + pub struct SetCounter(PhantomData S>); + impl sealed::Sealed for SetCounter {} + impl State for SetCounter { + type Peer = S::Peer; + type Counter = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `counter` field - pub struct counter(()); ///Marker type for the `peer` field pub struct peer(()); + ///Marker type for the `counter` field + pub struct counter(()); } } @@ -683,8 +683,8 @@ where impl<'a, S> IdBuilder<'a, S> where S: id_state::State, - S::Counter: id_state::IsSet, S::Peer: id_state::IsSet, + S::Counter: id_state::IsSet, { /// Build the final struct pub fn build(self) -> Id<'a> { @@ -1017,51 +1017,51 @@ pub mod normal_container_id_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ContainerType; - type Peer; type Counter; + type Peer; + type ContainerType; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ContainerType = Unset; - type Peer = Unset; type Counter = Unset; + type Peer = Unset; + type ContainerType = Unset; } - ///State transition - sets the `container_type` field to Set - pub struct SetContainerType(PhantomData S>); - impl sealed::Sealed for SetContainerType {} - impl State for SetContainerType { - type ContainerType = Set; + ///State transition - sets the `counter` field to Set + pub struct SetCounter(PhantomData S>); + impl sealed::Sealed for SetCounter {} + impl State for SetCounter { + type Counter = Set; type Peer = S::Peer; - type Counter = S::Counter; + type ContainerType = S::ContainerType; } ///State transition - sets the `peer` field to Set pub struct SetPeer(PhantomData S>); impl sealed::Sealed for SetPeer {} impl State for SetPeer { - type ContainerType = S::ContainerType; - type Peer = Set; type Counter = S::Counter; - } - ///State transition - sets the `counter` field to Set - pub struct SetCounter(PhantomData S>); - impl sealed::Sealed for SetCounter {} - impl State for SetCounter { + type Peer = Set; type ContainerType = S::ContainerType; + } + ///State transition - sets the `container_type` field to Set + pub struct SetContainerType(PhantomData S>); + impl sealed::Sealed for SetContainerType {} + impl State for SetContainerType { + type Counter = S::Counter; type Peer = S::Peer; - type Counter = Set; + type ContainerType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `container_type` field - pub struct container_type(()); - ///Marker type for the `peer` field - pub struct peer(()); ///Marker type for the `counter` field pub struct counter(()); + ///Marker type for the `peer` field + pub struct peer(()); + ///Marker type for the `container_type` field + pub struct container_type(()); } } @@ -1154,9 +1154,9 @@ where impl<'a, S> NormalContainerIdBuilder<'a, S> where S: normal_container_id_state::State, - S::ContainerType: normal_container_id_state::IsSet, - S::Peer: normal_container_id_state::IsSet, S::Counter: normal_container_id_state::IsSet, + S::Peer: normal_container_id_state::IsSet, + S::ContainerType: normal_container_id_state::IsSet, { /// Build the final struct pub fn build(self) -> NormalContainerId<'a> { diff --git a/crates/weaver-api/src/sh_weaver/edit/diff.rs b/crates/weaver-api/src/sh_weaver/edit/diff.rs index 52a4bdb..8faf131 100644 --- a/crates/weaver-api/src/sh_weaver/edit/diff.rs +++ b/crates/weaver-api/src/sh_weaver/edit/diff.rs @@ -47,37 +47,37 @@ pub mod diff_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Root; type Doc; + type Root; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Root = Unset; type Doc = Unset; - } - ///State transition - sets the `root` field to Set - pub struct SetRoot(PhantomData S>); - impl sealed::Sealed for SetRoot {} - impl State for SetRoot { - type Root = Set; - type Doc = S::Doc; + type Root = Unset; } ///State transition - sets the `doc` field to Set pub struct SetDoc(PhantomData S>); impl sealed::Sealed for SetDoc {} impl State for SetDoc { - type Root = S::Root; type Doc = Set; + type Root = S::Root; + } + ///State transition - sets the `root` field to Set + pub struct SetRoot(PhantomData S>); + impl sealed::Sealed for SetRoot {} + impl State for SetRoot { + type Doc = S::Doc; + type Root = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `root` field - pub struct root(()); ///Marker type for the `doc` field pub struct doc(()); + ///Marker type for the `root` field + pub struct root(()); } } @@ -224,8 +224,8 @@ impl<'a, S: diff_state::State> DiffBuilder<'a, S> { impl<'a, S> DiffBuilder<'a, S> where S: diff_state::State, - S::Root: diff_state::IsSet, S::Doc: diff_state::IsSet, + S::Root: diff_state::IsSet, { /// Build the final struct pub fn build(self) -> Diff<'a> { diff --git a/crates/weaver-api/src/sh_weaver/edit/get_branch.rs b/crates/weaver-api/src/sh_weaver/edit/get_branch.rs new file mode 100644 index 0000000..2e17e39 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/edit/get_branch.rs @@ -0,0 +1,222 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.edit.getBranch +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetBranch<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub after_rkey: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub head: jacquard_common::types::string::AtUri<'a>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_branch_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Head; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Head = Unset; + } + ///State transition - sets the `head` field to Set + pub struct SetHead(PhantomData S>); + impl sealed::Sealed for SetHead {} + impl State for SetHead { + type Head = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `head` field + pub struct head(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetBranchBuilder<'a, S: get_branch_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetBranch<'a> { + /// Create a new builder for this type + pub fn new() -> GetBranchBuilder<'a, get_branch_state::Empty> { + GetBranchBuilder::new() + } +} + +impl<'a> GetBranchBuilder<'a, get_branch_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetBranchBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_branch_state::State> GetBranchBuilder<'a, S> { + /// Set the `afterRkey` field (optional) + pub fn after_rkey( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `afterRkey` field to an Option value (optional) + pub fn maybe_after_rkey( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_branch_state::State> GetBranchBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetBranchBuilder<'a, S> +where + S: get_branch_state::State, + S::Head: get_branch_state::IsUnset, +{ + /// Set the `head` field (required) + pub fn head( + mut self, + value: impl Into>, + ) -> GetBranchBuilder<'a, get_branch_state::SetHead> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetBranchBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_branch_state::State> GetBranchBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> GetBranchBuilder<'a, S> +where + S: get_branch_state::State, + S::Head: get_branch_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetBranch<'a> { + GetBranch { + after_rkey: self.__unsafe_private_named.0, + cursor: self.__unsafe_private_named.1, + head: self.__unsafe_private_named.2.unwrap(), + limit: self.__unsafe_private_named.3, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetBranchOutput<'a> { + #[serde(borrow)] + pub branch: crate::sh_weaver::edit::EditBranchView<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub diffs: Vec>, +} + +/// Response type for +///sh.weaver.edit.getBranch +pub struct GetBranchResponse; +impl jacquard_common::xrpc::XrpcResp for GetBranchResponse { + const NSID: &'static str = "sh.weaver.edit.getBranch"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetBranchOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetBranch<'a> { + const NSID: &'static str = "sh.weaver.edit.getBranch"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetBranchResponse; +} + +/// Endpoint type for +///sh.weaver.edit.getBranch +pub struct GetBranchRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetBranchRequest { + const PATH: &'static str = "/xrpc/sh.weaver.edit.getBranch"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetBranch<'de>; + type Response = GetBranchResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/edit/get_edit_history.rs b/crates/weaver-api/src/sh_weaver/edit/get_edit_history.rs new file mode 100644 index 0000000..1f5bb44 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/edit/get_edit_history.rs @@ -0,0 +1,222 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.edit.getEditHistory +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetEditHistory<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub after_rkey: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub resource: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_edit_history_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Resource; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Resource = Unset; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `resource` field + pub struct resource(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetEditHistoryBuilder<'a, S: get_edit_history_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetEditHistory<'a> { + /// Create a new builder for this type + pub fn new() -> GetEditHistoryBuilder<'a, get_edit_history_state::Empty> { + GetEditHistoryBuilder::new() + } +} + +impl<'a> GetEditHistoryBuilder<'a, get_edit_history_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetEditHistoryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_edit_history_state::State> GetEditHistoryBuilder<'a, S> { + /// Set the `afterRkey` field (optional) + pub fn after_rkey( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `afterRkey` field to an Option value (optional) + pub fn maybe_after_rkey( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_edit_history_state::State> GetEditHistoryBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_edit_history_state::State> GetEditHistoryBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetEditHistoryBuilder<'a, S> +where + S: get_edit_history_state::State, + S::Resource: get_edit_history_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> GetEditHistoryBuilder<'a, get_edit_history_state::SetResource> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + GetEditHistoryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetEditHistoryBuilder<'a, S> +where + S: get_edit_history_state::State, + S::Resource: get_edit_history_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetEditHistory<'a> { + GetEditHistory { + after_rkey: self.__unsafe_private_named.0, + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + resource: self.__unsafe_private_named.3.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetEditHistoryOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub diffs: Vec>, + #[serde(borrow)] + pub roots: Vec>, +} + +/// Response type for +///sh.weaver.edit.getEditHistory +pub struct GetEditHistoryResponse; +impl jacquard_common::xrpc::XrpcResp for GetEditHistoryResponse { + const NSID: &'static str = "sh.weaver.edit.getEditHistory"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetEditHistoryOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetEditHistory<'a> { + const NSID: &'static str = "sh.weaver.edit.getEditHistory"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetEditHistoryResponse; +} + +/// Endpoint type for +///sh.weaver.edit.getEditHistory +pub struct GetEditHistoryRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetEditHistoryRequest { + const PATH: &'static str = "/xrpc/sh.weaver.edit.getEditHistory"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetEditHistory<'de>; + type Response = GetEditHistoryResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/edit/get_edit_tree.rs b/crates/weaver-api/src/sh_weaver/edit/get_edit_tree.rs new file mode 100644 index 0000000..85daf6e --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/edit/get_edit_tree.rs @@ -0,0 +1,155 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.edit.getEditTree +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetEditTree<'a> { + #[serde(borrow)] + pub resource: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_edit_tree_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Resource; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Resource = Unset; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `resource` field + pub struct resource(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetEditTreeBuilder<'a, S: get_edit_tree_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetEditTree<'a> { + /// Create a new builder for this type + pub fn new() -> GetEditTreeBuilder<'a, get_edit_tree_state::Empty> { + GetEditTreeBuilder::new() + } +} + +impl<'a> GetEditTreeBuilder<'a, get_edit_tree_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetEditTreeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetEditTreeBuilder<'a, S> +where + S: get_edit_tree_state::State, + S::Resource: get_edit_tree_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> GetEditTreeBuilder<'a, get_edit_tree_state::SetResource> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetEditTreeBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetEditTreeBuilder<'a, S> +where + S: get_edit_tree_state::State, + S::Resource: get_edit_tree_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetEditTree<'a> { + GetEditTree { + resource: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetEditTreeOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: crate::sh_weaver::edit::EditTreeView<'a>, +} + +/// Response type for +///sh.weaver.edit.getEditTree +pub struct GetEditTreeResponse; +impl jacquard_common::xrpc::XrpcResp for GetEditTreeResponse { + const NSID: &'static str = "sh.weaver.edit.getEditTree"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetEditTreeOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetEditTree<'a> { + const NSID: &'static str = "sh.weaver.edit.getEditTree"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetEditTreeResponse; +} + +/// Endpoint type for +///sh.weaver.edit.getEditTree +pub struct GetEditTreeRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetEditTreeRequest { + const PATH: &'static str = "/xrpc/sh.weaver.edit.getEditTree"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetEditTree<'de>; + type Response = GetEditTreeResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/embed/external.rs b/crates/weaver-api/src/sh_weaver/embed/external.rs index 75c1e2e..5585778 100644 --- a/crates/weaver-api/src/sh_weaver/embed/external.rs +++ b/crates/weaver-api/src/sh_weaver/embed/external.rs @@ -38,51 +38,51 @@ pub mod external_embed_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Description; type Title; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Description = Unset; type Title = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Description = S::Description; - type Title = S::Title; + type Uri = Unset; } ///State transition - sets the `description` field to Set pub struct SetDescription(PhantomData S>); impl sealed::Sealed for SetDescription {} impl State for SetDescription { - type Uri = S::Uri; type Description = Set; type Title = S::Title; + type Uri = S::Uri; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData S>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { - type Uri = S::Uri; type Description = S::Description; type Title = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Description = S::Description; + type Title = S::Title; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `description` field pub struct description(()); ///Marker type for the `title` field pub struct title(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -195,9 +195,9 @@ where impl<'a, S> ExternalEmbedBuilder<'a, S> where S: external_embed_state::State, - S::Uri: external_embed_state::IsSet, S::Description: external_embed_state::IsSet, S::Title: external_embed_state::IsSet, + S::Uri: external_embed_state::IsSet, { /// Build the final struct pub fn build(self) -> ExternalEmbed<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/images.rs b/crates/weaver-api/src/sh_weaver/embed/images.rs index 2a0edd4..aa61830 100644 --- a/crates/weaver-api/src/sh_weaver/embed/images.rs +++ b/crates/weaver-api/src/sh_weaver/embed/images.rs @@ -902,51 +902,51 @@ pub mod view_image_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Alt; - type Fullsize; type Thumb; + type Fullsize; + type Alt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Alt = Unset; - type Fullsize = Unset; type Thumb = Unset; + type Fullsize = Unset; + type Alt = Unset; } - ///State transition - sets the `alt` field to Set - pub struct SetAlt(PhantomData S>); - impl sealed::Sealed for SetAlt {} - impl State for SetAlt { - type Alt = Set; + ///State transition - sets the `thumb` field to Set + pub struct SetThumb(PhantomData S>); + impl sealed::Sealed for SetThumb {} + impl State for SetThumb { + type Thumb = Set; type Fullsize = S::Fullsize; - type Thumb = S::Thumb; + type Alt = S::Alt; } ///State transition - sets the `fullsize` field to Set pub struct SetFullsize(PhantomData S>); impl sealed::Sealed for SetFullsize {} impl State for SetFullsize { - type Alt = S::Alt; - type Fullsize = Set; type Thumb = S::Thumb; - } - ///State transition - sets the `thumb` field to Set - pub struct SetThumb(PhantomData S>); - impl sealed::Sealed for SetThumb {} - impl State for SetThumb { + type Fullsize = Set; type Alt = S::Alt; + } + ///State transition - sets the `alt` field to Set + pub struct SetAlt(PhantomData S>); + impl sealed::Sealed for SetAlt {} + impl State for SetAlt { + type Thumb = S::Thumb; type Fullsize = S::Fullsize; - type Thumb = Set; + type Alt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `alt` field - pub struct alt(()); - ///Marker type for the `fullsize` field - pub struct fullsize(()); ///Marker type for the `thumb` field pub struct thumb(()); + ///Marker type for the `fullsize` field + pub struct fullsize(()); + ///Marker type for the `alt` field + pub struct alt(()); } } @@ -1073,9 +1073,9 @@ where impl<'a, S> ViewImageBuilder<'a, S> where S: view_image_state::State, - S::Alt: view_image_state::IsSet, - S::Fullsize: view_image_state::IsSet, S::Thumb: view_image_state::IsSet, + S::Fullsize: view_image_state::IsSet, + S::Alt: view_image_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewImage<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs b/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs index a286344..2a25c43 100644 --- a/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs +++ b/crates/weaver-api/src/sh_weaver/embed/record_with_media.rs @@ -33,37 +33,37 @@ pub mod record_with_media_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Media; type Records; + type Media; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Media = Unset; type Records = Unset; - } - ///State transition - sets the `media` field to Set - pub struct SetMedia(PhantomData S>); - impl sealed::Sealed for SetMedia {} - impl State for SetMedia { - type Media = Set; - type Records = S::Records; + type Media = Unset; } ///State transition - sets the `records` field to Set pub struct SetRecords(PhantomData S>); impl sealed::Sealed for SetRecords {} impl State for SetRecords { - type Media = S::Media; type Records = Set; + type Media = S::Media; + } + ///State transition - sets the `media` field to Set + pub struct SetMedia(PhantomData S>); + impl sealed::Sealed for SetMedia {} + impl State for SetMedia { + type Records = S::Records; + type Media = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `media` field - pub struct media(()); ///Marker type for the `records` field pub struct records(()); + ///Marker type for the `media` field + pub struct media(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> RecordWithMediaBuilder<'a, S> where S: record_with_media_state::State, - S::Media: record_with_media_state::IsSet, S::Records: record_with_media_state::IsSet, + S::Media: record_with_media_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordWithMedia<'a> { diff --git a/crates/weaver-api/src/sh_weaver/embed/records.rs b/crates/weaver-api/src/sh_weaver/embed/records.rs index ee4aa16..46d5c23 100644 --- a/crates/weaver-api/src/sh_weaver/embed/records.rs +++ b/crates/weaver-api/src/sh_weaver/embed/records.rs @@ -1187,51 +1187,51 @@ pub mod view_blocked_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Blocked; type Author; type Uri; + type Blocked; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Blocked = Unset; type Author = Unset; type Uri = Unset; - } - ///State transition - sets the `blocked` field to Set - pub struct SetBlocked(PhantomData S>); - impl sealed::Sealed for SetBlocked {} - impl State for SetBlocked { - type Blocked = Set; - type Author = S::Author; - type Uri = S::Uri; + type Blocked = Unset; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Blocked = S::Blocked; type Author = Set; type Uri = S::Uri; + type Blocked = S::Blocked; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Blocked = S::Blocked; type Author = S::Author; type Uri = Set; + type Blocked = S::Blocked; + } + ///State transition - sets the `blocked` field to Set + pub struct SetBlocked(PhantomData S>); + impl sealed::Sealed for SetBlocked {} + impl State for SetBlocked { + type Author = S::Author; + type Uri = S::Uri; + type Blocked = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `blocked` field - pub struct blocked(()); ///Marker type for the `author` field pub struct author(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `blocked` field + pub struct blocked(()); } } @@ -1324,9 +1324,9 @@ where impl<'a, S> ViewBlockedBuilder<'a, S> where S: view_blocked_state::State, - S::Blocked: view_blocked_state::IsSet, S::Author: view_blocked_state::IsSet, S::Uri: view_blocked_state::IsSet, + S::Blocked: view_blocked_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewBlocked<'a> { @@ -1398,37 +1398,37 @@ pub mod view_detached_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Detached; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Detached = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Detached = S::Detached; + type Uri = Unset; } ///State transition - sets the `detached` field to Set pub struct SetDetached(PhantomData S>); impl sealed::Sealed for SetDetached {} impl State for SetDetached { - type Uri = S::Uri; type Detached = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Detached = S::Detached; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `detached` field pub struct detached(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -1501,8 +1501,8 @@ where impl<'a, S> ViewDetachedBuilder<'a, S> where S: view_detached_state::State, - S::Uri: view_detached_state::IsSet, S::Detached: view_detached_state::IsSet, + S::Uri: view_detached_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewDetached<'a> { @@ -1572,37 +1572,37 @@ pub mod view_not_found_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type NotFound; type Uri; + type NotFound; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type NotFound = Unset; type Uri = Unset; - } - ///State transition - sets the `not_found` field to Set - pub struct SetNotFound(PhantomData S>); - impl sealed::Sealed for SetNotFound {} - impl State for SetNotFound { - type NotFound = Set; - type Uri = S::Uri; + type NotFound = Unset; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type NotFound = S::NotFound; type Uri = Set; + type NotFound = S::NotFound; + } + ///State transition - sets the `not_found` field to Set + pub struct SetNotFound(PhantomData S>); + impl sealed::Sealed for SetNotFound {} + impl State for SetNotFound { + type Uri = S::Uri; + type NotFound = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `not_found` field - pub struct not_found(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `not_found` field + pub struct not_found(()); } } @@ -1675,8 +1675,8 @@ where impl<'a, S> ViewNotFoundBuilder<'a, S> where S: view_not_found_state::State, - S::NotFound: view_not_found_state::IsSet, S::Uri: view_not_found_state::IsSet, + S::NotFound: view_not_found_state::IsSet, { /// Build the final struct pub fn build(self) -> ViewNotFound<'a> { @@ -1769,83 +1769,83 @@ pub mod view_record_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Value; - type Uri; type IndexedAt; + type Uri; type Author; + type Value; type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Value = Unset; - type Uri = Unset; type IndexedAt = Unset; + type Uri = Unset; type Author = Unset; + type Value = Unset; type Cid = Unset; } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Value = Set; + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; type Uri = S::Uri; - type IndexedAt = S::IndexedAt; type Author = S::Author; + type Value = S::Value; type Cid = S::Cid; } ///State transition - sets the `uri` field to Set pub struct SetUri(PhantomData S>); impl sealed::Sealed for SetUri {} impl State for SetUri { - type Value = S::Value; - type Uri = Set; type IndexedAt = S::IndexedAt; + type Uri = Set; type Author = S::Author; - type Cid = S::Cid; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { type Value = S::Value; - type Uri = S::Uri; - type IndexedAt = Set; - type Author = S::Author; type Cid = S::Cid; } ///State transition - sets the `author` field to Set pub struct SetAuthor(PhantomData S>); impl sealed::Sealed for SetAuthor {} impl State for SetAuthor { - type Value = S::Value; - type Uri = S::Uri; type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Author = Set; + type Value = S::Value; + type Cid = S::Cid; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type IndexedAt = S::IndexedAt; + type Uri = S::Uri; + type Author = S::Author; + type Value = Set; type Cid = S::Cid; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type Value = S::Value; - type Uri = S::Uri; type IndexedAt = S::IndexedAt; + type Uri = S::Uri; type Author = S::Author; + type Value = S::Value; type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `value` field - pub struct value(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `uri` field + pub struct uri(()); ///Marker type for the `author` field pub struct author(()); + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `cid` field pub struct cid(()); } @@ -2092,10 +2092,10 @@ where impl<'a, S> ViewRecordBuilder<'a, S> where S: view_record_state::State, - S::Value: view_record_state::IsSet, - S::Uri: view_record_state::IsSet, S::IndexedAt: view_record_state::IsSet, + S::Uri: view_record_state::IsSet, S::Author: view_record_state::IsSet, + S::Value: view_record_state::IsSet, S::Cid: view_record_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/embed/video.rs b/crates/weaver-api/src/sh_weaver/embed/video.rs index 3caecde..c4629c2 100644 --- a/crates/weaver-api/src/sh_weaver/embed/video.rs +++ b/crates/weaver-api/src/sh_weaver/embed/video.rs @@ -32,37 +32,37 @@ pub mod caption_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type File; type Lang; + type File; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type File = Unset; type Lang = Unset; - } - ///State transition - sets the `file` field to Set - pub struct SetFile(PhantomData S>); - impl sealed::Sealed for SetFile {} - impl State for SetFile { - type File = Set; - type Lang = S::Lang; + type File = Unset; } ///State transition - sets the `lang` field to Set pub struct SetLang(PhantomData S>); impl sealed::Sealed for SetLang {} impl State for SetLang { - type File = S::File; type Lang = Set; + type File = S::File; + } + ///State transition - sets the `file` field to Set + pub struct SetFile(PhantomData S>); + impl sealed::Sealed for SetFile {} + impl State for SetFile { + type Lang = S::Lang; + type File = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `file` field - pub struct file(()); ///Marker type for the `lang` field pub struct lang(()); + ///Marker type for the `file` field + pub struct file(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> CaptionBuilder<'a, S> where S: caption_state::State, - S::File: caption_state::IsSet, S::Lang: caption_state::IsSet, + S::File: caption_state::IsSet, { /// Build the final struct pub fn build(self) -> Caption<'a> { @@ -940,37 +940,37 @@ pub mod view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; type Playlist; + type Cid; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; type Playlist = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Playlist = S::Playlist; + type Cid = Unset; } ///State transition - sets the `playlist` field to Set pub struct SetPlaylist(PhantomData S>); impl sealed::Sealed for SetPlaylist {} impl State for SetPlaylist { - type Cid = S::Cid; type Playlist = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Playlist = S::Playlist; + type Cid = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); ///Marker type for the `playlist` field pub struct playlist(()); + ///Marker type for the `cid` field + pub struct cid(()); } } @@ -1108,8 +1108,8 @@ impl<'a, S: view_state::State> ViewBuilder<'a, S> { impl<'a, S> ViewBuilder<'a, S> where S: view_state::State, - S::Cid: view_state::IsSet, S::Playlist: view_state::IsSet, + S::Cid: view_state::IsSet, { /// Build the final struct pub fn build(self) -> View<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph.rs b/crates/weaver-api/src/sh_weaver/graph.rs index 5746d0c..021b5be 100644 --- a/crates/weaver-api/src/sh_weaver/graph.rs +++ b/crates/weaver-api/src/sh_weaver/graph.rs @@ -9,11 +9,27 @@ pub mod bookmark; pub mod follow; pub mod follow_accept; pub mod follow_gate; +pub mod get_actor_bookmarks; +pub mod get_actor_likes; +pub mod get_actor_lists; +pub mod get_actor_subscriptions; +pub mod get_bookmarked_by; +pub mod get_followers; +pub mod get_following; +pub mod get_liked_by; +pub mod get_list; +pub mod get_popular_tags; +pub mod get_resource_tags; +pub mod get_subscribers; +pub mod get_tag_suggestions; +pub mod get_tagged_resources; +pub mod get_trending_tags; pub mod like; pub mod list; pub mod listitem; pub mod subscribe; pub mod subscribe_accept; +pub mod tag; /// A curated collection of notebooks/entries for sharing. #[derive( diff --git a/crates/weaver-api/src/sh_weaver/graph/bookmark.rs b/crates/weaver-api/src/sh_weaver/graph/bookmark.rs index efc3d29..3021db2 100644 --- a/crates/weaver-api/src/sh_weaver/graph/bookmark.rs +++ b/crates/weaver-api/src/sh_weaver/graph/bookmark.rs @@ -38,37 +38,37 @@ pub mod bookmark_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Subject; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Subject = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Subject = S::Subject; + type CreatedAt = Unset; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type CreatedAt = S::CreatedAt; type Subject = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -158,8 +158,8 @@ where impl<'a, S> BookmarkBuilder<'a, S> where S: bookmark_state::State, - S::CreatedAt: bookmark_state::IsSet, S::Subject: bookmark_state::IsSet, + S::CreatedAt: bookmark_state::IsSet, { /// Build the final struct pub fn build(self) -> Bookmark<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs b/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs index 19d3517..f92a05f 100644 --- a/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs +++ b/crates/weaver-api/src/sh_weaver/graph/follow_accept.rs @@ -34,37 +34,37 @@ pub mod follow_accept_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Follow; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Follow = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Follow = S::Follow; + type CreatedAt = Unset; } ///State transition - sets the `follow` field to Set pub struct SetFollow(PhantomData S>); impl sealed::Sealed for SetFollow {} impl State for SetFollow { - type CreatedAt = S::CreatedAt; type Follow = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Follow = S::Follow; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `follow` field pub struct follow(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> FollowAcceptBuilder<'a, S> where S: follow_accept_state::State, - S::CreatedAt: follow_accept_state::IsSet, S::Follow: follow_accept_state::IsSet, + S::CreatedAt: follow_accept_state::IsSet, { /// Build the final struct pub fn build(self) -> FollowAccept<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/get_actor_bookmarks.rs b/crates/weaver-api/src/sh_weaver/graph/get_actor_bookmarks.rs new file mode 100644 index 0000000..e7b9ca7 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_actor_bookmarks.rs @@ -0,0 +1,196 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getActorBookmarks +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorBookmarks<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_actor_bookmarks_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetActorBookmarksBuilder<'a, S: get_actor_bookmarks_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetActorBookmarks<'a> { + /// Create a new builder for this type + pub fn new() -> GetActorBookmarksBuilder<'a, get_actor_bookmarks_state::Empty> { + GetActorBookmarksBuilder::new() + } +} + +impl<'a> GetActorBookmarksBuilder<'a, get_actor_bookmarks_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetActorBookmarksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetActorBookmarksBuilder<'a, S> +where + S: get_actor_bookmarks_state::State, + S::Actor: get_actor_bookmarks_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetActorBookmarksBuilder<'a, get_actor_bookmarks_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetActorBookmarksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_actor_bookmarks_state::State> GetActorBookmarksBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_actor_bookmarks_state::State> GetActorBookmarksBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetActorBookmarksBuilder<'a, S> +where + S: get_actor_bookmarks_state::State, + S::Actor: get_actor_bookmarks_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetActorBookmarks<'a> { + GetActorBookmarks { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorBookmarksOutput<'a> { + #[serde(borrow)] + pub bookmarks: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///sh.weaver.graph.getActorBookmarks +pub struct GetActorBookmarksResponse; +impl jacquard_common::xrpc::XrpcResp for GetActorBookmarksResponse { + const NSID: &'static str = "sh.weaver.graph.getActorBookmarks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetActorBookmarksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorBookmarks<'a> { + const NSID: &'static str = "sh.weaver.graph.getActorBookmarks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetActorBookmarksResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getActorBookmarks +pub struct GetActorBookmarksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetActorBookmarksRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getActorBookmarks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetActorBookmarks<'de>; + type Response = GetActorBookmarksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_actor_likes.rs b/crates/weaver-api/src/sh_weaver/graph/get_actor_likes.rs new file mode 100644 index 0000000..a36e717 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_actor_likes.rs @@ -0,0 +1,196 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getActorLikes +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorLikes<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_actor_likes_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetActorLikesBuilder<'a, S: get_actor_likes_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetActorLikes<'a> { + /// Create a new builder for this type + pub fn new() -> GetActorLikesBuilder<'a, get_actor_likes_state::Empty> { + GetActorLikesBuilder::new() + } +} + +impl<'a> GetActorLikesBuilder<'a, get_actor_likes_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetActorLikesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetActorLikesBuilder<'a, S> +where + S: get_actor_likes_state::State, + S::Actor: get_actor_likes_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetActorLikesBuilder<'a, get_actor_likes_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetActorLikesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_actor_likes_state::State> GetActorLikesBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_actor_likes_state::State> GetActorLikesBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetActorLikesBuilder<'a, S> +where + S: get_actor_likes_state::State, + S::Actor: get_actor_likes_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetActorLikes<'a> { + GetActorLikes { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorLikesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub likes: Vec>, +} + +/// Response type for +///sh.weaver.graph.getActorLikes +pub struct GetActorLikesResponse; +impl jacquard_common::xrpc::XrpcResp for GetActorLikesResponse { + const NSID: &'static str = "sh.weaver.graph.getActorLikes"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetActorLikesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorLikes<'a> { + const NSID: &'static str = "sh.weaver.graph.getActorLikes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetActorLikesResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getActorLikes +pub struct GetActorLikesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetActorLikesRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getActorLikes"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetActorLikes<'de>; + type Response = GetActorLikesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_actor_lists.rs b/crates/weaver-api/src/sh_weaver/graph/get_actor_lists.rs new file mode 100644 index 0000000..ec36556 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_actor_lists.rs @@ -0,0 +1,217 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getActorLists +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorLists<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub purpose: std::option::Option>, +} + +pub mod get_actor_lists_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetActorListsBuilder<'a, S: get_actor_lists_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetActorLists<'a> { + /// Create a new builder for this type + pub fn new() -> GetActorListsBuilder<'a, get_actor_lists_state::Empty> { + GetActorListsBuilder::new() + } +} + +impl<'a> GetActorListsBuilder<'a, get_actor_lists_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetActorListsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetActorListsBuilder<'a, S> +where + S: get_actor_lists_state::State, + S::Actor: get_actor_lists_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetActorListsBuilder<'a, get_actor_lists_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetActorListsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_actor_lists_state::State> GetActorListsBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_actor_lists_state::State> GetActorListsBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_actor_lists_state::State> GetActorListsBuilder<'a, S> { + /// Set the `purpose` field (optional) + pub fn purpose( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `purpose` field to an Option value (optional) + pub fn maybe_purpose(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> GetActorListsBuilder<'a, S> +where + S: get_actor_lists_state::State, + S::Actor: get_actor_lists_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetActorLists<'a> { + GetActorLists { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + purpose: self.__unsafe_private_named.3, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorListsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub lists: Vec>, +} + +/// Response type for +///sh.weaver.graph.getActorLists +pub struct GetActorListsResponse; +impl jacquard_common::xrpc::XrpcResp for GetActorListsResponse { + const NSID: &'static str = "sh.weaver.graph.getActorLists"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetActorListsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorLists<'a> { + const NSID: &'static str = "sh.weaver.graph.getActorLists"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetActorListsResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getActorLists +pub struct GetActorListsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetActorListsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getActorLists"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetActorLists<'de>; + type Response = GetActorListsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_actor_subscriptions.rs b/crates/weaver-api/src/sh_weaver/graph/get_actor_subscriptions.rs new file mode 100644 index 0000000..b84c56d --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_actor_subscriptions.rs @@ -0,0 +1,199 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getActorSubscriptions +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorSubscriptions<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_actor_subscriptions_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetActorSubscriptionsBuilder<'a, S: get_actor_subscriptions_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetActorSubscriptions<'a> { + /// Create a new builder for this type + pub fn new() -> GetActorSubscriptionsBuilder< + 'a, + get_actor_subscriptions_state::Empty, + > { + GetActorSubscriptionsBuilder::new() + } +} + +impl<'a> GetActorSubscriptionsBuilder<'a, get_actor_subscriptions_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetActorSubscriptionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetActorSubscriptionsBuilder<'a, S> +where + S: get_actor_subscriptions_state::State, + S::Actor: get_actor_subscriptions_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetActorSubscriptionsBuilder<'a, get_actor_subscriptions_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetActorSubscriptionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_actor_subscriptions_state::State> GetActorSubscriptionsBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_actor_subscriptions_state::State> GetActorSubscriptionsBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetActorSubscriptionsBuilder<'a, S> +where + S: get_actor_subscriptions_state::State, + S::Actor: get_actor_subscriptions_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetActorSubscriptions<'a> { + GetActorSubscriptions { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetActorSubscriptionsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub subscriptions: Vec>, +} + +/// Response type for +///sh.weaver.graph.getActorSubscriptions +pub struct GetActorSubscriptionsResponse; +impl jacquard_common::xrpc::XrpcResp for GetActorSubscriptionsResponse { + const NSID: &'static str = "sh.weaver.graph.getActorSubscriptions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetActorSubscriptionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetActorSubscriptions<'a> { + const NSID: &'static str = "sh.weaver.graph.getActorSubscriptions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetActorSubscriptionsResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getActorSubscriptions +pub struct GetActorSubscriptionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetActorSubscriptionsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getActorSubscriptions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetActorSubscriptions<'de>; + type Response = GetActorSubscriptionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_bookmarked_by.rs b/crates/weaver-api/src/sh_weaver/graph/get_bookmarked_by.rs new file mode 100644 index 0000000..1907805 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_bookmarked_by.rs @@ -0,0 +1,201 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getBookmarkedBy +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetBookmarkedBy<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub subject: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_bookmarked_by_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Subject; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Subject = Unset; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Subject = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `subject` field + pub struct subject(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetBookmarkedByBuilder<'a, S: get_bookmarked_by_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetBookmarkedBy<'a> { + /// Create a new builder for this type + pub fn new() -> GetBookmarkedByBuilder<'a, get_bookmarked_by_state::Empty> { + GetBookmarkedByBuilder::new() + } +} + +impl<'a> GetBookmarkedByBuilder<'a, get_bookmarked_by_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetBookmarkedByBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_bookmarked_by_state::State> GetBookmarkedByBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_bookmarked_by_state::State> GetBookmarkedByBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetBookmarkedByBuilder<'a, S> +where + S: get_bookmarked_by_state::State, + S::Subject: get_bookmarked_by_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> GetBookmarkedByBuilder<'a, get_bookmarked_by_state::SetSubject> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetBookmarkedByBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetBookmarkedByBuilder<'a, S> +where + S: get_bookmarked_by_state::State, + S::Subject: get_bookmarked_by_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetBookmarkedBy<'a> { + GetBookmarkedBy { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + subject: self.__unsafe_private_named.2.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetBookmarkedByOutput<'a> { + #[serde(borrow)] + pub bookmarks: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +/// Response type for +///sh.weaver.graph.getBookmarkedBy +pub struct GetBookmarkedByResponse; +impl jacquard_common::xrpc::XrpcResp for GetBookmarkedByResponse { + const NSID: &'static str = "sh.weaver.graph.getBookmarkedBy"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetBookmarkedByOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetBookmarkedBy<'a> { + const NSID: &'static str = "sh.weaver.graph.getBookmarkedBy"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetBookmarkedByResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getBookmarkedBy +pub struct GetBookmarkedByRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetBookmarkedByRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getBookmarkedBy"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetBookmarkedBy<'de>; + type Response = GetBookmarkedByResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_followers.rs b/crates/weaver-api/src/sh_weaver/graph/get_followers.rs new file mode 100644 index 0000000..50c78d2 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_followers.rs @@ -0,0 +1,198 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getFollowers +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetFollowers<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_followers_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetFollowersBuilder<'a, S: get_followers_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetFollowers<'a> { + /// Create a new builder for this type + pub fn new() -> GetFollowersBuilder<'a, get_followers_state::Empty> { + GetFollowersBuilder::new() + } +} + +impl<'a> GetFollowersBuilder<'a, get_followers_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetFollowersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetFollowersBuilder<'a, S> +where + S: get_followers_state::State, + S::Actor: get_followers_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetFollowersBuilder<'a, get_followers_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetFollowersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_followers_state::State> GetFollowersBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_followers_state::State> GetFollowersBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetFollowersBuilder<'a, S> +where + S: get_followers_state::State, + S::Actor: get_followers_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetFollowers<'a> { + GetFollowers { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetFollowersOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub followers: Vec>, + #[serde(borrow)] + pub subject: crate::sh_weaver::actor::ProfileViewBasic<'a>, +} + +/// Response type for +///sh.weaver.graph.getFollowers +pub struct GetFollowersResponse; +impl jacquard_common::xrpc::XrpcResp for GetFollowersResponse { + const NSID: &'static str = "sh.weaver.graph.getFollowers"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetFollowersOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetFollowers<'a> { + const NSID: &'static str = "sh.weaver.graph.getFollowers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetFollowersResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getFollowers +pub struct GetFollowersRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetFollowersRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getFollowers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetFollowers<'de>; + type Response = GetFollowersResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_following.rs b/crates/weaver-api/src/sh_weaver/graph/get_following.rs new file mode 100644 index 0000000..30dabe3 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_following.rs @@ -0,0 +1,198 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getFollowing +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetFollowing<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_following_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetFollowingBuilder<'a, S: get_following_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetFollowing<'a> { + /// Create a new builder for this type + pub fn new() -> GetFollowingBuilder<'a, get_following_state::Empty> { + GetFollowingBuilder::new() + } +} + +impl<'a> GetFollowingBuilder<'a, get_following_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetFollowingBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetFollowingBuilder<'a, S> +where + S: get_following_state::State, + S::Actor: get_following_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> GetFollowingBuilder<'a, get_following_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetFollowingBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_following_state::State> GetFollowingBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_following_state::State> GetFollowingBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetFollowingBuilder<'a, S> +where + S: get_following_state::State, + S::Actor: get_following_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetFollowing<'a> { + GetFollowing { + actor: self.__unsafe_private_named.0.unwrap(), + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetFollowingOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub following: Vec>, + #[serde(borrow)] + pub subject: crate::sh_weaver::actor::ProfileViewBasic<'a>, +} + +/// Response type for +///sh.weaver.graph.getFollowing +pub struct GetFollowingResponse; +impl jacquard_common::xrpc::XrpcResp for GetFollowingResponse { + const NSID: &'static str = "sh.weaver.graph.getFollowing"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetFollowingOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetFollowing<'a> { + const NSID: &'static str = "sh.weaver.graph.getFollowing"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetFollowingResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getFollowing +pub struct GetFollowingRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetFollowingRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getFollowing"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetFollowing<'de>; + type Response = GetFollowingResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_liked_by.rs b/crates/weaver-api/src/sh_weaver/graph/get_liked_by.rs new file mode 100644 index 0000000..c5a9045 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_liked_by.rs @@ -0,0 +1,201 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getLikedBy +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetLikedBy<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub subject: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_liked_by_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Subject; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Subject = Unset; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Subject = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `subject` field + pub struct subject(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetLikedByBuilder<'a, S: get_liked_by_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetLikedBy<'a> { + /// Create a new builder for this type + pub fn new() -> GetLikedByBuilder<'a, get_liked_by_state::Empty> { + GetLikedByBuilder::new() + } +} + +impl<'a> GetLikedByBuilder<'a, get_liked_by_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetLikedByBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_liked_by_state::State> GetLikedByBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_liked_by_state::State> GetLikedByBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetLikedByBuilder<'a, S> +where + S: get_liked_by_state::State, + S::Subject: get_liked_by_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> GetLikedByBuilder<'a, get_liked_by_state::SetSubject> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetLikedByBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetLikedByBuilder<'a, S> +where + S: get_liked_by_state::State, + S::Subject: get_liked_by_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetLikedBy<'a> { + GetLikedBy { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + subject: self.__unsafe_private_named.2.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetLikedByOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub likes: Vec>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +/// Response type for +///sh.weaver.graph.getLikedBy +pub struct GetLikedByResponse; +impl jacquard_common::xrpc::XrpcResp for GetLikedByResponse { + const NSID: &'static str = "sh.weaver.graph.getLikedBy"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetLikedByOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetLikedBy<'a> { + const NSID: &'static str = "sh.weaver.graph.getLikedBy"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetLikedByResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getLikedBy +pub struct GetLikedByRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetLikedByRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getLikedBy"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetLikedBy<'de>; + type Response = GetLikedByResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_list.rs b/crates/weaver-api/src/sh_weaver/graph/get_list.rs new file mode 100644 index 0000000..6ec6c52 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_list.rs @@ -0,0 +1,232 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getList +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetList<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub list: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_list_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type List; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type List = Unset; + } + ///State transition - sets the `list` field to Set + pub struct SetList(PhantomData S>); + impl sealed::Sealed for SetList {} + impl State for SetList { + type List = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `list` field + pub struct list(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetListBuilder<'a, S: get_list_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetList<'a> { + /// Create a new builder for this type + pub fn new() -> GetListBuilder<'a, get_list_state::Empty> { + GetListBuilder::new() + } +} + +impl<'a> GetListBuilder<'a, get_list_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetListBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_list_state::State> GetListBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_list_state::State> GetListBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetListBuilder<'a, S> +where + S: get_list_state::State, + S::List: get_list_state::IsUnset, +{ + /// Set the `list` field (required) + pub fn list( + mut self, + value: impl Into>, + ) -> GetListBuilder<'a, get_list_state::SetList> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetListBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetListBuilder<'a, S> +where + S: get_list_state::State, + S::List: get_list_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetList<'a> { + GetList { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + list: self.__unsafe_private_named.2.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetListOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub items: Vec>, + #[serde(borrow)] + pub list: jacquard_common::types::value::Data<'a>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum GetListError<'a> { + #[serde(rename = "ListNotFound")] + ListNotFound(std::option::Option), +} + +impl std::fmt::Display for GetListError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ListNotFound(msg) => { + write!(f, "ListNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.graph.getList +pub struct GetListResponse; +impl jacquard_common::xrpc::XrpcResp for GetListResponse { + const NSID: &'static str = "sh.weaver.graph.getList"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetListOutput<'de>; + type Err<'de> = GetListError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetList<'a> { + const NSID: &'static str = "sh.weaver.graph.getList"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetListResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getList +pub struct GetListRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetListRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getList"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetList<'de>; + type Response = GetListResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_popular_tags.rs b/crates/weaver-api/src/sh_weaver/graph/get_popular_tags.rs new file mode 100644 index 0000000..059d6cd --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_popular_tags.rs @@ -0,0 +1,159 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getPopularTags +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetPopularTags<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_popular_tags_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct GetPopularTagsBuilder<'a, S: get_popular_tags_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetPopularTags<'a> { + /// Create a new builder for this type + pub fn new() -> GetPopularTagsBuilder<'a, get_popular_tags_state::Empty> { + GetPopularTagsBuilder::new() + } +} + +impl<'a> GetPopularTagsBuilder<'a, get_popular_tags_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetPopularTagsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_popular_tags_state::State> GetPopularTagsBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_popular_tags_state::State> GetPopularTagsBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetPopularTagsBuilder<'a, S> +where + S: get_popular_tags_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetPopularTags<'a> { + GetPopularTags { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetPopularTagsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub tags: Vec>, +} + +/// Response type for +///sh.weaver.graph.getPopularTags +pub struct GetPopularTagsResponse; +impl jacquard_common::xrpc::XrpcResp for GetPopularTagsResponse { + const NSID: &'static str = "sh.weaver.graph.getPopularTags"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetPopularTagsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetPopularTags<'a> { + const NSID: &'static str = "sh.weaver.graph.getPopularTags"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetPopularTagsResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getPopularTags +pub struct GetPopularTagsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetPopularTagsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getPopularTags"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetPopularTags<'de>; + type Response = GetPopularTagsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_resource_tags.rs b/crates/weaver-api/src/sh_weaver/graph/get_resource_tags.rs new file mode 100644 index 0000000..519f041 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_resource_tags.rs @@ -0,0 +1,155 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getResourceTags +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetResourceTags<'a> { + #[serde(borrow)] + pub resource: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_resource_tags_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Resource; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Resource = Unset; + } + ///State transition - sets the `resource` field to Set + pub struct SetResource(PhantomData S>); + impl sealed::Sealed for SetResource {} + impl State for SetResource { + type Resource = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `resource` field + pub struct resource(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetResourceTagsBuilder<'a, S: get_resource_tags_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetResourceTags<'a> { + /// Create a new builder for this type + pub fn new() -> GetResourceTagsBuilder<'a, get_resource_tags_state::Empty> { + GetResourceTagsBuilder::new() + } +} + +impl<'a> GetResourceTagsBuilder<'a, get_resource_tags_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetResourceTagsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetResourceTagsBuilder<'a, S> +where + S: get_resource_tags_state::State, + S::Resource: get_resource_tags_state::IsUnset, +{ + /// Set the `resource` field (required) + pub fn resource( + mut self, + value: impl Into>, + ) -> GetResourceTagsBuilder<'a, get_resource_tags_state::SetResource> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetResourceTagsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetResourceTagsBuilder<'a, S> +where + S: get_resource_tags_state::State, + S::Resource: get_resource_tags_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetResourceTags<'a> { + GetResourceTags { + resource: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetResourceTagsOutput<'a> { + #[serde(flatten)] + #[serde(borrow)] + pub value: jacquard_common::types::value::Data<'a>, +} + +/// Response type for +///sh.weaver.graph.getResourceTags +pub struct GetResourceTagsResponse; +impl jacquard_common::xrpc::XrpcResp for GetResourceTagsResponse { + const NSID: &'static str = "sh.weaver.graph.getResourceTags"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetResourceTagsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetResourceTags<'a> { + const NSID: &'static str = "sh.weaver.graph.getResourceTags"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetResourceTagsResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getResourceTags +pub struct GetResourceTagsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetResourceTagsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getResourceTags"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetResourceTags<'de>; + type Response = GetResourceTagsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_subscribers.rs b/crates/weaver-api/src/sh_weaver/graph/get_subscribers.rs new file mode 100644 index 0000000..f8b5489 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_subscribers.rs @@ -0,0 +1,198 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getSubscribers +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetSubscribers<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub notebook: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_subscribers_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Notebook; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Notebook = Unset; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Notebook = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `notebook` field + pub struct notebook(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetSubscribersBuilder<'a, S: get_subscribers_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetSubscribers<'a> { + /// Create a new builder for this type + pub fn new() -> GetSubscribersBuilder<'a, get_subscribers_state::Empty> { + GetSubscribersBuilder::new() + } +} + +impl<'a> GetSubscribersBuilder<'a, get_subscribers_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSubscribersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_subscribers_state::State> GetSubscribersBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_subscribers_state::State> GetSubscribersBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetSubscribersBuilder<'a, S> +where + S: get_subscribers_state::State, + S::Notebook: get_subscribers_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> GetSubscribersBuilder<'a, get_subscribers_state::SetNotebook> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetSubscribersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetSubscribersBuilder<'a, S> +where + S: get_subscribers_state::State, + S::Notebook: get_subscribers_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetSubscribers<'a> { + GetSubscribers { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + notebook: self.__unsafe_private_named.2.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetSubscribersOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, + #[serde(borrow)] + pub subscribers: Vec>, +} + +/// Response type for +///sh.weaver.graph.getSubscribers +pub struct GetSubscribersResponse; +impl jacquard_common::xrpc::XrpcResp for GetSubscribersResponse { + const NSID: &'static str = "sh.weaver.graph.getSubscribers"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSubscribersOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSubscribers<'a> { + const NSID: &'static str = "sh.weaver.graph.getSubscribers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSubscribersResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getSubscribers +pub struct GetSubscribersRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSubscribersRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getSubscribers"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSubscribers<'de>; + type Response = GetSubscribersResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_tag_suggestions.rs b/crates/weaver-api/src/sh_weaver/graph/get_tag_suggestions.rs new file mode 100644 index 0000000..ea43f05 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_tag_suggestions.rs @@ -0,0 +1,181 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getTagSuggestions +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetTagSuggestions<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub existing_tags: std::option::Option>>, + ///(default: 20, min: 1, max: 50) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + ///(max length: 128) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub query: std::option::Option>, +} + +pub mod get_tag_suggestions_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct GetTagSuggestionsBuilder<'a, S: get_tag_suggestions_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetTagSuggestions<'a> { + /// Create a new builder for this type + pub fn new() -> GetTagSuggestionsBuilder<'a, get_tag_suggestions_state::Empty> { + GetTagSuggestionsBuilder::new() + } +} + +impl<'a> GetTagSuggestionsBuilder<'a, get_tag_suggestions_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetTagSuggestionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_tag_suggestions_state::State> GetTagSuggestionsBuilder<'a, S> { + /// Set the `existingTags` field (optional) + pub fn existing_tags( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `existingTags` field to an Option value (optional) + pub fn maybe_existing_tags( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_tag_suggestions_state::State> GetTagSuggestionsBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_tag_suggestions_state::State> GetTagSuggestionsBuilder<'a, S> { + /// Set the `query` field (optional) + pub fn query( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `query` field to an Option value (optional) + pub fn maybe_query(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetTagSuggestionsBuilder<'a, S> +where + S: get_tag_suggestions_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetTagSuggestions<'a> { + GetTagSuggestions { + existing_tags: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + query: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetTagSuggestionsOutput<'a> { + #[serde(borrow)] + pub suggestions: Vec>, +} + +/// Response type for +///sh.weaver.graph.getTagSuggestions +pub struct GetTagSuggestionsResponse; +impl jacquard_common::xrpc::XrpcResp for GetTagSuggestionsResponse { + const NSID: &'static str = "sh.weaver.graph.getTagSuggestions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetTagSuggestionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetTagSuggestions<'a> { + const NSID: &'static str = "sh.weaver.graph.getTagSuggestions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetTagSuggestionsResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getTagSuggestions +pub struct GetTagSuggestionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetTagSuggestionsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getTagSuggestions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetTagSuggestions<'de>; + type Response = GetTagSuggestionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_tagged_resources.rs b/crates/weaver-api/src/sh_weaver/graph/get_tagged_resources.rs new file mode 100644 index 0000000..cc62862 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_tagged_resources.rs @@ -0,0 +1,301 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getTaggedResources +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetTaggedResources<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + /// (default: true) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_author_tags: std::option::Option, + /// (default: true) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_community_tags: std::option::Option, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + ///(default: "all") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub resource_type: std::option::Option>, + ///(default: "recent") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub sort: std::option::Option>, + #[serde(borrow)] + pub tag: jacquard_common::CowStr<'a>, +} + +pub mod get_tagged_resources_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Tag; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Tag = Unset; + } + ///State transition - sets the `tag` field to Set + pub struct SetTag(PhantomData S>); + impl sealed::Sealed for SetTag {} + impl State for SetTag { + type Tag = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `tag` field + pub struct tag(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetTaggedResourcesBuilder<'a, S: get_tagged_resources_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetTaggedResources<'a> { + /// Create a new builder for this type + pub fn new() -> GetTaggedResourcesBuilder<'a, get_tagged_resources_state::Empty> { + GetTaggedResourcesBuilder::new() + } +} + +impl<'a> GetTaggedResourcesBuilder<'a, get_tagged_resources_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetTaggedResourcesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_tagged_resources_state::State> GetTaggedResourcesBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_tagged_resources_state::State> GetTaggedResourcesBuilder<'a, S> { + /// Set the `includeAuthorTags` field (optional) + pub fn include_author_tags(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `includeAuthorTags` field to an Option value (optional) + pub fn maybe_include_author_tags(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_tagged_resources_state::State> GetTaggedResourcesBuilder<'a, S> { + /// Set the `includeCommunityTags` field (optional) + pub fn include_community_tags(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `includeCommunityTags` field to an Option value (optional) + pub fn maybe_include_community_tags(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_tagged_resources_state::State> GetTaggedResourcesBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: get_tagged_resources_state::State> GetTaggedResourcesBuilder<'a, S> { + /// Set the `resourceType` field (optional) + pub fn resource_type( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `resourceType` field to an Option value (optional) + pub fn maybe_resource_type( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: get_tagged_resources_state::State> GetTaggedResourcesBuilder<'a, S> { + /// Set the `sort` field (optional) + pub fn sort( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `sort` field to an Option value (optional) + pub fn maybe_sort(mut self, value: Option>) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> GetTaggedResourcesBuilder<'a, S> +where + S: get_tagged_resources_state::State, + S::Tag: get_tagged_resources_state::IsUnset, +{ + /// Set the `tag` field (required) + pub fn tag( + mut self, + value: impl Into>, + ) -> GetTaggedResourcesBuilder<'a, get_tagged_resources_state::SetTag> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + GetTaggedResourcesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetTaggedResourcesBuilder<'a, S> +where + S: get_tagged_resources_state::State, + S::Tag: get_tagged_resources_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetTaggedResources<'a> { + GetTaggedResources { + cursor: self.__unsafe_private_named.0, + include_author_tags: self.__unsafe_private_named.1, + include_community_tags: self.__unsafe_private_named.2, + limit: self.__unsafe_private_named.3, + resource_type: self.__unsafe_private_named.4, + sort: self.__unsafe_private_named.5, + tag: self.__unsafe_private_named.6.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetTaggedResourcesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub resources: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tag: std::option::Option>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(tag = "$type")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum GetTaggedResourcesOutputResourcesItem<'a> { + #[serde(rename = "sh.weaver.notebook.defs#notebookView")] + NotebookView(Box>), + #[serde(rename = "sh.weaver.notebook.defs#entryView")] + EntryView(Box>), +} + +/// Response type for +///sh.weaver.graph.getTaggedResources +pub struct GetTaggedResourcesResponse; +impl jacquard_common::xrpc::XrpcResp for GetTaggedResourcesResponse { + const NSID: &'static str = "sh.weaver.graph.getTaggedResources"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetTaggedResourcesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetTaggedResources<'a> { + const NSID: &'static str = "sh.weaver.graph.getTaggedResources"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetTaggedResourcesResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getTaggedResources +pub struct GetTaggedResourcesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetTaggedResourcesRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getTaggedResources"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetTaggedResources<'de>; + type Response = GetTaggedResourcesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/get_trending_tags.rs b/crates/weaver-api/src/sh_weaver/graph/get_trending_tags.rs new file mode 100644 index 0000000..9ab0c25 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/get_trending_tags.rs @@ -0,0 +1,131 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.getTrendingTags +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetTrendingTags { + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_trending_tags_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct GetTrendingTagsBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), +} + +impl GetTrendingTags { + /// Create a new builder for this type + pub fn new() -> GetTrendingTagsBuilder { + GetTrendingTagsBuilder::new() + } +} + +impl GetTrendingTagsBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetTrendingTagsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl GetTrendingTagsBuilder { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl GetTrendingTagsBuilder +where + S: get_trending_tags_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetTrendingTags { + GetTrendingTags { + limit: self.__unsafe_private_named.0, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetTrendingTagsOutput<'a> { + #[serde(borrow)] + pub tags: Vec>, +} + +/// Response type for +///sh.weaver.graph.getTrendingTags +pub struct GetTrendingTagsResponse; +impl jacquard_common::xrpc::XrpcResp for GetTrendingTagsResponse { + const NSID: &'static str = "sh.weaver.graph.getTrendingTags"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetTrendingTagsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetTrendingTags { + const NSID: &'static str = "sh.weaver.graph.getTrendingTags"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetTrendingTagsResponse; +} + +/// Endpoint type for +///sh.weaver.graph.getTrendingTags +pub struct GetTrendingTagsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetTrendingTagsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.graph.getTrendingTags"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetTrendingTags; + type Response = GetTrendingTagsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/graph/list.rs b/crates/weaver-api/src/sh_weaver/graph/list.rs index 61cb1d8..9381f54 100644 --- a/crates/weaver-api/src/sh_weaver/graph/list.rs +++ b/crates/weaver-api/src/sh_weaver/graph/list.rs @@ -123,51 +123,51 @@ pub mod list_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Name; - type CreatedAt; type Purpose; + type CreatedAt; + type Name; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Name = Unset; - type CreatedAt = Unset; type Purpose = Unset; + type CreatedAt = Unset; + type Name = Unset; } - ///State transition - sets the `name` field to Set - pub struct SetName(PhantomData S>); - impl sealed::Sealed for SetName {} - impl State for SetName { - type Name = Set; + ///State transition - sets the `purpose` field to Set + pub struct SetPurpose(PhantomData S>); + impl sealed::Sealed for SetPurpose {} + impl State for SetPurpose { + type Purpose = Set; type CreatedAt = S::CreatedAt; - type Purpose = S::Purpose; + type Name = S::Name; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Name = S::Name; - type CreatedAt = Set; type Purpose = S::Purpose; - } - ///State transition - sets the `purpose` field to Set - pub struct SetPurpose(PhantomData S>); - impl sealed::Sealed for SetPurpose {} - impl State for SetPurpose { + type CreatedAt = Set; type Name = S::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Purpose = S::Purpose; type CreatedAt = S::CreatedAt; - type Purpose = Set; + type Name = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `name` field - pub struct name(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `purpose` field pub struct purpose(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `name` field + pub struct name(()); } } @@ -300,9 +300,9 @@ where impl<'a, S> ListBuilder<'a, S> where S: list_state::State, - S::Name: list_state::IsSet, - S::CreatedAt: list_state::IsSet, S::Purpose: list_state::IsSet, + S::CreatedAt: list_state::IsSet, + S::Name: list_state::IsSet, { /// Build the final struct pub fn build(self) -> List<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/listitem.rs b/crates/weaver-api/src/sh_weaver/graph/listitem.rs index 07064c0..05c4248 100644 --- a/crates/weaver-api/src/sh_weaver/graph/listitem.rs +++ b/crates/weaver-api/src/sh_weaver/graph/listitem.rs @@ -38,50 +38,50 @@ pub mod listitem_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type List; - type Subject; type CreatedAt; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type List = Unset; - type Subject = Unset; type CreatedAt = Unset; + type Subject = Unset; } ///State transition - sets the `list` field to Set pub struct SetList(PhantomData S>); impl sealed::Sealed for SetList {} impl State for SetList { type List = Set; - type Subject = S::Subject; - type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type List = S::List; - type Subject = Set; type CreatedAt = S::CreatedAt; + type Subject = S::Subject; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type List = S::List; - type Subject = S::Subject; type CreatedAt = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type List = S::List; + type CreatedAt = S::CreatedAt; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `list` field pub struct list(()); - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -175,8 +175,8 @@ impl<'a, S> ListitemBuilder<'a, S> where S: listitem_state::State, S::List: listitem_state::IsSet, - S::Subject: listitem_state::IsSet, S::CreatedAt: listitem_state::IsSet, + S::Subject: listitem_state::IsSet, { /// Build the final struct pub fn build(self) -> Listitem<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/subscribe.rs b/crates/weaver-api/src/sh_weaver/graph/subscribe.rs index 88e2b72..eae9514 100644 --- a/crates/weaver-api/src/sh_weaver/graph/subscribe.rs +++ b/crates/weaver-api/src/sh_weaver/graph/subscribe.rs @@ -34,37 +34,37 @@ pub mod subscribe_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Notebook; type CreatedAt; + type Notebook; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Notebook = Unset; type CreatedAt = Unset; - } - ///State transition - sets the `notebook` field to Set - pub struct SetNotebook(PhantomData S>); - impl sealed::Sealed for SetNotebook {} - impl State for SetNotebook { - type Notebook = Set; - type CreatedAt = S::CreatedAt; + type Notebook = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Notebook = S::Notebook; type CreatedAt = Set; + type Notebook = S::Notebook; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type CreatedAt = S::CreatedAt; + type Notebook = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `notebook` field - pub struct notebook(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `notebook` field + pub struct notebook(()); } } @@ -137,8 +137,8 @@ where impl<'a, S> SubscribeBuilder<'a, S> where S: subscribe_state::State, - S::Notebook: subscribe_state::IsSet, S::CreatedAt: subscribe_state::IsSet, + S::Notebook: subscribe_state::IsSet, { /// Build the final struct pub fn build(self) -> Subscribe<'a> { diff --git a/crates/weaver-api/src/sh_weaver/graph/tag.rs b/crates/weaver-api/src/sh_weaver/graph/tag.rs new file mode 100644 index 0000000..fa3ca91 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/graph/tag.rs @@ -0,0 +1,398 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.graph.tag +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +/// Apply a community tag to a notebook or entry. Can be created by readers, authors, or bots for categorization and discovery. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Tag<'a> { + pub created_at: jacquard_common::types::string::Datetime, + /// The notebook or entry being tagged. + #[serde(borrow)] + pub subject: crate::com_atproto::repo::strong_ref::StrongRef<'a>, + /// The tag value (e.g., 'enemies-to-lovers', 'slow-burn', 'found-family'). + #[serde(borrow)] + pub tag: jacquard_common::CowStr<'a>, +} + +pub mod tag_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Subject; + type Tag; + type CreatedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Subject = Unset; + type Tag = Unset; + type CreatedAt = Unset; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Subject = Set; + type Tag = S::Tag; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `tag` field to Set + pub struct SetTag(PhantomData S>); + impl sealed::Sealed for SetTag {} + impl State for SetTag { + type Subject = S::Subject; + type Tag = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Subject = S::Subject; + type Tag = S::Tag; + type CreatedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `tag` field + pub struct tag(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct TagBuilder<'a, S: tag_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Tag<'a> { + /// Create a new builder for this type + pub fn new() -> TagBuilder<'a, tag_state::Empty> { + TagBuilder::new() + } +} + +impl<'a> TagBuilder<'a, tag_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + TagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TagBuilder<'a, S> +where + S: tag_state::State, + S::CreatedAt: tag_state::IsUnset, +{ + /// Set the `createdAt` field (required) + pub fn created_at( + mut self, + value: impl Into, + ) -> TagBuilder<'a, tag_state::SetCreatedAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + TagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TagBuilder<'a, S> +where + S: tag_state::State, + S::Subject: tag_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> TagBuilder<'a, tag_state::SetSubject> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + TagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TagBuilder<'a, S> +where + S: tag_state::State, + S::Tag: tag_state::IsUnset, +{ + /// Set the `tag` field (required) + pub fn tag( + mut self, + value: impl Into>, + ) -> TagBuilder<'a, tag_state::SetTag> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + TagBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> TagBuilder<'a, S> +where + S: tag_state::State, + S::Subject: tag_state::IsSet, + S::Tag: tag_state::IsSet, + S::CreatedAt: tag_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Tag<'a> { + Tag { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + tag: self.__unsafe_private_named.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> Tag<'a> { + Tag { + created_at: self.__unsafe_private_named.0.unwrap(), + subject: self.__unsafe_private_named.1.unwrap(), + tag: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> Tag<'a> { + pub fn uri( + uri: impl Into>, + ) -> Result< + jacquard_common::types::uri::RecordUri<'a, TagRecord>, + jacquard_common::types::uri::UriError, + > { + jacquard_common::types::uri::RecordUri::try_from_uri( + jacquard_common::types::string::AtUri::new_cow(uri.into())?, + ) + } +} + +/// Typed wrapper for GetRecord response with this collection's record type. +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct TagGetRecordOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cid: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(borrow)] + pub value: Tag<'a>, +} + +impl From> for Tag<'_> { + fn from(output: TagGetRecordOutput<'_>) -> Self { + use jacquard_common::IntoStatic; + output.value.into_static() + } +} + +impl jacquard_common::types::collection::Collection for Tag<'_> { + const NSID: &'static str = "sh.weaver.graph.tag"; + type Record = TagRecord; +} + +/// Marker type for deserializing records from this collection. +#[derive(Debug, serde::Serialize, serde::Deserialize)] +pub struct TagRecord; +impl jacquard_common::xrpc::XrpcResp for TagRecord { + const NSID: &'static str = "sh.weaver.graph.tag"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = TagGetRecordOutput<'de>; + type Err<'de> = jacquard_common::types::collection::RecordError<'de>; +} + +impl jacquard_common::types::collection::Collection for TagRecord { + const NSID: &'static str = "sh.weaver.graph.tag"; + type Record = TagRecord; +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Tag<'a> { + fn nsid() -> &'static str { + "sh.weaver.graph.tag" + } + fn def_name() -> &'static str { + "main" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_graph_tag() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.tag; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) > 128usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "tag", + ), + max: 128usize, + actual: ::len(value.as_ref()), + }); + } + } + { + let value = &self.tag; + #[allow(unused_comparisons)] + if ::len(value.as_ref()) < 1usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MinLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "tag", + ), + min: 1usize, + actual: ::len(value.as_ref()), + }); + } + } + Ok(()) + } +} + +fn lexicon_doc_sh_weaver_graph_tag() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.graph.tag"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::Record(::jacquard_lexicon::lexicon::LexRecord { + description: Some( + ::jacquard_common::CowStr::new_static( + "Apply a community tag to a notebook or entry. Can be created by readers, authors, or bots for categorization and discovery.", + ), + ), + key: Some(::jacquard_common::CowStr::new_static("tid")), + record: ::jacquard_lexicon::lexicon::LexRecordRecord::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_common::smol_str::SmolStr::new_static("tag"), + ::jacquard_common::smol_str::SmolStr::new_static("createdAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "createdAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tag"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The tag value (e.g., 'enemies-to-lovers', 'slow-burn', 'found-family').", + ), + ), + format: None, + default: None, + min_length: Some(1usize), + max_length: Some(128usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + }), + ); + map + }, + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook.rs b/crates/weaver-api/src/sh_weaver/notebook.rs index f706110..d80ac56 100644 --- a/crates/weaver-api/src/sh_weaver/notebook.rs +++ b/crates/weaver-api/src/sh_weaver/notebook.rs @@ -10,22 +10,32 @@ pub mod book; pub mod chapter; pub mod colour_scheme; pub mod entry; +pub mod get_chapter; +pub mod get_continue_reading; pub mod get_entry; pub mod get_entry_by_title; +pub mod get_entry_detail; +pub mod get_entry_feed; pub mod get_notebook; pub mod get_notebook_by_title; +pub mod get_notebook_chapters; +pub mod get_notebook_detail; +pub mod get_notebook_feed; +pub mod get_page; +pub mod get_published_versions; +pub mod get_reading_history; +pub mod get_similar_notebooks; pub mod page; +pub mod resolve_entry; +pub mod resolve_notebook; +pub mod resolve_version_conflict; +pub mod search_entries; pub mod theme; +pub mod update_reading_progress; #[jacquard_derive::lexicon] #[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, )] #[serde(rename_all = "camelCase")] pub struct AuthorListView<'a> { @@ -39,7 +49,7 @@ pub struct AuthorListView<'a> { pub mod author_list_view_state { - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -47,37 +57,37 @@ pub mod author_list_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Index; type Record; + type Index; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Index = Unset; type Record = Unset; - } - ///State transition - sets the `index` field to Set - pub struct SetIndex(PhantomData S>); - impl sealed::Sealed for SetIndex {} - impl State for SetIndex { - type Index = Set; - type Record = S::Record; + type Index = Unset; } ///State transition - sets the `record` field to Set pub struct SetRecord(PhantomData S>); impl sealed::Sealed for SetRecord {} impl State for SetRecord { - type Index = S::Index; type Record = Set; + type Index = S::Index; + } + ///State transition - sets the `index` field to Set + pub struct SetIndex(PhantomData S>); + impl sealed::Sealed for SetIndex {} + impl State for SetIndex { + type Record = S::Record; + type Index = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `index` field - pub struct index(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `index` field + pub struct index(()); } } @@ -158,10 +168,7 @@ impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> { self } /// Set the `uri` field to an Option value (optional) - pub fn maybe_uri( - mut self, - value: Option>, - ) -> Self { + pub fn maybe_uri(mut self, value: Option>) -> Self { self.__unsafe_private_named.2 = value; self } @@ -170,8 +177,8 @@ impl<'a, S: author_list_view_state::State> AuthorListViewBuilder<'a, S> { impl<'a, S> AuthorListViewBuilder<'a, S> where S: author_list_view_state::State, - S::Index: author_list_view_state::IsSet, S::Record: author_list_view_state::IsSet, + S::Index: author_list_view_state::IsSet, { /// Build the final struct pub fn build(self) -> AuthorListView<'a> { @@ -199,9 +206,7 @@ where } } -fn lexicon_doc_sh_weaver_notebook_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< - 'static, -> { +fn lexicon_doc_sh_weaver_notebook_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { ::jacquard_lexicon::lexicon::LexiconDoc { lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, id: ::jacquard_common::CowStr::new_static("sh.weaver.notebook.defs"), @@ -211,138 +216,365 @@ fn lexicon_doc_sh_weaver_notebook_defs() -> ::jacquard_lexicon::lexicon::Lexicon let mut map = ::std::collections::BTreeMap::new(); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("authorListView"), - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { - description: None, - required: Some( - vec![ + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![ ::jacquard_common::smol_str::SmolStr::new_static("record"), - ::jacquard_common::smol_str::SmolStr::new_static("index") - ], - ), - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::std::collections::BTreeMap::new(); - map.insert( ::jacquard_common::smol_str::SmolStr::new_static("index"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { - description: None, - default: None, - minimum: None, - maximum: None, - r#enum: None, - r#const: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("record"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static( - "sh.weaver.actor.defs#profileDataView", + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("index"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, ), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("uri"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: Some( - ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileDataView", + ), + }, ), - default: None, - min_length: None, - max_length: None, - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, - }), - ); - map + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map + }, }, - }), + ), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("bookEntryRef"), - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { - description: None, - required: Some( - vec![::jacquard_common::smol_str::SmolStr::new_static("entry")], - ), - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::std::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("entry"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static("#entryView"), - }), - ); - map + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![::jacquard_common::smol_str::SmolStr::new_static( + "entry", + )]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entry"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#entryView"), + }, + ), + ); + map + }, }, - }), + ), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("bookEntryView"), - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { - description: Some( - ::jacquard_common::CowStr::new_static( + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( "An ordered entry in a Weaver notebook.", - ), - ), - required: Some( - vec![ + )), + required: Some(vec![ ::jacquard_common::smol_str::SmolStr::new_static("entry"), - ::jacquard_common::smol_str::SmolStr::new_static("index") - ], - ), - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::std::collections::BTreeMap::new(); - map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("index"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entry"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#entryView"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("index"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("next"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#bookEntryRef", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("prev"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#bookEntryRef", + ), + }, + ), + ); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("chapterEntryView"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "An entry within a chapter context.", + )), + required: Some(vec![ ::jacquard_common::smol_str::SmolStr::new_static("entry"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static("#entryView"), - }), - ); - map.insert( ::jacquard_common::smol_str::SmolStr::new_static("index"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { - description: None, - default: None, - minimum: None, - maximum: None, - r#enum: None, - r#const: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("next"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static( - "#bookEntryRef", + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entry"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#entryView"), + }, ), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("prev"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static( - "#bookEntryRef", + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("index"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, ), - }), - ); - map + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("next"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#bookEntryRef", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("prev"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#bookEntryRef", + ), + }, + ), + ); + map + }, }, - }), + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("chapterView"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Hydrated view of a chapter.", + )), + required: Some(vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("notebook"), + ::jacquard_common::smol_str::SmolStr::new_static("authors"), + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("authors"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array( + ::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#authorListView", + ), + }, + ), + min_length: None, + max_length: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entryCount"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notebook"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#notebookView", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown( + ::jacquard_lexicon::lexicon::LexUnknown { description: None }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tags"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#tags"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#title"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map + }, + }, + ), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("contentFormat"), @@ -380,287 +612,829 @@ fn lexicon_doc_sh_weaver_notebook_defs() -> ::jacquard_lexicon::lexicon::Lexicon }, }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("contentRating"), + ::jacquard_lexicon::lexicon::LexUserType::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "Author-applied content rating.", + )), + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("contentWarning"), + ::jacquard_lexicon::lexicon::LexUserType::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "Author-applied content warning.", + )), + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("contentWarnings"), + ::jacquard_lexicon::lexicon::LexUserType::Array( + ::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#contentWarning"), + }, + ), + min_length: None, + max_length: Some(10usize), + }, + ), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("entryView"), - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { - description: None, - required: Some( - vec![ + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_common::smol_str::SmolStr::new_static("authors"), ::jacquard_common::smol_str::SmolStr::new_static("record"), - ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") - ], + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("authors"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array( + ::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#authorListView", + ), + }, + ), + min_length: None, + max_length: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("bookmarkCount"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("likeCount"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("path"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#path"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("permissions"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#permissionsState", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown( + ::jacquard_lexicon::lexicon::LexUnknown { description: None }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("renderedView"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#renderedView", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tags"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#tags"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#title"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewerBookmark"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewerLike"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "viewerReadingProgress", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#readingProgress", + ), + }, + ), + ); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("feedEntryView"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Entry with feed-specific context (discovery reason, notebook context).", + ), + ), + required: Some( + vec![::jacquard_common::smol_str::SmolStr::new_static("entry")], ), nullable: None, properties: { #[allow(unused_mut)] let mut map = ::std::collections::BTreeMap::new(); map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("authors"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + ::jacquard_common::smol_str::SmolStr::new_static("entry"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, - items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static( - "#authorListView", - ), - }), - min_length: None, - max_length: None, + r#ref: ::jacquard_common::CowStr::new_static("#entryView"), }), ); map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("cid"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + ::jacquard_common::smol_str::SmolStr::new_static( + "notebookContext", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, - format: Some( - ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + r#ref: ::jacquard_common::CowStr::new_static( + "#feedNotebookContext", ), - default: None, - min_length: None, - max_length: None, - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, }), ); map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "indexedAt", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { description: None, - format: Some( - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, - ), - default: None, - min_length: None, - max_length: None, - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, + r#ref: ::jacquard_common::CowStr::new_static("#feedReason"), }), ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("path"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static("#path"), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "permissions", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static( - "#permissionsState", + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("feedNotebookContext"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Minimal notebook context for feed display.", + )), + required: Some(vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("path"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, ), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("record"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { - description: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "renderedView", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static( - "#renderedView", + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, ), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("tags"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static("#tags"), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("title"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static("#title"), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("uri"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: Some( - ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, ), - default: None, - min_length: None, - max_length: None, - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, - }), - ); - map + ); + map + }, }, - }), + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("feedReason"), + ::jacquard_lexicon::lexicon::LexUserType::Union( + ::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("#reasonLike"), + ::jacquard_common::CowStr::new_static("#reasonBookmark"), + ::jacquard_common::CowStr::new_static("#reasonSubscription"), + ], + closed: None, + }, + ), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("notebookView"), - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { - description: None, - required: Some( - vec![ + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), ::jacquard_common::smol_str::SmolStr::new_static("cid"), ::jacquard_common::smol_str::SmolStr::new_static("authors"), ::jacquard_common::smol_str::SmolStr::new_static("record"), - ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") - ], - ), - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::std::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("authors"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { - description: None, - items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static( - "#authorListView", - ), - }), - min_length: None, - max_length: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("cid"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: Some( - ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("authors"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array( + ::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#authorListView", + ), + }, + ), + min_length: None, + max_length: None, + }, ), - default: None, - min_length: None, - max_length: None, - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "indexedAt", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: Some( - ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("bookmarkCount"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, ), - default: None, - min_length: None, - max_length: None, - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("path"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static("#path"), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static( - "permissions", - ), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static( - "#permissionsState", + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, ), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("record"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { - description: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("tags"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static("#tags"), - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("title"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { - description: None, - r#ref: ::jacquard_common::CowStr::new_static("#title"), - }), - ); - map.insert( + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entryCount"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("likeCount"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("path"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#path"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("permissions"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#permissionsState", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown( + ::jacquard_lexicon::lexicon::LexUnknown { description: None }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("subscriberCount"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tags"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#tags"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#title"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewerBookmark"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("viewerLike"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "viewerReadingProgress", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#readingProgress", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "viewerSubscription", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("pageView"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Hydrated view of a page (entries displayed together).", + )), + required: Some(vec![ ::jacquard_common::smol_str::SmolStr::new_static("uri"), - ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: Some( - ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("notebook"), + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, ), - default: None, - min_length: None, - max_length: None, - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, - }), - ); - map + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("entryCount"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notebook"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#notebookView", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown( + ::jacquard_lexicon::lexicon::LexUnknown { description: None }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tags"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#tags"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("title"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static("#title"), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map + }, }, - }), + ), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("path"), - ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { - description: Some( - ::jacquard_common::CowStr::new_static( + ::jacquard_lexicon::lexicon::LexUserType::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( "The path of the notebook.", - ), - ), - format: None, - default: None, - min_length: None, - max_length: Some(100usize), - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, - }), + )), + format: None, + default: None, + min_length: None, + max_length: Some(100usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("permissionGrant"), @@ -822,78 +1596,473 @@ fn lexicon_doc_sh_weaver_notebook_defs() -> ::jacquard_lexicon::lexicon::Lexicon }), ); map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("renderedView"), - ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { - description: Some( - ::jacquard_common::CowStr::new_static( - "View of a rendered and cached notebook entry", - ), - ), - required: Some( - vec![::jacquard_common::smol_str::SmolStr::new_static("html")], - ), - nullable: None, - properties: { - #[allow(unused_mut)] - let mut map = ::std::collections::BTreeMap::new(); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("css"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { - description: None, - accept: None, - max_size: None, - }), - ); - map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("html"), - ::jacquard_lexicon::lexicon::LexObjectProperty::Blob(::jacquard_lexicon::lexicon::LexBlob { - description: None, - accept: None, - max_size: None, - }), - ); - map + ::jacquard_common::smol_str::SmolStr::new_static("publishedVersionView"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "A published version of an entry in a collaborator's repo.", + )), + required: Some(vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("publisher"), + ::jacquard_common::smol_str::SmolStr::new_static("publishedAt"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("divergedFrom"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "com.atproto.repo.strongRef", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("isCanonical"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean( + ::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("publishedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("publisher"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("updatedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map + }, }, - }), + ), ); map.insert( - ::jacquard_common::smol_str::SmolStr::new_static("tags"), - ::jacquard_lexicon::lexicon::LexUserType::Array(::jacquard_lexicon::lexicon::LexArray { - description: None, - items: ::jacquard_lexicon::lexicon::LexArrayItem::String(::jacquard_lexicon::lexicon::LexString { - description: None, - format: None, - default: None, - min_length: None, - max_length: Some(64usize), - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, - }), - min_length: None, - max_length: Some(10usize), - }), + ::jacquard_common::smol_str::SmolStr::new_static("readingProgress"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "Viewer's reading progress (appview-side state, not a record).", + )), + required: None, + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("currentEntry"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( + "Last entry the viewer was reading.", + )), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("finishedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("lastReadAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("percentComplete"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer( + ::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: Some(0i64), + maximum: Some(100i64), + r#enum: None, + r#const: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("startedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reasonBookmark"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![ + ::jacquard_common::smol_str::SmolStr::new_static("by"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("by"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reasonLike"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![ + ::jacquard_common::smol_str::SmolStr::new_static("by"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("by"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref( + ::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reasonSubscription"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some(vec![::jacquard_common::smol_str::SmolStr::new_static( + "indexedAt", + )]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + ); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("renderedView"), + ::jacquard_lexicon::lexicon::LexUserType::Object( + ::jacquard_lexicon::lexicon::LexObject { + description: Some(::jacquard_common::CowStr::new_static( + "View of a rendered and cached notebook entry", + )), + required: Some(vec![::jacquard_common::smol_str::SmolStr::new_static( + "html", + )]), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("css"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob( + ::jacquard_lexicon::lexicon::LexBlob { + description: None, + accept: None, + max_size: None, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("html"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Blob( + ::jacquard_lexicon::lexicon::LexBlob { + description: None, + accept: None, + max_size: None, + }, + ), + ); + map + }, + }, + ), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("tags"), + ::jacquard_lexicon::lexicon::LexUserType::Array( + ::jacquard_lexicon::lexicon::LexArray { + description: None, + items: ::jacquard_lexicon::lexicon::LexArrayItem::String( + ::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: Some(64usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), + min_length: None, + max_length: Some(10usize), + }, + ), ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("title"), - ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { - description: Some( - ::jacquard_common::CowStr::new_static( + ::jacquard_lexicon::lexicon::LexUserType::String( + ::jacquard_lexicon::lexicon::LexString { + description: Some(::jacquard_common::CowStr::new_static( "The title of the notebook entry.", - ), - ), - format: None, - default: None, - min_length: None, - max_length: Some(300usize), - min_graphemes: None, - max_graphemes: None, - r#enum: None, - r#const: None, - known_values: None, - }), + )), + format: None, + default: None, + min_length: None, + max_length: Some(300usize), + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }, + ), ); map }, @@ -919,13 +2088,7 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for AuthorListView<'a> { #[jacquard_derive::lexicon] #[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, )] #[serde(rename_all = "camelCase")] pub struct BookEntryRef<'a> { @@ -935,7 +2098,7 @@ pub struct BookEntryRef<'a> { pub mod book_entry_ref_state { - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -968,9 +2131,7 @@ pub mod book_entry_ref_state { /// Builder for constructing an instance of this type pub struct BookEntryRefBuilder<'a, S: book_entry_ref_state::State> { _phantom_state: ::core::marker::PhantomData S>, - __unsafe_private_named: ( - ::core::option::Option>, - ), + __unsafe_private_named: (::core::option::Option>,), _phantom: ::core::marker::PhantomData<&'a ()>, } @@ -1058,13 +2219,7 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryRef<'a> { /// An ordered entry in a Weaver notebook. #[jacquard_derive::lexicon] #[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, )] #[serde(rename_all = "camelCase")] pub struct BookEntryView<'a> { @@ -1081,7 +2236,7 @@ pub struct BookEntryView<'a> { pub mod book_entry_view_state { - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -1089,37 +2244,37 @@ pub mod book_entry_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Entry; type Index; + type Entry; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Entry = Unset; type Index = Unset; - } - ///State transition - sets the `entry` field to Set - pub struct SetEntry(PhantomData S>); - impl sealed::Sealed for SetEntry {} - impl State for SetEntry { - type Entry = Set; - type Index = S::Index; + type Entry = Unset; } ///State transition - sets the `index` field to Set pub struct SetIndex(PhantomData S>); impl sealed::Sealed for SetIndex {} impl State for SetIndex { - type Entry = S::Entry; type Index = Set; + type Entry = S::Entry; + } + ///State transition - sets the `entry` field to Set + pub struct SetEntry(PhantomData S>); + impl sealed::Sealed for SetEntry {} + impl State for SetEntry { + type Index = S::Index; + type Entry = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `entry` field - pub struct entry(()); ///Marker type for the `index` field pub struct index(()); + ///Marker type for the `entry` field + pub struct entry(()); } } @@ -1232,8 +2387,8 @@ impl<'a, S: book_entry_view_state::State> BookEntryViewBuilder<'a, S> { impl<'a, S> BookEntryViewBuilder<'a, S> where S: book_entry_view_state::State, - S::Entry: book_entry_view_state::IsSet, S::Index: book_entry_view_state::IsSet, + S::Entry: book_entry_view_state::IsSet, { /// Build the final struct pub fn build(self) -> BookEntryView<'a> { @@ -1280,86 +2435,27 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for BookEntryView<'a> { } } -/// The format of the content. This is used to determine how to render the content. +/// An entry within a chapter context. #[jacquard_derive::lexicon] #[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic, - Default + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, )] #[serde(rename_all = "camelCase")] -pub struct ContentFormat<'a> { - /// The format of the content. This is used to determine how to render the content. - #[serde(skip_serializing_if = "std::option::Option::is_none")] +pub struct ChapterEntryView<'a> { #[serde(borrow)] - pub markdown: std::option::Option>, -} - -impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ContentFormat<'a> { - fn nsid() -> &'static str { - "sh.weaver.notebook.defs" - } - fn def_name() -> &'static str { - "contentFormat" - } - fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { - lexicon_doc_sh_weaver_notebook_defs() - } - fn validate( - &self, - ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { - Ok(()) - } -} - -#[jacquard_derive::lexicon] -#[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic -)] -#[serde(rename_all = "camelCase")] -pub struct EntryView<'a> { - #[serde(borrow)] - pub authors: Vec>, - #[serde(borrow)] - pub cid: jacquard_common::types::string::Cid<'a>, - pub indexed_at: jacquard_common::types::string::Datetime, - #[serde(skip_serializing_if = "std::option::Option::is_none")] - #[serde(borrow)] - pub path: std::option::Option>, - #[serde(skip_serializing_if = "std::option::Option::is_none")] - #[serde(borrow)] - pub permissions: std::option::Option< - crate::sh_weaver::notebook::PermissionsState<'a>, - >, - #[serde(borrow)] - pub record: jacquard_common::types::value::Data<'a>, - #[serde(skip_serializing_if = "std::option::Option::is_none")] - #[serde(borrow)] - pub rendered_view: std::option::Option>, + pub entry: crate::sh_weaver::notebook::EntryView<'a>, + pub index: i64, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] - pub tags: std::option::Option>, + pub next: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] - pub title: std::option::Option>, - #[serde(borrow)] - pub uri: jacquard_common::types::string::AtUri<'a>, + pub prev: std::option::Option>, } -pub mod entry_view_state { +pub mod chapter_entry_view_state { - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -1367,147 +2463,82 @@ pub mod entry_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; - type Authors; - type Record; - type IndexedAt; - type Uri; + type Entry; + type Index; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; - type Authors = Unset; - type Record = Unset; - type IndexedAt = Unset; - type Uri = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Authors = S::Authors; - type Record = S::Record; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - } - ///State transition - sets the `authors` field to Set - pub struct SetAuthors(PhantomData S>); - impl sealed::Sealed for SetAuthors {} - impl State for SetAuthors { - type Cid = S::Cid; - type Authors = Set; - type Record = S::Record; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; - } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { - type Cid = S::Cid; - type Authors = S::Authors; - type Record = Set; - type IndexedAt = S::IndexedAt; - type Uri = S::Uri; + type Entry = Unset; + type Index = Unset; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Cid = S::Cid; - type Authors = S::Authors; - type Record = S::Record; - type IndexedAt = Set; - type Uri = S::Uri; + ///State transition - sets the `entry` field to Set + pub struct SetEntry(PhantomData S>); + impl sealed::Sealed for SetEntry {} + impl State for SetEntry { + type Entry = Set; + type Index = S::Index; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Cid = S::Cid; - type Authors = S::Authors; - type Record = S::Record; - type IndexedAt = S::IndexedAt; - type Uri = Set; + ///State transition - sets the `index` field to Set + pub struct SetIndex(PhantomData S>); + impl sealed::Sealed for SetIndex {} + impl State for SetIndex { + type Entry = S::Entry; + type Index = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `authors` field - pub struct authors(()); - ///Marker type for the `record` field - pub struct record(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); - ///Marker type for the `uri` field - pub struct uri(()); - } + ///Marker type for the `entry` field + pub struct entry(()); + ///Marker type for the `index` field + pub struct index(()); + } } /// Builder for constructing an instance of this type -pub struct EntryViewBuilder<'a, S: entry_view_state::State> { +pub struct ChapterEntryViewBuilder<'a, S: chapter_entry_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( - ::core::option::Option>>, - ::core::option::Option>, - ::core::option::Option, - ::core::option::Option>, - ::core::option::Option>, - ::core::option::Option>, - ::core::option::Option>, - ::core::option::Option>, - ::core::option::Option>, - ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } -impl<'a> EntryView<'a> { +impl<'a> ChapterEntryView<'a> { /// Create a new builder for this type - pub fn new() -> EntryViewBuilder<'a, entry_view_state::Empty> { - EntryViewBuilder::new() + pub fn new() -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::Empty> { + ChapterEntryViewBuilder::new() } } -impl<'a> EntryViewBuilder<'a, entry_view_state::Empty> { +impl<'a> ChapterEntryViewBuilder<'a, chapter_entry_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { - EntryViewBuilder { + ChapterEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: ( - None, - None, - None, - None, - None, - None, - None, - None, - None, - None, - ), + __unsafe_private_named: (None, None, None, None), _phantom: ::core::marker::PhantomData, } } } -impl<'a, S> EntryViewBuilder<'a, S> +impl<'a, S> ChapterEntryViewBuilder<'a, S> where - S: entry_view_state::State, - S::Authors: entry_view_state::IsUnset, + S: chapter_entry_view_state::State, + S::Entry: chapter_entry_view_state::IsUnset, { - /// Set the `authors` field (required) - pub fn authors( + /// Set the `entry` field (required) + pub fn entry( mut self, - value: impl Into>>, - ) -> EntryViewBuilder<'a, entry_view_state::SetAuthors> { + value: impl Into>, + ) -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::SetEntry> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); - EntryViewBuilder { + ChapterEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, @@ -1515,18 +2546,18 @@ where } } -impl<'a, S> EntryViewBuilder<'a, S> +impl<'a, S> ChapterEntryViewBuilder<'a, S> where - S: entry_view_state::State, - S::Cid: entry_view_state::IsUnset, + S: chapter_entry_view_state::State, + S::Index: chapter_entry_view_state::IsUnset, { - /// Set the `cid` field (required) - pub fn cid( + /// Set the `index` field (required) + pub fn index( mut self, - value: impl Into>, - ) -> EntryViewBuilder<'a, entry_view_state::SetCid> { + value: impl Into, + ) -> ChapterEntryViewBuilder<'a, chapter_entry_view_state::SetIndex> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); - EntryViewBuilder { + ChapterEntryViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, @@ -1534,180 +2565,57 @@ where } } -impl<'a, S> EntryViewBuilder<'a, S> -where - S: entry_view_state::State, - S::IndexedAt: entry_view_state::IsUnset, -{ - /// Set the `indexedAt` field (required) - pub fn indexed_at( - mut self, - value: impl Into, - ) -> EntryViewBuilder<'a, entry_view_state::SetIndexedAt> { - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); - EntryViewBuilder { - _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: self.__unsafe_private_named, - _phantom: ::core::marker::PhantomData, - } - } -} - -impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { - /// Set the `path` field (optional) - pub fn path( - mut self, - value: impl Into>>, - ) -> Self { - self.__unsafe_private_named.3 = value.into(); - self - } - /// Set the `path` field to an Option value (optional) - pub fn maybe_path( - mut self, - value: Option>, - ) -> Self { - self.__unsafe_private_named.3 = value; - self - } -} - -impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { - /// Set the `permissions` field (optional) - pub fn permissions( - mut self, - value: impl Into>>, - ) -> Self { - self.__unsafe_private_named.4 = value.into(); - self - } - /// Set the `permissions` field to an Option value (optional) - pub fn maybe_permissions( - mut self, - value: Option>, - ) -> Self { - self.__unsafe_private_named.4 = value; - self - } -} - -impl<'a, S> EntryViewBuilder<'a, S> -where - S: entry_view_state::State, - S::Record: entry_view_state::IsUnset, -{ - /// Set the `record` field (required) - pub fn record( - mut self, - value: impl Into>, - ) -> EntryViewBuilder<'a, entry_view_state::SetRecord> { - self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); - EntryViewBuilder { - _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: self.__unsafe_private_named, - _phantom: ::core::marker::PhantomData, - } - } -} - -impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { - /// Set the `renderedView` field (optional) - pub fn rendered_view( - mut self, - value: impl Into>>, - ) -> Self { - self.__unsafe_private_named.6 = value.into(); - self - } - /// Set the `renderedView` field to an Option value (optional) - pub fn maybe_rendered_view( - mut self, - value: Option>, - ) -> Self { - self.__unsafe_private_named.6 = value; - self - } -} - -impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { - /// Set the `tags` field (optional) - pub fn tags( +impl<'a, S: chapter_entry_view_state::State> ChapterEntryViewBuilder<'a, S> { + /// Set the `next` field (optional) + pub fn next( mut self, - value: impl Into>>, + value: impl Into>>, ) -> Self { - self.__unsafe_private_named.7 = value.into(); + self.__unsafe_private_named.2 = value.into(); self } - /// Set the `tags` field to an Option value (optional) - pub fn maybe_tags( + /// Set the `next` field to an Option value (optional) + pub fn maybe_next( mut self, - value: Option>, + value: Option>, ) -> Self { - self.__unsafe_private_named.7 = value; + self.__unsafe_private_named.2 = value; self } } -impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { - /// Set the `title` field (optional) - pub fn title( +impl<'a, S: chapter_entry_view_state::State> ChapterEntryViewBuilder<'a, S> { + /// Set the `prev` field (optional) + pub fn prev( mut self, - value: impl Into>>, + value: impl Into>>, ) -> Self { - self.__unsafe_private_named.8 = value.into(); + self.__unsafe_private_named.3 = value.into(); self } - /// Set the `title` field to an Option value (optional) - pub fn maybe_title( + /// Set the `prev` field to an Option value (optional) + pub fn maybe_prev( mut self, - value: Option>, + value: Option>, ) -> Self { - self.__unsafe_private_named.8 = value; + self.__unsafe_private_named.3 = value; self } } -impl<'a, S> EntryViewBuilder<'a, S> -where - S: entry_view_state::State, - S::Uri: entry_view_state::IsUnset, -{ - /// Set the `uri` field (required) - pub fn uri( - mut self, - value: impl Into>, - ) -> EntryViewBuilder<'a, entry_view_state::SetUri> { - self.__unsafe_private_named.9 = ::core::option::Option::Some(value.into()); - EntryViewBuilder { - _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: self.__unsafe_private_named, - _phantom: ::core::marker::PhantomData, - } - } -} - -impl<'a, S> EntryViewBuilder<'a, S> +impl<'a, S> ChapterEntryViewBuilder<'a, S> where - S: entry_view_state::State, - S::Cid: entry_view_state::IsSet, - S::Authors: entry_view_state::IsSet, - S::Record: entry_view_state::IsSet, - S::IndexedAt: entry_view_state::IsSet, - S::Uri: entry_view_state::IsSet, + S: chapter_entry_view_state::State, + S::Entry: chapter_entry_view_state::IsSet, + S::Index: chapter_entry_view_state::IsSet, { /// Build the final struct - pub fn build(self) -> EntryView<'a> { - EntryView { - authors: self.__unsafe_private_named.0.unwrap(), - cid: self.__unsafe_private_named.1.unwrap(), - indexed_at: self.__unsafe_private_named.2.unwrap(), - path: self.__unsafe_private_named.3, - permissions: self.__unsafe_private_named.4, - record: self.__unsafe_private_named.5.unwrap(), - rendered_view: self.__unsafe_private_named.6, - tags: self.__unsafe_private_named.7, - title: self.__unsafe_private_named.8, - uri: self.__unsafe_private_named.9.unwrap(), + pub fn build(self) -> ChapterEntryView<'a> { + ChapterEntryView { + entry: self.__unsafe_private_named.0.unwrap(), + index: self.__unsafe_private_named.1.unwrap(), + next: self.__unsafe_private_named.2, + prev: self.__unsafe_private_named.3, extra_data: Default::default(), } } @@ -1718,29 +2626,23 @@ where jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, - ) -> EntryView<'a> { - EntryView { - authors: self.__unsafe_private_named.0.unwrap(), - cid: self.__unsafe_private_named.1.unwrap(), - indexed_at: self.__unsafe_private_named.2.unwrap(), - path: self.__unsafe_private_named.3, - permissions: self.__unsafe_private_named.4, - record: self.__unsafe_private_named.5.unwrap(), - rendered_view: self.__unsafe_private_named.6, - tags: self.__unsafe_private_named.7, - title: self.__unsafe_private_named.8, - uri: self.__unsafe_private_named.9.unwrap(), + ) -> ChapterEntryView<'a> { + ChapterEntryView { + entry: self.__unsafe_private_named.0.unwrap(), + index: self.__unsafe_private_named.1.unwrap(), + next: self.__unsafe_private_named.2, + prev: self.__unsafe_private_named.3, extra_data: Some(extra_data), } } } -impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EntryView<'a> { +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ChapterEntryView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { - "entryView" + "chapterEntryView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() @@ -1752,31 +2654,22 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EntryView<'a> { } } +/// Hydrated view of a chapter. #[jacquard_derive::lexicon] #[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, )] #[serde(rename_all = "camelCase")] -pub struct NotebookView<'a> { +pub struct ChapterView<'a> { #[serde(borrow)] pub authors: Vec>, #[serde(borrow)] pub cid: jacquard_common::types::string::Cid<'a>, - pub indexed_at: jacquard_common::types::string::Datetime, - #[serde(skip_serializing_if = "std::option::Option::is_none")] - #[serde(borrow)] - pub path: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub entry_count: std::option::Option, + pub indexed_at: jacquard_common::types::string::Datetime, #[serde(borrow)] - pub permissions: std::option::Option< - crate::sh_weaver::notebook::PermissionsState<'a>, - >, + pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, #[serde(borrow)] pub record: jacquard_common::types::value::Data<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] @@ -1789,9 +2682,9 @@ pub struct NotebookView<'a> { pub uri: jacquard_common::types::string::AtUri<'a>, } -pub mod notebook_view_state { +pub mod chapter_view_state { - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -1799,97 +2692,117 @@ pub mod notebook_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Cid; - type Uri; type Authors; - type IndexedAt; + type Cid; type Record; + type IndexedAt; + type Notebook; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Cid = Unset; - type Uri = Unset; type Authors = Unset; - type IndexedAt = Unset; + type Cid = Unset; type Record = Unset; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Cid = Set; - type Uri = S::Uri; - type Authors = S::Authors; - type IndexedAt = S::IndexedAt; - type Record = S::Record; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Cid = S::Cid; - type Uri = Set; - type Authors = S::Authors; - type IndexedAt = S::IndexedAt; - type Record = S::Record; + type IndexedAt = Unset; + type Notebook = Unset; + type Uri = Unset; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { - type Cid = S::Cid; - type Uri = S::Uri; type Authors = Set; + type Cid = S::Cid; + type Record = S::Record; type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; + type Uri = S::Uri; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Authors = S::Authors; + type Cid = Set; type Record = S::Record; + type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; + type Uri = S::Uri; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Authors = S::Authors; + type Cid = S::Cid; + type Record = Set; + type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; + type Uri = S::Uri; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Cid = S::Cid; - type Uri = S::Uri; type Authors = S::Authors; - type IndexedAt = Set; + type Cid = S::Cid; type Record = S::Record; + type IndexedAt = Set; + type Notebook = S::Notebook; + type Uri = S::Uri; } - ///State transition - sets the `record` field to Set - pub struct SetRecord(PhantomData S>); - impl sealed::Sealed for SetRecord {} - impl State for SetRecord { + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Authors = S::Authors; type Cid = S::Cid; + type Record = S::Record; + type IndexedAt = S::IndexedAt; + type Notebook = Set; type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { type Authors = S::Authors; + type Cid = S::Cid; + type Record = S::Record; type IndexedAt = S::IndexedAt; - type Record = Set; + type Notebook = S::Notebook; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `cid` field - pub struct cid(()); - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `authors` field pub struct authors(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `cid` field + pub struct cid(()); ///Marker type for the `record` field pub struct record(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `notebook` field + pub struct notebook(()); + ///Marker type for the `uri` field + pub struct uri(()); } } /// Builder for constructing an instance of this type -pub struct NotebookViewBuilder<'a, S: notebook_view_state::State> { +pub struct ChapterViewBuilder<'a, S: chapter_view_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, ::core::option::Option>, + ::core::option::Option, ::core::option::Option, - ::core::option::Option>, - ::core::option::Option>, + ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, @@ -1898,46 +2811,36 @@ pub struct NotebookViewBuilder<'a, S: notebook_view_state::State> { _phantom: ::core::marker::PhantomData<&'a ()>, } -impl<'a> NotebookView<'a> { +impl<'a> ChapterView<'a> { /// Create a new builder for this type - pub fn new() -> NotebookViewBuilder<'a, notebook_view_state::Empty> { - NotebookViewBuilder::new() + pub fn new() -> ChapterViewBuilder<'a, chapter_view_state::Empty> { + ChapterViewBuilder::new() } } -impl<'a> NotebookViewBuilder<'a, notebook_view_state::Empty> { +impl<'a> ChapterViewBuilder<'a, chapter_view_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { - NotebookViewBuilder { + ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: ( - None, - None, - None, - None, - None, - None, - None, - None, - None, - ), + __unsafe_private_named: (None, None, None, None, None, None, None, None, None), _phantom: ::core::marker::PhantomData, } } } -impl<'a, S> NotebookViewBuilder<'a, S> +impl<'a, S> ChapterViewBuilder<'a, S> where - S: notebook_view_state::State, - S::Authors: notebook_view_state::IsUnset, + S: chapter_view_state::State, + S::Authors: chapter_view_state::IsUnset, { /// Set the `authors` field (required) pub fn authors( mut self, value: impl Into>>, - ) -> NotebookViewBuilder<'a, notebook_view_state::SetAuthors> { + ) -> ChapterViewBuilder<'a, chapter_view_state::SetAuthors> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); - NotebookViewBuilder { + ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, @@ -1945,18 +2848,18 @@ where } } -impl<'a, S> NotebookViewBuilder<'a, S> +impl<'a, S> ChapterViewBuilder<'a, S> where - S: notebook_view_state::State, - S::Cid: notebook_view_state::IsUnset, + S: chapter_view_state::State, + S::Cid: chapter_view_state::IsUnset, { /// Set the `cid` field (required) pub fn cid( mut self, value: impl Into>, - ) -> NotebookViewBuilder<'a, notebook_view_state::SetCid> { + ) -> ChapterViewBuilder<'a, chapter_view_state::SetCid> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); - NotebookViewBuilder { + ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, @@ -1964,18 +2867,31 @@ where } } -impl<'a, S> NotebookViewBuilder<'a, S> +impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> { + /// Set the `entryCount` field (optional) + pub fn entry_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `entryCount` field to an Option value (optional) + pub fn maybe_entry_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ChapterViewBuilder<'a, S> where - S: notebook_view_state::State, - S::IndexedAt: notebook_view_state::IsUnset, + S: chapter_view_state::State, + S::IndexedAt: chapter_view_state::IsUnset, { /// Set the `indexedAt` field (required) pub fn indexed_at( mut self, value: impl Into, - ) -> NotebookViewBuilder<'a, notebook_view_state::SetIndexedAt> { - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); - NotebookViewBuilder { + ) -> ChapterViewBuilder<'a, chapter_view_state::SetIndexedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, @@ -1983,56 +2899,37 @@ where } } -impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { - /// Set the `path` field (optional) - pub fn path( - mut self, - value: impl Into>>, - ) -> Self { - self.__unsafe_private_named.3 = value.into(); - self - } - /// Set the `path` field to an Option value (optional) - pub fn maybe_path( - mut self, - value: Option>, - ) -> Self { - self.__unsafe_private_named.3 = value; - self - } -} - -impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { - /// Set the `permissions` field (optional) - pub fn permissions( - mut self, - value: impl Into>>, - ) -> Self { - self.__unsafe_private_named.4 = value.into(); - self - } - /// Set the `permissions` field to an Option value (optional) - pub fn maybe_permissions( +impl<'a, S> ChapterViewBuilder<'a, S> +where + S: chapter_view_state::State, + S::Notebook: chapter_view_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( mut self, - value: Option>, - ) -> Self { - self.__unsafe_private_named.4 = value; - self + value: impl Into>, + ) -> ChapterViewBuilder<'a, chapter_view_state::SetNotebook> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + ChapterViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } } } -impl<'a, S> NotebookViewBuilder<'a, S> +impl<'a, S> ChapterViewBuilder<'a, S> where - S: notebook_view_state::State, - S::Record: notebook_view_state::IsUnset, + S: chapter_view_state::State, + S::Record: chapter_view_state::IsUnset, { /// Set the `record` field (required) pub fn record( mut self, value: impl Into>, - ) -> NotebookViewBuilder<'a, notebook_view_state::SetRecord> { + ) -> ChapterViewBuilder<'a, chapter_view_state::SetRecord> { self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); - NotebookViewBuilder { + ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, @@ -2040,26 +2937,20 @@ where } } -impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { +impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> { /// Set the `tags` field (optional) - pub fn tags( - mut self, - value: impl Into>>, - ) -> Self { + pub fn tags(mut self, value: impl Into>>) -> Self { self.__unsafe_private_named.6 = value.into(); self } /// Set the `tags` field to an Option value (optional) - pub fn maybe_tags( - mut self, - value: Option>, - ) -> Self { + pub fn maybe_tags(mut self, value: Option>) -> Self { self.__unsafe_private_named.6 = value; self } } -impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { +impl<'a, S: chapter_view_state::State> ChapterViewBuilder<'a, S> { /// Set the `title` field (optional) pub fn title( mut self, @@ -2069,27 +2960,24 @@ impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { self } /// Set the `title` field to an Option value (optional) - pub fn maybe_title( - mut self, - value: Option>, - ) -> Self { + pub fn maybe_title(mut self, value: Option>) -> Self { self.__unsafe_private_named.7 = value; self } } -impl<'a, S> NotebookViewBuilder<'a, S> +impl<'a, S> ChapterViewBuilder<'a, S> where - S: notebook_view_state::State, - S::Uri: notebook_view_state::IsUnset, + S: chapter_view_state::State, + S::Uri: chapter_view_state::IsUnset, { /// Set the `uri` field (required) pub fn uri( mut self, value: impl Into>, - ) -> NotebookViewBuilder<'a, notebook_view_state::SetUri> { + ) -> ChapterViewBuilder<'a, chapter_view_state::SetUri> { self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); - NotebookViewBuilder { + ChapterViewBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, @@ -2097,23 +2985,24 @@ where } } -impl<'a, S> NotebookViewBuilder<'a, S> +impl<'a, S> ChapterViewBuilder<'a, S> where - S: notebook_view_state::State, - S::Cid: notebook_view_state::IsSet, - S::Uri: notebook_view_state::IsSet, - S::Authors: notebook_view_state::IsSet, - S::IndexedAt: notebook_view_state::IsSet, - S::Record: notebook_view_state::IsSet, + S: chapter_view_state::State, + S::Authors: chapter_view_state::IsSet, + S::Cid: chapter_view_state::IsSet, + S::Record: chapter_view_state::IsSet, + S::IndexedAt: chapter_view_state::IsSet, + S::Notebook: chapter_view_state::IsSet, + S::Uri: chapter_view_state::IsSet, { /// Build the final struct - pub fn build(self) -> NotebookView<'a> { - NotebookView { + pub fn build(self) -> ChapterView<'a> { + ChapterView { authors: self.__unsafe_private_named.0.unwrap(), cid: self.__unsafe_private_named.1.unwrap(), - indexed_at: self.__unsafe_private_named.2.unwrap(), - path: self.__unsafe_private_named.3, - permissions: self.__unsafe_private_named.4, + entry_count: self.__unsafe_private_named.2, + indexed_at: self.__unsafe_private_named.3.unwrap(), + notebook: self.__unsafe_private_named.4.unwrap(), record: self.__unsafe_private_named.5.unwrap(), tags: self.__unsafe_private_named.6, title: self.__unsafe_private_named.7, @@ -2128,13 +3017,13 @@ where jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, - ) -> NotebookView<'a> { - NotebookView { + ) -> ChapterView<'a> { + ChapterView { authors: self.__unsafe_private_named.0.unwrap(), cid: self.__unsafe_private_named.1.unwrap(), - indexed_at: self.__unsafe_private_named.2.unwrap(), - path: self.__unsafe_private_named.3, - permissions: self.__unsafe_private_named.4, + entry_count: self.__unsafe_private_named.2, + indexed_at: self.__unsafe_private_named.3.unwrap(), + notebook: self.__unsafe_private_named.4.unwrap(), record: self.__unsafe_private_named.5.unwrap(), tags: self.__unsafe_private_named.6, title: self.__unsafe_private_named.7, @@ -2144,12 +3033,12 @@ where } } -impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookView<'a> { +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ChapterView<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { - "notebookView" + "chapterView" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() @@ -2161,9 +3050,7 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookView<'a> { } } -/// The path of the notebook. -pub type Path<'a> = jacquard_common::CowStr<'a>; -/// A single permission grant. For resource authority: source=resource URI, grantedAt=createdAt. For invitees: source=invite URI, grantedAt=accept createdAt. +/// The format of the content. This is used to determine how to render the content. #[jacquard_derive::lexicon] #[derive( serde::Serialize, @@ -2172,25 +3059,3036 @@ pub type Path<'a> = jacquard_common::CowStr<'a>; Clone, PartialEq, Eq, - jacquard_derive::IntoStatic + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct ContentFormat<'a> { + /// The format of the content. This is used to determine how to render the content. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub markdown: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ContentFormat<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "contentFormat" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Author-applied content rating. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ContentRating<'a> { + General, + Teen, + Mature, + Explicit, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> ContentRating<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::General => "general", + Self::Teen => "teen", + Self::Mature => "mature", + Self::Explicit => "explicit", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for ContentRating<'a> { + fn from(s: &'a str) -> Self { + match s { + "general" => Self::General, + "teen" => Self::Teen, + "mature" => Self::Mature, + "explicit" => Self::Explicit, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for ContentRating<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "general" => Self::General, + "teen" => Self::Teen, + "mature" => Self::Mature, + "explicit" => Self::Explicit, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for ContentRating<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for ContentRating<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for ContentRating<'a> +where + 'de: 'a, +{ + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = <&'de str>::deserialize(deserializer)?; + Ok(Self::from(s)) + } +} + +impl jacquard_common::IntoStatic for ContentRating<'_> { + type Output = ContentRating<'static>; + fn into_static(self) -> Self::Output { + match self { + ContentRating::General => ContentRating::General, + ContentRating::Teen => ContentRating::Teen, + ContentRating::Mature => ContentRating::Mature, + ContentRating::Explicit => ContentRating::Explicit, + ContentRating::Other(v) => ContentRating::Other(v.into_static()), + } + } +} + +/// Author-applied content warning. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum ContentWarning<'a> { + Violence, + GraphicViolence, + Death, + MajorCharacterDeath, + SexualContent, + ExplicitSexualContent, + Language, + SubstanceUse, + SelfHarm, + Abuse, + DisturbingImagery, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> ContentWarning<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::Violence => "violence", + Self::GraphicViolence => "graphic-violence", + Self::Death => "death", + Self::MajorCharacterDeath => "major-character-death", + Self::SexualContent => "sexual-content", + Self::ExplicitSexualContent => "explicit-sexual-content", + Self::Language => "language", + Self::SubstanceUse => "substance-use", + Self::SelfHarm => "self-harm", + Self::Abuse => "abuse", + Self::DisturbingImagery => "disturbing-imagery", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for ContentWarning<'a> { + fn from(s: &'a str) -> Self { + match s { + "violence" => Self::Violence, + "graphic-violence" => Self::GraphicViolence, + "death" => Self::Death, + "major-character-death" => Self::MajorCharacterDeath, + "sexual-content" => Self::SexualContent, + "explicit-sexual-content" => Self::ExplicitSexualContent, + "language" => Self::Language, + "substance-use" => Self::SubstanceUse, + "self-harm" => Self::SelfHarm, + "abuse" => Self::Abuse, + "disturbing-imagery" => Self::DisturbingImagery, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for ContentWarning<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "violence" => Self::Violence, + "graphic-violence" => Self::GraphicViolence, + "death" => Self::Death, + "major-character-death" => Self::MajorCharacterDeath, + "sexual-content" => Self::SexualContent, + "explicit-sexual-content" => Self::ExplicitSexualContent, + "language" => Self::Language, + "substance-use" => Self::SubstanceUse, + "self-harm" => Self::SelfHarm, + "abuse" => Self::Abuse, + "disturbing-imagery" => Self::DisturbingImagery, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for ContentWarning<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for ContentWarning<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for ContentWarning<'a> +where + 'de: 'a, +{ + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = <&'de str>::deserialize(deserializer)?; + Ok(Self::from(s)) + } +} + +impl jacquard_common::IntoStatic for ContentWarning<'_> { + type Output = ContentWarning<'static>; + fn into_static(self) -> Self::Output { + match self { + ContentWarning::Violence => ContentWarning::Violence, + ContentWarning::GraphicViolence => ContentWarning::GraphicViolence, + ContentWarning::Death => ContentWarning::Death, + ContentWarning::MajorCharacterDeath => ContentWarning::MajorCharacterDeath, + ContentWarning::SexualContent => ContentWarning::SexualContent, + ContentWarning::ExplicitSexualContent => ContentWarning::ExplicitSexualContent, + ContentWarning::Language => ContentWarning::Language, + ContentWarning::SubstanceUse => ContentWarning::SubstanceUse, + ContentWarning::SelfHarm => ContentWarning::SelfHarm, + ContentWarning::Abuse => ContentWarning::Abuse, + ContentWarning::DisturbingImagery => ContentWarning::DisturbingImagery, + ContentWarning::Other(v) => ContentWarning::Other(v.into_static()), + } + } +} + +/// Author-applied content warnings. +pub type ContentWarnings<'a> = Vec>; +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct EntryView<'a> { + #[serde(borrow)] + pub authors: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub bookmark_count: std::option::Option, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub like_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub path: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub permissions: std::option::Option>, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub rendered_view: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub title: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer_bookmark: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer_like: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer_reading_progress: + std::option::Option>, +} + +pub mod entry_view_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Authors; + type IndexedAt; + type Record; + type Uri; + type Cid; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Authors = Unset; + type IndexedAt = Unset; + type Record = Unset; + type Uri = Unset; + type Cid = Unset; + } + ///State transition - sets the `authors` field to Set + pub struct SetAuthors(PhantomData S>); + impl sealed::Sealed for SetAuthors {} + impl State for SetAuthors { + type Authors = Set; + type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Uri = S::Uri; + type Cid = S::Cid; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Authors = S::Authors; + type IndexedAt = Set; + type Record = S::Record; + type Uri = S::Uri; + type Cid = S::Cid; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Authors = S::Authors; + type IndexedAt = S::IndexedAt; + type Record = Set; + type Uri = S::Uri; + type Cid = S::Cid; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Authors = S::Authors; + type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Uri = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Authors = S::Authors; + type IndexedAt = S::IndexedAt; + type Record = S::Record; + type Uri = S::Uri; + type Cid = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `authors` field + pub struct authors(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct EntryViewBuilder<'a, S: entry_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> EntryView<'a> { + /// Create a new builder for this type + pub fn new() -> EntryViewBuilder<'a, entry_view_state::Empty> { + EntryViewBuilder::new() + } +} + +impl<'a> EntryViewBuilder<'a, entry_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + EntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, None, None, None, None, None, None, None, None, None, None, None, None, None, + None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntryViewBuilder<'a, S> +where + S: entry_view_state::State, + S::Authors: entry_view_state::IsUnset, +{ + /// Set the `authors` field (required) + pub fn authors( + mut self, + value: impl Into>>, + ) -> EntryViewBuilder<'a, entry_view_state::SetAuthors> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + EntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `bookmarkCount` field (optional) + pub fn bookmark_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `bookmarkCount` field to an Option value (optional) + pub fn maybe_bookmark_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> EntryViewBuilder<'a, S> +where + S: entry_view_state::State, + S::Cid: entry_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> EntryViewBuilder<'a, entry_view_state::SetCid> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + EntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> EntryViewBuilder<'a, S> +where + S: entry_view_state::State, + S::IndexedAt: entry_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> EntryViewBuilder<'a, entry_view_state::SetIndexedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + EntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `likeCount` field (optional) + pub fn like_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `likeCount` field to an Option value (optional) + pub fn maybe_like_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `path` field (optional) + pub fn path(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `path` field to an Option value (optional) + pub fn maybe_path(mut self, value: Option>) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `permissions` field (optional) + pub fn permissions( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `permissions` field to an Option value (optional) + pub fn maybe_permissions( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> EntryViewBuilder<'a, S> +where + S: entry_view_state::State, + S::Record: entry_view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> EntryViewBuilder<'a, entry_view_state::SetRecord> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + EntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `renderedView` field (optional) + pub fn rendered_view( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.8 = value.into(); + self + } + /// Set the `renderedView` field to an Option value (optional) + pub fn maybe_rendered_view( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.8 = value; + self + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `tags` field (optional) + pub fn tags(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `tags` field to an Option value (optional) + pub fn maybe_tags(mut self, value: Option>) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `title` field (optional) + pub fn title( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `title` field to an Option value (optional) + pub fn maybe_title(mut self, value: Option>) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S> EntryViewBuilder<'a, S> +where + S: entry_view_state::State, + S::Uri: entry_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> EntryViewBuilder<'a, entry_view_state::SetUri> { + self.__unsafe_private_named.11 = ::core::option::Option::Some(value.into()); + EntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `viewerBookmark` field (optional) + pub fn viewer_bookmark( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.12 = value.into(); + self + } + /// Set the `viewerBookmark` field to an Option value (optional) + pub fn maybe_viewer_bookmark( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.12 = value; + self + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `viewerLike` field (optional) + pub fn viewer_like( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.13 = value.into(); + self + } + /// Set the `viewerLike` field to an Option value (optional) + pub fn maybe_viewer_like( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.13 = value; + self + } +} + +impl<'a, S: entry_view_state::State> EntryViewBuilder<'a, S> { + /// Set the `viewerReadingProgress` field (optional) + pub fn viewer_reading_progress( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.14 = value.into(); + self + } + /// Set the `viewerReadingProgress` field to an Option value (optional) + pub fn maybe_viewer_reading_progress( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.14 = value; + self + } +} + +impl<'a, S> EntryViewBuilder<'a, S> +where + S: entry_view_state::State, + S::Authors: entry_view_state::IsSet, + S::IndexedAt: entry_view_state::IsSet, + S::Record: entry_view_state::IsSet, + S::Uri: entry_view_state::IsSet, + S::Cid: entry_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> EntryView<'a> { + EntryView { + authors: self.__unsafe_private_named.0.unwrap(), + bookmark_count: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + indexed_at: self.__unsafe_private_named.3.unwrap(), + like_count: self.__unsafe_private_named.4, + path: self.__unsafe_private_named.5, + permissions: self.__unsafe_private_named.6, + record: self.__unsafe_private_named.7.unwrap(), + rendered_view: self.__unsafe_private_named.8, + tags: self.__unsafe_private_named.9, + title: self.__unsafe_private_named.10, + uri: self.__unsafe_private_named.11.unwrap(), + viewer_bookmark: self.__unsafe_private_named.12, + viewer_like: self.__unsafe_private_named.13, + viewer_reading_progress: self.__unsafe_private_named.14, + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> EntryView<'a> { + EntryView { + authors: self.__unsafe_private_named.0.unwrap(), + bookmark_count: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + indexed_at: self.__unsafe_private_named.3.unwrap(), + like_count: self.__unsafe_private_named.4, + path: self.__unsafe_private_named.5, + permissions: self.__unsafe_private_named.6, + record: self.__unsafe_private_named.7.unwrap(), + rendered_view: self.__unsafe_private_named.8, + tags: self.__unsafe_private_named.9, + title: self.__unsafe_private_named.10, + uri: self.__unsafe_private_named.11.unwrap(), + viewer_bookmark: self.__unsafe_private_named.12, + viewer_like: self.__unsafe_private_named.13, + viewer_reading_progress: self.__unsafe_private_named.14, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for EntryView<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "entryView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Entry with feed-specific context (discovery reason, notebook context). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct FeedEntryView<'a> { + #[serde(borrow)] + pub entry: crate::sh_weaver::notebook::EntryView<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub notebook_context: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reason: std::option::Option>, +} + +pub mod feed_entry_view_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Entry; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Entry = Unset; + } + ///State transition - sets the `entry` field to Set + pub struct SetEntry(PhantomData S>); + impl sealed::Sealed for SetEntry {} + impl State for SetEntry { + type Entry = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `entry` field + pub struct entry(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FeedEntryViewBuilder<'a, S: feed_entry_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> FeedEntryView<'a> { + /// Create a new builder for this type + pub fn new() -> FeedEntryViewBuilder<'a, feed_entry_view_state::Empty> { + FeedEntryViewBuilder::new() + } +} + +impl<'a> FeedEntryViewBuilder<'a, feed_entry_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FeedEntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FeedEntryViewBuilder<'a, S> +where + S: feed_entry_view_state::State, + S::Entry: feed_entry_view_state::IsUnset, +{ + /// Set the `entry` field (required) + pub fn entry( + mut self, + value: impl Into>, + ) -> FeedEntryViewBuilder<'a, feed_entry_view_state::SetEntry> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + FeedEntryViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: feed_entry_view_state::State> FeedEntryViewBuilder<'a, S> { + /// Set the `notebookContext` field (optional) + pub fn notebook_context( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `notebookContext` field to an Option value (optional) + pub fn maybe_notebook_context( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: feed_entry_view_state::State> FeedEntryViewBuilder<'a, S> { + /// Set the `reason` field (optional) + pub fn reason( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `reason` field to an Option value (optional) + pub fn maybe_reason( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> FeedEntryViewBuilder<'a, S> +where + S: feed_entry_view_state::State, + S::Entry: feed_entry_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> FeedEntryView<'a> { + FeedEntryView { + entry: self.__unsafe_private_named.0.unwrap(), + notebook_context: self.__unsafe_private_named.1, + reason: self.__unsafe_private_named.2, + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> FeedEntryView<'a> { + FeedEntryView { + entry: self.__unsafe_private_named.0.unwrap(), + notebook_context: self.__unsafe_private_named.1, + reason: self.__unsafe_private_named.2, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedEntryView<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "feedEntryView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Minimal notebook context for feed display. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct FeedNotebookContext<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub path: std::option::Option>, + #[serde(borrow)] + pub title: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod feed_notebook_context_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Title; + type Uri; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Title = Unset; + type Uri = Unset; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Title = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Title = S::Title; + type Uri = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `title` field + pub struct title(()); + ///Marker type for the `uri` field + pub struct uri(()); + } +} + +/// Builder for constructing an instance of this type +pub struct FeedNotebookContextBuilder<'a, S: feed_notebook_context_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> FeedNotebookContext<'a> { + /// Create a new builder for this type + pub fn new() -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::Empty> { + FeedNotebookContextBuilder::new() + } +} + +impl<'a> FeedNotebookContextBuilder<'a, feed_notebook_context_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + FeedNotebookContextBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: feed_notebook_context_state::State> FeedNotebookContextBuilder<'a, S> { + /// Set the `path` field (optional) + pub fn path(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `path` field to an Option value (optional) + pub fn maybe_path(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> FeedNotebookContextBuilder<'a, S> +where + S: feed_notebook_context_state::State, + S::Title: feed_notebook_context_state::IsUnset, +{ + /// Set the `title` field (required) + pub fn title( + mut self, + value: impl Into>, + ) -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::SetTitle> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + FeedNotebookContextBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FeedNotebookContextBuilder<'a, S> +where + S: feed_notebook_context_state::State, + S::Uri: feed_notebook_context_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> FeedNotebookContextBuilder<'a, feed_notebook_context_state::SetUri> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + FeedNotebookContextBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> FeedNotebookContextBuilder<'a, S> +where + S: feed_notebook_context_state::State, + S::Title: feed_notebook_context_state::IsSet, + S::Uri: feed_notebook_context_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> FeedNotebookContext<'a> { + FeedNotebookContext { + path: self.__unsafe_private_named.0, + title: self.__unsafe_private_named.1.unwrap(), + uri: self.__unsafe_private_named.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> FeedNotebookContext<'a> { + FeedNotebookContext { + path: self.__unsafe_private_named.0, + title: self.__unsafe_private_named.1.unwrap(), + uri: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for FeedNotebookContext<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "feedNotebookContext" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +///Why this entry appeared in the feed. +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(tag = "$type")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum FeedReason<'a> { + #[serde(rename = "sh.weaver.notebook.defs#reasonLike")] + ReasonLike(Box>), + #[serde(rename = "sh.weaver.notebook.defs#reasonBookmark")] + ReasonBookmark(Box>), + #[serde(rename = "sh.weaver.notebook.defs#reasonSubscription")] + ReasonSubscription(Box>), +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct NotebookView<'a> { + #[serde(borrow)] + pub authors: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub bookmark_count: std::option::Option, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub entry_count: std::option::Option, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub like_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub path: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub permissions: std::option::Option>, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub subscriber_count: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub title: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer_bookmark: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer_like: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer_reading_progress: + std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewer_subscription: std::option::Option>, +} + +pub mod notebook_view_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Authors; + type Uri; + type IndexedAt; + type Cid; + type Record; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Authors = Unset; + type Uri = Unset; + type IndexedAt = Unset; + type Cid = Unset; + type Record = Unset; + } + ///State transition - sets the `authors` field to Set + pub struct SetAuthors(PhantomData S>); + impl sealed::Sealed for SetAuthors {} + impl State for SetAuthors { + type Authors = Set; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Record = S::Record; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Authors = S::Authors; + type Uri = Set; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Record = S::Record; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Authors = S::Authors; + type Uri = S::Uri; + type IndexedAt = Set; + type Cid = S::Cid; + type Record = S::Record; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Authors = S::Authors; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Cid = Set; + type Record = S::Record; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Authors = S::Authors; + type Uri = S::Uri; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Record = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `authors` field + pub struct authors(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `record` field + pub struct record(()); + } +} + +/// Builder for constructing an instance of this type +pub struct NotebookViewBuilder<'a, S: notebook_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> NotebookView<'a> { + /// Create a new builder for this type + pub fn new() -> NotebookViewBuilder<'a, notebook_view_state::Empty> { + NotebookViewBuilder::new() + } +} + +impl<'a> NotebookViewBuilder<'a, notebook_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + NotebookViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: ( + None, None, None, None, None, None, None, None, None, None, None, None, None, None, + None, None, None, + ), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotebookViewBuilder<'a, S> +where + S: notebook_view_state::State, + S::Authors: notebook_view_state::IsUnset, +{ + /// Set the `authors` field (required) + pub fn authors( + mut self, + value: impl Into>>, + ) -> NotebookViewBuilder<'a, notebook_view_state::SetAuthors> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + NotebookViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `bookmarkCount` field (optional) + pub fn bookmark_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `bookmarkCount` field to an Option value (optional) + pub fn maybe_bookmark_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> NotebookViewBuilder<'a, S> +where + S: notebook_view_state::State, + S::Cid: notebook_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> NotebookViewBuilder<'a, notebook_view_state::SetCid> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + NotebookViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `entryCount` field (optional) + pub fn entry_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `entryCount` field to an Option value (optional) + pub fn maybe_entry_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> NotebookViewBuilder<'a, S> +where + S: notebook_view_state::State, + S::IndexedAt: notebook_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> NotebookViewBuilder<'a, notebook_view_state::SetIndexedAt> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + NotebookViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `likeCount` field (optional) + pub fn like_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `likeCount` field to an Option value (optional) + pub fn maybe_like_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `path` field (optional) + pub fn path(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `path` field to an Option value (optional) + pub fn maybe_path(mut self, value: Option>) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `permissions` field (optional) + pub fn permissions( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.7 = value.into(); + self + } + /// Set the `permissions` field to an Option value (optional) + pub fn maybe_permissions( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.7 = value; + self + } +} + +impl<'a, S> NotebookViewBuilder<'a, S> +where + S: notebook_view_state::State, + S::Record: notebook_view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> NotebookViewBuilder<'a, notebook_view_state::SetRecord> { + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); + NotebookViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `subscriberCount` field (optional) + pub fn subscriber_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.9 = value.into(); + self + } + /// Set the `subscriberCount` field to an Option value (optional) + pub fn maybe_subscriber_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.9 = value; + self + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `tags` field (optional) + pub fn tags(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.10 = value.into(); + self + } + /// Set the `tags` field to an Option value (optional) + pub fn maybe_tags(mut self, value: Option>) -> Self { + self.__unsafe_private_named.10 = value; + self + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `title` field (optional) + pub fn title( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.11 = value.into(); + self + } + /// Set the `title` field to an Option value (optional) + pub fn maybe_title(mut self, value: Option>) -> Self { + self.__unsafe_private_named.11 = value; + self + } +} + +impl<'a, S> NotebookViewBuilder<'a, S> +where + S: notebook_view_state::State, + S::Uri: notebook_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> NotebookViewBuilder<'a, notebook_view_state::SetUri> { + self.__unsafe_private_named.12 = ::core::option::Option::Some(value.into()); + NotebookViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `viewerBookmark` field (optional) + pub fn viewer_bookmark( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.13 = value.into(); + self + } + /// Set the `viewerBookmark` field to an Option value (optional) + pub fn maybe_viewer_bookmark( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.13 = value; + self + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `viewerLike` field (optional) + pub fn viewer_like( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.14 = value.into(); + self + } + /// Set the `viewerLike` field to an Option value (optional) + pub fn maybe_viewer_like( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.14 = value; + self + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `viewerReadingProgress` field (optional) + pub fn viewer_reading_progress( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.15 = value.into(); + self + } + /// Set the `viewerReadingProgress` field to an Option value (optional) + pub fn maybe_viewer_reading_progress( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.15 = value; + self + } +} + +impl<'a, S: notebook_view_state::State> NotebookViewBuilder<'a, S> { + /// Set the `viewerSubscription` field (optional) + pub fn viewer_subscription( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.16 = value.into(); + self + } + /// Set the `viewerSubscription` field to an Option value (optional) + pub fn maybe_viewer_subscription( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.16 = value; + self + } +} + +impl<'a, S> NotebookViewBuilder<'a, S> +where + S: notebook_view_state::State, + S::Authors: notebook_view_state::IsSet, + S::Uri: notebook_view_state::IsSet, + S::IndexedAt: notebook_view_state::IsSet, + S::Cid: notebook_view_state::IsSet, + S::Record: notebook_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> NotebookView<'a> { + NotebookView { + authors: self.__unsafe_private_named.0.unwrap(), + bookmark_count: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + entry_count: self.__unsafe_private_named.3, + indexed_at: self.__unsafe_private_named.4.unwrap(), + like_count: self.__unsafe_private_named.5, + path: self.__unsafe_private_named.6, + permissions: self.__unsafe_private_named.7, + record: self.__unsafe_private_named.8.unwrap(), + subscriber_count: self.__unsafe_private_named.9, + tags: self.__unsafe_private_named.10, + title: self.__unsafe_private_named.11, + uri: self.__unsafe_private_named.12.unwrap(), + viewer_bookmark: self.__unsafe_private_named.13, + viewer_like: self.__unsafe_private_named.14, + viewer_reading_progress: self.__unsafe_private_named.15, + viewer_subscription: self.__unsafe_private_named.16, + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> NotebookView<'a> { + NotebookView { + authors: self.__unsafe_private_named.0.unwrap(), + bookmark_count: self.__unsafe_private_named.1, + cid: self.__unsafe_private_named.2.unwrap(), + entry_count: self.__unsafe_private_named.3, + indexed_at: self.__unsafe_private_named.4.unwrap(), + like_count: self.__unsafe_private_named.5, + path: self.__unsafe_private_named.6, + permissions: self.__unsafe_private_named.7, + record: self.__unsafe_private_named.8.unwrap(), + subscriber_count: self.__unsafe_private_named.9, + tags: self.__unsafe_private_named.10, + title: self.__unsafe_private_named.11, + uri: self.__unsafe_private_named.12.unwrap(), + viewer_bookmark: self.__unsafe_private_named.13, + viewer_like: self.__unsafe_private_named.14, + viewer_reading_progress: self.__unsafe_private_named.15, + viewer_subscription: self.__unsafe_private_named.16, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotebookView<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "notebookView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Hydrated view of a page (entries displayed together). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct PageView<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub entry_count: std::option::Option, + pub indexed_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub title: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod page_view_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Record; + type Cid; + type IndexedAt; + type Notebook; + type Uri; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Record = Unset; + type Cid = Unset; + type IndexedAt = Unset; + type Notebook = Unset; + type Uri = Unset; + } + ///State transition - sets the `record` field to Set + pub struct SetRecord(PhantomData S>); + impl sealed::Sealed for SetRecord {} + impl State for SetRecord { + type Record = Set; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; + type Uri = S::Uri; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Record = S::Record; + type Cid = Set; + type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; + type Uri = S::Uri; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Record = S::Record; + type Cid = S::Cid; + type IndexedAt = Set; + type Notebook = S::Notebook; + type Uri = S::Uri; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Record = S::Record; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Notebook = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Record = S::Record; + type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Notebook = S::Notebook; + type Uri = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `record` field + pub struct record(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `notebook` field + pub struct notebook(()); + ///Marker type for the `uri` field + pub struct uri(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PageViewBuilder<'a, S: page_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PageView<'a> { + /// Create a new builder for this type + pub fn new() -> PageViewBuilder<'a, page_view_state::Empty> { + PageViewBuilder::new() + } +} + +impl<'a> PageViewBuilder<'a, page_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PageViewBuilder<'a, S> +where + S: page_view_state::State, + S::Cid: page_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> PageViewBuilder<'a, page_view_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> { + /// Set the `entryCount` field (optional) + pub fn entry_count(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `entryCount` field to an Option value (optional) + pub fn maybe_entry_count(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> PageViewBuilder<'a, S> +where + S: page_view_state::State, + S::IndexedAt: page_view_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> PageViewBuilder<'a, page_view_state::SetIndexedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + PageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PageViewBuilder<'a, S> +where + S: page_view_state::State, + S::Notebook: page_view_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> PageViewBuilder<'a, page_view_state::SetNotebook> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + PageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PageViewBuilder<'a, S> +where + S: page_view_state::State, + S::Record: page_view_state::IsUnset, +{ + /// Set the `record` field (required) + pub fn record( + mut self, + value: impl Into>, + ) -> PageViewBuilder<'a, page_view_state::SetRecord> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + PageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> { + /// Set the `tags` field (optional) + pub fn tags(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `tags` field to an Option value (optional) + pub fn maybe_tags(mut self, value: Option>) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: page_view_state::State> PageViewBuilder<'a, S> { + /// Set the `title` field (optional) + pub fn title( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `title` field to an Option value (optional) + pub fn maybe_title(mut self, value: Option>) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> PageViewBuilder<'a, S> +where + S: page_view_state::State, + S::Uri: page_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> PageViewBuilder<'a, page_view_state::SetUri> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + PageViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PageViewBuilder<'a, S> +where + S: page_view_state::State, + S::Record: page_view_state::IsSet, + S::Cid: page_view_state::IsSet, + S::IndexedAt: page_view_state::IsSet, + S::Notebook: page_view_state::IsSet, + S::Uri: page_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PageView<'a> { + PageView { + cid: self.__unsafe_private_named.0.unwrap(), + entry_count: self.__unsafe_private_named.1, + indexed_at: self.__unsafe_private_named.2.unwrap(), + notebook: self.__unsafe_private_named.3.unwrap(), + record: self.__unsafe_private_named.4.unwrap(), + tags: self.__unsafe_private_named.5, + title: self.__unsafe_private_named.6, + uri: self.__unsafe_private_named.7.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> PageView<'a> { + PageView { + cid: self.__unsafe_private_named.0.unwrap(), + entry_count: self.__unsafe_private_named.1, + indexed_at: self.__unsafe_private_named.2.unwrap(), + notebook: self.__unsafe_private_named.3.unwrap(), + record: self.__unsafe_private_named.4.unwrap(), + tags: self.__unsafe_private_named.5, + title: self.__unsafe_private_named.6, + uri: self.__unsafe_private_named.7.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PageView<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "pageView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// The path of the notebook. +pub type Path<'a> = jacquard_common::CowStr<'a>; +/// A single permission grant. For resource authority: source=resource URI, grantedAt=createdAt. For invitees: source=invite URI, grantedAt=accept createdAt. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct PermissionGrant<'a> { + #[serde(borrow)] + pub did: jacquard_common::types::string::Did<'a>, + /// For authority: record createdAt. For invitees: accept createdAt + pub granted_at: jacquard_common::types::string::Datetime, + /// direct = this resource (includes authority), inherited = via notebook invite + #[serde(borrow)] + pub scope: jacquard_common::CowStr<'a>, + /// For authority: resource URI. For invitees: invite URI + #[serde(borrow)] + pub source: jacquard_common::types::string::AtUri<'a>, +} + +pub mod permission_grant_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Source; + type Did; + type Scope; + type GrantedAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Source = Unset; + type Did = Unset; + type Scope = Unset; + type GrantedAt = Unset; + } + ///State transition - sets the `source` field to Set + pub struct SetSource(PhantomData S>); + impl sealed::Sealed for SetSource {} + impl State for SetSource { + type Source = Set; + type Did = S::Did; + type Scope = S::Scope; + type GrantedAt = S::GrantedAt; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Source = S::Source; + type Did = Set; + type Scope = S::Scope; + type GrantedAt = S::GrantedAt; + } + ///State transition - sets the `scope` field to Set + pub struct SetScope(PhantomData S>); + impl sealed::Sealed for SetScope {} + impl State for SetScope { + type Source = S::Source; + type Did = S::Did; + type Scope = Set; + type GrantedAt = S::GrantedAt; + } + ///State transition - sets the `granted_at` field to Set + pub struct SetGrantedAt(PhantomData S>); + impl sealed::Sealed for SetGrantedAt {} + impl State for SetGrantedAt { + type Source = S::Source; + type Did = S::Did; + type Scope = S::Scope; + type GrantedAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `source` field + pub struct source(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `scope` field + pub struct scope(()); + ///Marker type for the `granted_at` field + pub struct granted_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PermissionGrantBuilder<'a, S: permission_grant_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PermissionGrant<'a> { + /// Create a new builder for this type + pub fn new() -> PermissionGrantBuilder<'a, permission_grant_state::Empty> { + PermissionGrantBuilder::new() + } +} + +impl<'a> PermissionGrantBuilder<'a, permission_grant_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PermissionGrantBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PermissionGrantBuilder<'a, S> +where + S: permission_grant_state::State, + S::Did: permission_grant_state::IsUnset, +{ + /// Set the `did` field (required) + pub fn did( + mut self, + value: impl Into>, + ) -> PermissionGrantBuilder<'a, permission_grant_state::SetDid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PermissionGrantBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PermissionGrantBuilder<'a, S> +where + S: permission_grant_state::State, + S::GrantedAt: permission_grant_state::IsUnset, +{ + /// Set the `grantedAt` field (required) + pub fn granted_at( + mut self, + value: impl Into, + ) -> PermissionGrantBuilder<'a, permission_grant_state::SetGrantedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + PermissionGrantBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PermissionGrantBuilder<'a, S> +where + S: permission_grant_state::State, + S::Scope: permission_grant_state::IsUnset, +{ + /// Set the `scope` field (required) + pub fn scope( + mut self, + value: impl Into>, + ) -> PermissionGrantBuilder<'a, permission_grant_state::SetScope> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + PermissionGrantBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PermissionGrantBuilder<'a, S> +where + S: permission_grant_state::State, + S::Source: permission_grant_state::IsUnset, +{ + /// Set the `source` field (required) + pub fn source( + mut self, + value: impl Into>, + ) -> PermissionGrantBuilder<'a, permission_grant_state::SetSource> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + PermissionGrantBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PermissionGrantBuilder<'a, S> +where + S: permission_grant_state::State, + S::Source: permission_grant_state::IsSet, + S::Did: permission_grant_state::IsSet, + S::Scope: permission_grant_state::IsSet, + S::GrantedAt: permission_grant_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PermissionGrant<'a> { + PermissionGrant { + did: self.__unsafe_private_named.0.unwrap(), + granted_at: self.__unsafe_private_named.1.unwrap(), + scope: self.__unsafe_private_named.2.unwrap(), + source: self.__unsafe_private_named.3.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> PermissionGrant<'a> { + PermissionGrant { + did: self.__unsafe_private_named.0.unwrap(), + granted_at: self.__unsafe_private_named.1.unwrap(), + scope: self.__unsafe_private_named.2.unwrap(), + source: self.__unsafe_private_named.3.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionGrant<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "permissionGrant" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// ACL-style permissions for a resource. Separate from authors (who contributed). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct PermissionsState<'a> { + /// DIDs that can edit this resource + #[serde(borrow)] + pub editors: Vec>, + /// DIDs that can view (future use) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub viewers: std::option::Option>>, +} + +pub mod permissions_state_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Editors; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Editors = Unset; + } + ///State transition - sets the `editors` field to Set + pub struct SetEditors(PhantomData S>); + impl sealed::Sealed for SetEditors {} + impl State for SetEditors { + type Editors = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `editors` field + pub struct editors(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PermissionsStateBuilder<'a, S: permissions_state_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PermissionsState<'a> { + /// Create a new builder for this type + pub fn new() -> PermissionsStateBuilder<'a, permissions_state_state::Empty> { + PermissionsStateBuilder::new() + } +} + +impl<'a> PermissionsStateBuilder<'a, permissions_state_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PermissionsStateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PermissionsStateBuilder<'a, S> +where + S: permissions_state_state::State, + S::Editors: permissions_state_state::IsUnset, +{ + /// Set the `editors` field (required) + pub fn editors( + mut self, + value: impl Into>>, + ) -> PermissionsStateBuilder<'a, permissions_state_state::SetEditors> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PermissionsStateBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: permissions_state_state::State> PermissionsStateBuilder<'a, S> { + /// Set the `viewers` field (optional) + pub fn viewers( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `viewers` field to an Option value (optional) + pub fn maybe_viewers( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> PermissionsStateBuilder<'a, S> +where + S: permissions_state_state::State, + S::Editors: permissions_state_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PermissionsState<'a> { + PermissionsState { + editors: self.__unsafe_private_named.0.unwrap(), + viewers: self.__unsafe_private_named.1, + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> PermissionsState<'a> { + PermissionsState { + editors: self.__unsafe_private_named.0.unwrap(), + viewers: self.__unsafe_private_named.1, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionsState<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "permissionsState" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// A published version of an entry in a collaborator's repo. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct PublishedVersionView<'a> { + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + /// If content differs, the version it diverged from + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub diverged_from: std::option::Option>, + /// True if this is the 'primary' version (owner's repo) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub is_canonical: std::option::Option, + pub published_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub publisher: crate::sh_weaver::actor::ProfileViewBasic<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub updated_at: std::option::Option, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod published_version_view_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Publisher; + type PublishedAt; + type Uri; + type Cid; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Publisher = Unset; + type PublishedAt = Unset; + type Uri = Unset; + type Cid = Unset; + } + ///State transition - sets the `publisher` field to Set + pub struct SetPublisher(PhantomData S>); + impl sealed::Sealed for SetPublisher {} + impl State for SetPublisher { + type Publisher = Set; + type PublishedAt = S::PublishedAt; + type Uri = S::Uri; + type Cid = S::Cid; + } + ///State transition - sets the `published_at` field to Set + pub struct SetPublishedAt(PhantomData S>); + impl sealed::Sealed for SetPublishedAt {} + impl State for SetPublishedAt { + type Publisher = S::Publisher; + type PublishedAt = Set; + type Uri = S::Uri; + type Cid = S::Cid; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Publisher = S::Publisher; + type PublishedAt = S::PublishedAt; + type Uri = Set; + type Cid = S::Cid; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Publisher = S::Publisher; + type PublishedAt = S::PublishedAt; + type Uri = S::Uri; + type Cid = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `publisher` field + pub struct publisher(()); + ///Marker type for the `published_at` field + pub struct published_at(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `cid` field + pub struct cid(()); + } +} + +/// Builder for constructing an instance of this type +pub struct PublishedVersionViewBuilder<'a, S: published_version_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> PublishedVersionView<'a> { + /// Create a new builder for this type + pub fn new() -> PublishedVersionViewBuilder<'a, published_version_view_state::Empty> { + PublishedVersionViewBuilder::new() + } +} + +impl<'a> PublishedVersionViewBuilder<'a, published_version_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + PublishedVersionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublishedVersionViewBuilder<'a, S> +where + S: published_version_view_state::State, + S::Cid: published_version_view_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetCid> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + PublishedVersionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> { + /// Set the `divergedFrom` field (optional) + pub fn diverged_from( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `divergedFrom` field to an Option value (optional) + pub fn maybe_diverged_from( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> { + /// Set the `isCanonical` field (optional) + pub fn is_canonical(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `isCanonical` field to an Option value (optional) + pub fn maybe_is_canonical(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> PublishedVersionViewBuilder<'a, S> +where + S: published_version_view_state::State, + S::PublishedAt: published_version_view_state::IsUnset, +{ + /// Set the `publishedAt` field (required) + pub fn published_at( + mut self, + value: impl Into, + ) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetPublishedAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + PublishedVersionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublishedVersionViewBuilder<'a, S> +where + S: published_version_view_state::State, + S::Publisher: published_version_view_state::IsUnset, +{ + /// Set the `publisher` field (required) + pub fn publisher( + mut self, + value: impl Into>, + ) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetPublisher> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + PublishedVersionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: published_version_view_state::State> PublishedVersionViewBuilder<'a, S> { + /// Set the `updatedAt` field (optional) + pub fn updated_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `updatedAt` field to an Option value (optional) + pub fn maybe_updated_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S> PublishedVersionViewBuilder<'a, S> +where + S: published_version_view_state::State, + S::Uri: published_version_view_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> PublishedVersionViewBuilder<'a, published_version_view_state::SetUri> { + self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + PublishedVersionViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> PublishedVersionViewBuilder<'a, S> +where + S: published_version_view_state::State, + S::Publisher: published_version_view_state::IsSet, + S::PublishedAt: published_version_view_state::IsSet, + S::Uri: published_version_view_state::IsSet, + S::Cid: published_version_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> PublishedVersionView<'a> { + PublishedVersionView { + cid: self.__unsafe_private_named.0.unwrap(), + diverged_from: self.__unsafe_private_named.1, + is_canonical: self.__unsafe_private_named.2, + published_at: self.__unsafe_private_named.3.unwrap(), + publisher: self.__unsafe_private_named.4.unwrap(), + updated_at: self.__unsafe_private_named.5, + uri: self.__unsafe_private_named.6.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> PublishedVersionView<'a> { + PublishedVersionView { + cid: self.__unsafe_private_named.0.unwrap(), + diverged_from: self.__unsafe_private_named.1, + is_canonical: self.__unsafe_private_named.2, + published_at: self.__unsafe_private_named.3.unwrap(), + publisher: self.__unsafe_private_named.4.unwrap(), + updated_at: self.__unsafe_private_named.5, + uri: self.__unsafe_private_named.6.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PublishedVersionView<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "publishedVersionView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Viewer's reading progress (appview-side state, not a record). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default, +)] +#[serde(rename_all = "camelCase")] +pub struct ReadingProgress<'a> { + /// Last entry the viewer was reading. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub current_entry: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub finished_at: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub last_read_at: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub percent_complete: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub started_at: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: std::option::Option>, +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReadingProgress<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "readingProgress" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + if let Some(ref value) = self.percent_complete { + if *value > 100i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Maximum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "percent_complete", + ), + max: 100i64, + actual: *value, + }); + } + } + if let Some(ref value) = self.percent_complete { + if *value < 0i64 { + return Err(::jacquard_lexicon::validation::ConstraintError::Minimum { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "percent_complete", + ), + min: 0i64, + actual: *value, + }); + } + } + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct ReasonBookmark<'a> { + #[serde(borrow)] + pub by: crate::sh_weaver::actor::ProfileViewBasic<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, +} + +pub mod reason_bookmark_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type IndexedAt; + type By; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type IndexedAt = Unset; + type By = Unset; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; + type By = S::By; + } + ///State transition - sets the `by` field to Set + pub struct SetBy(PhantomData S>); + impl sealed::Sealed for SetBy {} + impl State for SetBy { + type IndexedAt = S::IndexedAt; + type By = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `by` field + pub struct by(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ReasonBookmarkBuilder<'a, S: reason_bookmark_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ReasonBookmark<'a> { + /// Create a new builder for this type + pub fn new() -> ReasonBookmarkBuilder<'a, reason_bookmark_state::Empty> { + ReasonBookmarkBuilder::new() + } +} + +impl<'a> ReasonBookmarkBuilder<'a, reason_bookmark_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ReasonBookmarkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReasonBookmarkBuilder<'a, S> +where + S: reason_bookmark_state::State, + S::By: reason_bookmark_state::IsUnset, +{ + /// Set the `by` field (required) + pub fn by( + mut self, + value: impl Into>, + ) -> ReasonBookmarkBuilder<'a, reason_bookmark_state::SetBy> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ReasonBookmarkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReasonBookmarkBuilder<'a, S> +where + S: reason_bookmark_state::State, + S::IndexedAt: reason_bookmark_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> ReasonBookmarkBuilder<'a, reason_bookmark_state::SetIndexedAt> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ReasonBookmarkBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReasonBookmarkBuilder<'a, S> +where + S: reason_bookmark_state::State, + S::IndexedAt: reason_bookmark_state::IsSet, + S::By: reason_bookmark_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ReasonBookmark<'a> { + ReasonBookmark { + by: self.__unsafe_private_named.0.unwrap(), + indexed_at: self.__unsafe_private_named.1.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> ReasonBookmark<'a> { + ReasonBookmark { + by: self.__unsafe_private_named.0.unwrap(), + indexed_at: self.__unsafe_private_named.1.unwrap(), + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonBookmark<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.defs" + } + fn def_name() -> &'static str { + "reasonBookmark" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, )] #[serde(rename_all = "camelCase")] -pub struct PermissionGrant<'a> { +pub struct ReasonLike<'a> { #[serde(borrow)] - pub did: jacquard_common::types::string::Did<'a>, - /// For authority: record createdAt. For invitees: accept createdAt - pub granted_at: jacquard_common::types::string::Datetime, - /// direct = this resource (includes authority), inherited = via notebook invite - #[serde(borrow)] - pub scope: jacquard_common::CowStr<'a>, - /// For authority: resource URI. For invitees: invite URI - #[serde(borrow)] - pub source: jacquard_common::types::string::AtUri<'a>, + pub by: crate::sh_weaver::actor::ProfileViewBasic<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, } -pub mod permission_grant_state { +pub mod reason_like_state { - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -2198,112 +6096,80 @@ pub mod permission_grant_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Scope; - type Did; - type Source; - type GrantedAt; + type IndexedAt; + type By; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Scope = Unset; - type Did = Unset; - type Source = Unset; - type GrantedAt = Unset; - } - ///State transition - sets the `scope` field to Set - pub struct SetScope(PhantomData S>); - impl sealed::Sealed for SetScope {} - impl State for SetScope { - type Scope = Set; - type Did = S::Did; - type Source = S::Source; - type GrantedAt = S::GrantedAt; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Scope = S::Scope; - type Did = Set; - type Source = S::Source; - type GrantedAt = S::GrantedAt; + type IndexedAt = Unset; + type By = Unset; } - ///State transition - sets the `source` field to Set - pub struct SetSource(PhantomData S>); - impl sealed::Sealed for SetSource {} - impl State for SetSource { - type Scope = S::Scope; - type Did = S::Did; - type Source = Set; - type GrantedAt = S::GrantedAt; + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; + type By = S::By; } - ///State transition - sets the `granted_at` field to Set - pub struct SetGrantedAt(PhantomData S>); - impl sealed::Sealed for SetGrantedAt {} - impl State for SetGrantedAt { - type Scope = S::Scope; - type Did = S::Did; - type Source = S::Source; - type GrantedAt = Set; + ///State transition - sets the `by` field to Set + pub struct SetBy(PhantomData S>); + impl sealed::Sealed for SetBy {} + impl State for SetBy { + type IndexedAt = S::IndexedAt; + type By = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `scope` field - pub struct scope(()); - ///Marker type for the `did` field - pub struct did(()); - ///Marker type for the `source` field - pub struct source(()); - ///Marker type for the `granted_at` field - pub struct granted_at(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `by` field + pub struct by(()); } } /// Builder for constructing an instance of this type -pub struct PermissionGrantBuilder<'a, S: permission_grant_state::State> { +pub struct ReasonLikeBuilder<'a, S: reason_like_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( - ::core::option::Option>, + ::core::option::Option>, ::core::option::Option, - ::core::option::Option>, - ::core::option::Option>, ), _phantom: ::core::marker::PhantomData<&'a ()>, } -impl<'a> PermissionGrant<'a> { +impl<'a> ReasonLike<'a> { /// Create a new builder for this type - pub fn new() -> PermissionGrantBuilder<'a, permission_grant_state::Empty> { - PermissionGrantBuilder::new() + pub fn new() -> ReasonLikeBuilder<'a, reason_like_state::Empty> { + ReasonLikeBuilder::new() } } -impl<'a> PermissionGrantBuilder<'a, permission_grant_state::Empty> { +impl<'a> ReasonLikeBuilder<'a, reason_like_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { - PermissionGrantBuilder { + ReasonLikeBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None, None, None, None), + __unsafe_private_named: (None, None), _phantom: ::core::marker::PhantomData, } } } -impl<'a, S> PermissionGrantBuilder<'a, S> +impl<'a, S> ReasonLikeBuilder<'a, S> where - S: permission_grant_state::State, - S::Did: permission_grant_state::IsUnset, + S: reason_like_state::State, + S::By: reason_like_state::IsUnset, { - /// Set the `did` field (required) - pub fn did( + /// Set the `by` field (required) + pub fn by( mut self, - value: impl Into>, - ) -> PermissionGrantBuilder<'a, permission_grant_state::SetDid> { + value: impl Into>, + ) -> ReasonLikeBuilder<'a, reason_like_state::SetBy> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); - PermissionGrantBuilder { + ReasonLikeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, @@ -2311,37 +6177,18 @@ where } } -impl<'a, S> PermissionGrantBuilder<'a, S> +impl<'a, S> ReasonLikeBuilder<'a, S> where - S: permission_grant_state::State, - S::GrantedAt: permission_grant_state::IsUnset, + S: reason_like_state::State, + S::IndexedAt: reason_like_state::IsUnset, { - /// Set the `grantedAt` field (required) - pub fn granted_at( + /// Set the `indexedAt` field (required) + pub fn indexed_at( mut self, value: impl Into, - ) -> PermissionGrantBuilder<'a, permission_grant_state::SetGrantedAt> { + ) -> ReasonLikeBuilder<'a, reason_like_state::SetIndexedAt> { self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); - PermissionGrantBuilder { - _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: self.__unsafe_private_named, - _phantom: ::core::marker::PhantomData, - } - } -} - -impl<'a, S> PermissionGrantBuilder<'a, S> -where - S: permission_grant_state::State, - S::Scope: permission_grant_state::IsUnset, -{ - /// Set the `scope` field (required) - pub fn scope( - mut self, - value: impl Into>, - ) -> PermissionGrantBuilder<'a, permission_grant_state::SetScope> { - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); - PermissionGrantBuilder { + ReasonLikeBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, @@ -2349,40 +6196,17 @@ where } } -impl<'a, S> PermissionGrantBuilder<'a, S> +impl<'a, S> ReasonLikeBuilder<'a, S> where - S: permission_grant_state::State, - S::Source: permission_grant_state::IsUnset, -{ - /// Set the `source` field (required) - pub fn source( - mut self, - value: impl Into>, - ) -> PermissionGrantBuilder<'a, permission_grant_state::SetSource> { - self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); - PermissionGrantBuilder { - _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: self.__unsafe_private_named, - _phantom: ::core::marker::PhantomData, - } - } -} - -impl<'a, S> PermissionGrantBuilder<'a, S> -where - S: permission_grant_state::State, - S::Scope: permission_grant_state::IsSet, - S::Did: permission_grant_state::IsSet, - S::Source: permission_grant_state::IsSet, - S::GrantedAt: permission_grant_state::IsSet, + S: reason_like_state::State, + S::IndexedAt: reason_like_state::IsSet, + S::By: reason_like_state::IsSet, { /// Build the final struct - pub fn build(self) -> PermissionGrant<'a> { - PermissionGrant { - did: self.__unsafe_private_named.0.unwrap(), - granted_at: self.__unsafe_private_named.1.unwrap(), - scope: self.__unsafe_private_named.2.unwrap(), - source: self.__unsafe_private_named.3.unwrap(), + pub fn build(self) -> ReasonLike<'a> { + ReasonLike { + by: self.__unsafe_private_named.0.unwrap(), + indexed_at: self.__unsafe_private_named.1.unwrap(), extra_data: Default::default(), } } @@ -2393,23 +6217,21 @@ where jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, - ) -> PermissionGrant<'a> { - PermissionGrant { - did: self.__unsafe_private_named.0.unwrap(), - granted_at: self.__unsafe_private_named.1.unwrap(), - scope: self.__unsafe_private_named.2.unwrap(), - source: self.__unsafe_private_named.3.unwrap(), + ) -> ReasonLike<'a> { + ReasonLike { + by: self.__unsafe_private_named.0.unwrap(), + indexed_at: self.__unsafe_private_named.1.unwrap(), extra_data: Some(extra_data), } } } -impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionGrant<'a> { +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonLike<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { - "permissionGrant" + "reasonLike" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() @@ -2421,33 +6243,18 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionGrant<'a> { } } -/// ACL-style permissions for a resource. Separate from authors (who contributed). #[jacquard_derive::lexicon] #[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, )] #[serde(rename_all = "camelCase")] -pub struct PermissionsState<'a> { - /// DIDs that can edit this resource - #[serde(borrow)] - pub editors: Vec>, - /// DIDs that can view (future use) - #[serde(skip_serializing_if = "std::option::Option::is_none")] - #[serde(borrow)] - pub viewers: std::option::Option< - Vec>, - >, +pub struct ReasonSubscription<'a> { + pub indexed_at: jacquard_common::types::string::Datetime, } -pub mod permissions_state_state { +pub mod reason_subscription_state { - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -2455,68 +6262,65 @@ pub mod permissions_state_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Editors; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Editors = Unset; + type IndexedAt = Unset; } - ///State transition - sets the `editors` field to Set - pub struct SetEditors(PhantomData S>); - impl sealed::Sealed for SetEditors {} - impl State for SetEditors { - type Editors = Set; + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `editors` field - pub struct editors(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } /// Builder for constructing an instance of this type -pub struct PermissionsStateBuilder<'a, S: permissions_state_state::State> { +pub struct ReasonSubscriptionBuilder<'a, S: reason_subscription_state::State> { _phantom_state: ::core::marker::PhantomData S>, - __unsafe_private_named: ( - ::core::option::Option>>, - ::core::option::Option>>, - ), + __unsafe_private_named: (::core::option::Option,), _phantom: ::core::marker::PhantomData<&'a ()>, } -impl<'a> PermissionsState<'a> { +impl<'a> ReasonSubscription<'a> { /// Create a new builder for this type - pub fn new() -> PermissionsStateBuilder<'a, permissions_state_state::Empty> { - PermissionsStateBuilder::new() + pub fn new() -> ReasonSubscriptionBuilder<'a, reason_subscription_state::Empty> { + ReasonSubscriptionBuilder::new() } } -impl<'a> PermissionsStateBuilder<'a, permissions_state_state::Empty> { +impl<'a> ReasonSubscriptionBuilder<'a, reason_subscription_state::Empty> { /// Create a new builder with all fields unset pub fn new() -> Self { - PermissionsStateBuilder { + ReasonSubscriptionBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None, None), + __unsafe_private_named: (None,), _phantom: ::core::marker::PhantomData, } } } -impl<'a, S> PermissionsStateBuilder<'a, S> +impl<'a, S> ReasonSubscriptionBuilder<'a, S> where - S: permissions_state_state::State, - S::Editors: permissions_state_state::IsUnset, + S: reason_subscription_state::State, + S::IndexedAt: reason_subscription_state::IsUnset, { - /// Set the `editors` field (required) - pub fn editors( + /// Set the `indexedAt` field (required) + pub fn indexed_at( mut self, - value: impl Into>>, - ) -> PermissionsStateBuilder<'a, permissions_state_state::SetEditors> { + value: impl Into, + ) -> ReasonSubscriptionBuilder<'a, reason_subscription_state::SetIndexedAt> { self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); - PermissionsStateBuilder { + ReasonSubscriptionBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, _phantom: ::core::marker::PhantomData, @@ -2524,35 +6328,15 @@ where } } -impl<'a, S: permissions_state_state::State> PermissionsStateBuilder<'a, S> { - /// Set the `viewers` field (optional) - pub fn viewers( - mut self, - value: impl Into>>>, - ) -> Self { - self.__unsafe_private_named.1 = value.into(); - self - } - /// Set the `viewers` field to an Option value (optional) - pub fn maybe_viewers( - mut self, - value: Option>>, - ) -> Self { - self.__unsafe_private_named.1 = value; - self - } -} - -impl<'a, S> PermissionsStateBuilder<'a, S> +impl<'a, S> ReasonSubscriptionBuilder<'a, S> where - S: permissions_state_state::State, - S::Editors: permissions_state_state::IsSet, + S: reason_subscription_state::State, + S::IndexedAt: reason_subscription_state::IsSet, { /// Build the final struct - pub fn build(self) -> PermissionsState<'a> { - PermissionsState { - editors: self.__unsafe_private_named.0.unwrap(), - viewers: self.__unsafe_private_named.1, + pub fn build(self) -> ReasonSubscription<'a> { + ReasonSubscription { + indexed_at: self.__unsafe_private_named.0.unwrap(), extra_data: Default::default(), } } @@ -2563,21 +6347,20 @@ where jacquard_common::smol_str::SmolStr, jacquard_common::types::value::Data<'a>, >, - ) -> PermissionsState<'a> { - PermissionsState { - editors: self.__unsafe_private_named.0.unwrap(), - viewers: self.__unsafe_private_named.1, + ) -> ReasonSubscription<'a> { + ReasonSubscription { + indexed_at: self.__unsafe_private_named.0.unwrap(), extra_data: Some(extra_data), } } } -impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionsState<'a> { +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReasonSubscription<'a> { fn nsid() -> &'static str { "sh.weaver.notebook.defs" } fn def_name() -> &'static str { - "permissionsState" + "reasonSubscription" } fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { lexicon_doc_sh_weaver_notebook_defs() @@ -2592,13 +6375,7 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for PermissionsState<'a> { /// View of a rendered and cached notebook entry #[jacquard_derive::lexicon] #[derive( - serde::Serialize, - serde::Deserialize, - Debug, - Clone, - PartialEq, - Eq, - jacquard_derive::IntoStatic + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, )] #[serde(rename_all = "camelCase")] pub struct RenderedView<'a> { @@ -2611,7 +6388,7 @@ pub struct RenderedView<'a> { pub mod rendered_view_state { - pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; #[allow(unused)] use ::core::marker::PhantomData; mod sealed { @@ -2679,10 +6456,7 @@ impl<'a, S: rendered_view_state::State> RenderedViewBuilder<'a, S> { self } /// Set the `css` field to an Option value (optional) - pub fn maybe_css( - mut self, - value: Option>, - ) -> Self { + pub fn maybe_css(mut self, value: Option>) -> Self { self.__unsafe_private_named.0 = value; self } @@ -2756,4 +6530,4 @@ impl<'a> ::jacquard_lexicon::schema::LexiconSchema for RenderedView<'a> { /// An array of tags associated with the notebook entry. Tags can help categorize and organize entries. pub type Tags<'a> = Vec>; /// The title of the notebook entry. -pub type Title<'a> = jacquard_common::CowStr<'a>; \ No newline at end of file +pub type Title<'a> = jacquard_common::CowStr<'a>; diff --git a/crates/weaver-api/src/sh_weaver/notebook/book.rs b/crates/weaver-api/src/sh_weaver/notebook/book.rs index db8537a..979ac9e 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/book.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/book.rs @@ -20,6 +20,11 @@ pub struct Book<'a> { #[serde(borrow)] pub authors: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub content_warnings: std::option::Option< + crate::sh_weaver::notebook::ContentWarnings<'a>, + >, /// Client-declared timestamp when this was originally created. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub created_at: std::option::Option, @@ -28,6 +33,12 @@ pub struct Book<'a> { #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub path: std::option::Option>, + /// Notebook opts into accessiblity by path only without identity scoping. Path must be globally unique. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub publish_global: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub rating: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] pub tags: std::option::Option>, @@ -91,9 +102,12 @@ pub struct BookBuilder<'a, S: book_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, + ::core::option::Option>, ::core::option::Option, ::core::option::Option>>, ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, @@ -114,7 +128,19 @@ impl<'a> BookBuilder<'a, book_state::Empty> { pub fn new() -> Self { BookBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None, None, None, None, None, None, None, None), + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), _phantom: ::core::marker::PhantomData, } } @@ -139,13 +165,32 @@ where } } +impl<'a, S: book_state::State> BookBuilder<'a, S> { + /// Set the `contentWarnings` field (optional) + pub fn content_warnings( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `contentWarnings` field to an Option value (optional) + pub fn maybe_content_warnings( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + impl<'a, S: book_state::State> BookBuilder<'a, S> { /// Set the `createdAt` field (optional) pub fn created_at( mut self, value: impl Into>, ) -> Self { - self.__unsafe_private_named.1 = value.into(); + self.__unsafe_private_named.2 = value.into(); self } /// Set the `createdAt` field to an Option value (optional) @@ -153,7 +198,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: Option, ) -> Self { - self.__unsafe_private_named.1 = value; + self.__unsafe_private_named.2 = value; self } } @@ -168,7 +213,7 @@ where mut self, value: impl Into>>, ) -> BookBuilder<'a, book_state::SetEntryList> { - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); BookBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, @@ -183,7 +228,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.3 = value.into(); + self.__unsafe_private_named.4 = value.into(); self } /// Set the `path` field to an Option value (optional) @@ -191,7 +236,39 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: Option>, ) -> Self { - self.__unsafe_private_named.3 = value; + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S: book_state::State> BookBuilder<'a, S> { + /// Set the `publishGlobal` field (optional) + pub fn publish_global(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `publishGlobal` field to an Option value (optional) + pub fn maybe_publish_global(mut self, value: Option) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: book_state::State> BookBuilder<'a, S> { + /// Set the `rating` field (optional) + pub fn rating( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `rating` field to an Option value (optional) + pub fn maybe_rating( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; self } } @@ -202,7 +279,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.4 = value.into(); + self.__unsafe_private_named.7 = value.into(); self } /// Set the `tags` field to an Option value (optional) @@ -210,7 +287,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: Option>, ) -> Self { - self.__unsafe_private_named.4 = value; + self.__unsafe_private_named.7 = value; self } } @@ -221,7 +298,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.5 = value.into(); + self.__unsafe_private_named.8 = value.into(); self } /// Set the `theme` field to an Option value (optional) @@ -229,7 +306,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: Option>, ) -> Self { - self.__unsafe_private_named.5 = value; + self.__unsafe_private_named.8 = value; self } } @@ -240,7 +317,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.6 = value.into(); + self.__unsafe_private_named.9 = value.into(); self } /// Set the `title` field to an Option value (optional) @@ -248,7 +325,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: Option>, ) -> Self { - self.__unsafe_private_named.6 = value; + self.__unsafe_private_named.9 = value; self } } @@ -259,7 +336,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: impl Into>, ) -> Self { - self.__unsafe_private_named.7 = value.into(); + self.__unsafe_private_named.10 = value.into(); self } /// Set the `updatedAt` field to an Option value (optional) @@ -267,7 +344,7 @@ impl<'a, S: book_state::State> BookBuilder<'a, S> { mut self, value: Option, ) -> Self { - self.__unsafe_private_named.7 = value; + self.__unsafe_private_named.10 = value; self } } @@ -282,13 +359,16 @@ where pub fn build(self) -> Book<'a> { Book { authors: self.__unsafe_private_named.0.unwrap(), - created_at: self.__unsafe_private_named.1, - entry_list: self.__unsafe_private_named.2.unwrap(), - path: self.__unsafe_private_named.3, - tags: self.__unsafe_private_named.4, - theme: self.__unsafe_private_named.5, - title: self.__unsafe_private_named.6, - updated_at: self.__unsafe_private_named.7, + content_warnings: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + entry_list: self.__unsafe_private_named.3.unwrap(), + path: self.__unsafe_private_named.4, + publish_global: self.__unsafe_private_named.5, + rating: self.__unsafe_private_named.6, + tags: self.__unsafe_private_named.7, + theme: self.__unsafe_private_named.8, + title: self.__unsafe_private_named.9, + updated_at: self.__unsafe_private_named.10, extra_data: Default::default(), } } @@ -302,13 +382,16 @@ where ) -> Book<'a> { Book { authors: self.__unsafe_private_named.0.unwrap(), - created_at: self.__unsafe_private_named.1, - entry_list: self.__unsafe_private_named.2.unwrap(), - path: self.__unsafe_private_named.3, - tags: self.__unsafe_private_named.4, - theme: self.__unsafe_private_named.5, - title: self.__unsafe_private_named.6, - updated_at: self.__unsafe_private_named.7, + content_warnings: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + entry_list: self.__unsafe_private_named.3.unwrap(), + path: self.__unsafe_private_named.4, + publish_global: self.__unsafe_private_named.5, + rating: self.__unsafe_private_named.6, + tags: self.__unsafe_private_named.7, + theme: self.__unsafe_private_named.8, + title: self.__unsafe_private_named.9, + updated_at: self.__unsafe_private_named.10, extra_data: Some(extra_data), } } @@ -437,6 +520,17 @@ fn lexicon_doc_sh_weaver_notebook_book() -> ::jacquard_lexicon::lexicon::Lexicon max_length: None, }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "contentWarnings", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#contentWarnings", + ), + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "createdAt", @@ -485,6 +579,25 @@ fn lexicon_doc_sh_weaver_notebook_book() -> ::jacquard_lexicon::lexicon::Lexicon ), }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "publishGlobal", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rating"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#contentRating", + ), + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tags"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { diff --git a/crates/weaver-api/src/sh_weaver/notebook/chapter.rs b/crates/weaver-api/src/sh_weaver/notebook/chapter.rs index c2c69df..8583f0f 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/chapter.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/chapter.rs @@ -20,6 +20,11 @@ pub struct Chapter<'a> { #[serde(borrow)] pub authors: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub content_warnings: std::option::Option< + crate::sh_weaver::notebook::ContentWarnings<'a>, + >, /// Client-declared timestamp when this was originally created. #[serde(skip_serializing_if = "std::option::Option::is_none")] pub created_at: std::option::Option, @@ -30,6 +35,9 @@ pub struct Chapter<'a> { pub notebook: crate::com_atproto::repo::strong_ref::StrongRef<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] + pub rating: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] pub tags: std::option::Option>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] @@ -46,49 +54,49 @@ pub mod chapter_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Notebook; type Authors; + type Notebook; type EntryList; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Notebook = Unset; type Authors = Unset; + type Notebook = Unset; type EntryList = Unset; } - ///State transition - sets the `notebook` field to Set - pub struct SetNotebook(PhantomData S>); - impl sealed::Sealed for SetNotebook {} - impl State for SetNotebook { - type Notebook = Set; - type Authors = S::Authors; - type EntryList = S::EntryList; - } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { - type Notebook = S::Notebook; type Authors = Set; + type Notebook = S::Notebook; + type EntryList = S::EntryList; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Authors = S::Authors; + type Notebook = Set; type EntryList = S::EntryList; } ///State transition - sets the `entry_list` field to Set pub struct SetEntryList(PhantomData S>); impl sealed::Sealed for SetEntryList {} impl State for SetEntryList { - type Notebook = S::Notebook; type Authors = S::Authors; + type Notebook = S::Notebook; type EntryList = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `notebook` field - pub struct notebook(()); ///Marker type for the `authors` field pub struct authors(()); + ///Marker type for the `notebook` field + pub struct notebook(()); ///Marker type for the `entry_list` field pub struct entry_list(()); } @@ -99,9 +107,11 @@ pub struct ChapterBuilder<'a, S: chapter_state::State> { _phantom_state: ::core::marker::PhantomData S>, __unsafe_private_named: ( ::core::option::Option>>, + ::core::option::Option>, ::core::option::Option, ::core::option::Option>>, ::core::option::Option>, + ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ), @@ -120,7 +130,7 @@ impl<'a> ChapterBuilder<'a, chapter_state::Empty> { pub fn new() -> Self { ChapterBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None, None, None, None, None, None), + __unsafe_private_named: (None, None, None, None, None, None, None, None), _phantom: ::core::marker::PhantomData, } } @@ -145,13 +155,32 @@ where } } +impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { + /// Set the `contentWarnings` field (optional) + pub fn content_warnings( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `contentWarnings` field to an Option value (optional) + pub fn maybe_content_warnings( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { /// Set the `createdAt` field (optional) pub fn created_at( mut self, value: impl Into>, ) -> Self { - self.__unsafe_private_named.1 = value.into(); + self.__unsafe_private_named.2 = value.into(); self } /// Set the `createdAt` field to an Option value (optional) @@ -159,7 +188,7 @@ impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { mut self, value: Option, ) -> Self { - self.__unsafe_private_named.1 = value; + self.__unsafe_private_named.2 = value; self } } @@ -174,7 +203,7 @@ where mut self, value: impl Into>>, ) -> ChapterBuilder<'a, chapter_state::SetEntryList> { - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); ChapterBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, @@ -193,7 +222,7 @@ where mut self, value: impl Into>, ) -> ChapterBuilder<'a, chapter_state::SetNotebook> { - self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); ChapterBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, @@ -202,13 +231,32 @@ where } } +impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { + /// Set the `rating` field (optional) + pub fn rating( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `rating` field to an Option value (optional) + pub fn maybe_rating( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { /// Set the `tags` field (optional) pub fn tags( mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.4 = value.into(); + self.__unsafe_private_named.6 = value.into(); self } /// Set the `tags` field to an Option value (optional) @@ -216,7 +264,7 @@ impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { mut self, value: Option>, ) -> Self { - self.__unsafe_private_named.4 = value; + self.__unsafe_private_named.6 = value; self } } @@ -227,7 +275,7 @@ impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.5 = value.into(); + self.__unsafe_private_named.7 = value.into(); self } /// Set the `title` field to an Option value (optional) @@ -235,7 +283,7 @@ impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { mut self, value: Option>, ) -> Self { - self.__unsafe_private_named.5 = value; + self.__unsafe_private_named.7 = value; self } } @@ -243,19 +291,21 @@ impl<'a, S: chapter_state::State> ChapterBuilder<'a, S> { impl<'a, S> ChapterBuilder<'a, S> where S: chapter_state::State, - S::Notebook: chapter_state::IsSet, S::Authors: chapter_state::IsSet, + S::Notebook: chapter_state::IsSet, S::EntryList: chapter_state::IsSet, { /// Build the final struct pub fn build(self) -> Chapter<'a> { Chapter { authors: self.__unsafe_private_named.0.unwrap(), - created_at: self.__unsafe_private_named.1, - entry_list: self.__unsafe_private_named.2.unwrap(), - notebook: self.__unsafe_private_named.3.unwrap(), - tags: self.__unsafe_private_named.4, - title: self.__unsafe_private_named.5, + content_warnings: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + entry_list: self.__unsafe_private_named.3.unwrap(), + notebook: self.__unsafe_private_named.4.unwrap(), + rating: self.__unsafe_private_named.5, + tags: self.__unsafe_private_named.6, + title: self.__unsafe_private_named.7, extra_data: Default::default(), } } @@ -269,11 +319,13 @@ where ) -> Chapter<'a> { Chapter { authors: self.__unsafe_private_named.0.unwrap(), - created_at: self.__unsafe_private_named.1, - entry_list: self.__unsafe_private_named.2.unwrap(), - notebook: self.__unsafe_private_named.3.unwrap(), - tags: self.__unsafe_private_named.4, - title: self.__unsafe_private_named.5, + content_warnings: self.__unsafe_private_named.1, + created_at: self.__unsafe_private_named.2, + entry_list: self.__unsafe_private_named.3.unwrap(), + notebook: self.__unsafe_private_named.4.unwrap(), + rating: self.__unsafe_private_named.5, + tags: self.__unsafe_private_named.6, + title: self.__unsafe_private_named.7, extra_data: Some(extra_data), } } @@ -403,6 +455,17 @@ fn lexicon_doc_sh_weaver_notebook_chapter() -> ::jacquard_lexicon::lexicon::Lexi max_length: None, }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "contentWarnings", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#contentWarnings", + ), + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "createdAt", @@ -453,6 +516,15 @@ fn lexicon_doc_sh_weaver_notebook_chapter() -> ::jacquard_lexicon::lexicon::Lexi ), }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rating"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#contentRating", + ), + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tags"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { diff --git a/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs b/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs index 89b9c12..bdd7df2 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/colour_scheme.rs @@ -38,49 +38,49 @@ pub mod colour_scheme_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Variant; type Name; + type Variant; type Colours; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Variant = Unset; type Name = Unset; + type Variant = Unset; type Colours = Unset; } - ///State transition - sets the `variant` field to Set - pub struct SetVariant(PhantomData S>); - impl sealed::Sealed for SetVariant {} - impl State for SetVariant { - type Variant = Set; - type Name = S::Name; - type Colours = S::Colours; - } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Variant = S::Variant; type Name = Set; + type Variant = S::Variant; + type Colours = S::Colours; + } + ///State transition - sets the `variant` field to Set + pub struct SetVariant(PhantomData S>); + impl sealed::Sealed for SetVariant {} + impl State for SetVariant { + type Name = S::Name; + type Variant = Set; type Colours = S::Colours; } ///State transition - sets the `colours` field to Set pub struct SetColours(PhantomData S>); impl sealed::Sealed for SetColours {} impl State for SetColours { - type Variant = S::Variant; type Name = S::Name; + type Variant = S::Variant; type Colours = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `variant` field - pub struct variant(()); ///Marker type for the `name` field pub struct name(()); + ///Marker type for the `variant` field + pub struct variant(()); ///Marker type for the `colours` field pub struct colours(()); } @@ -175,8 +175,8 @@ where impl<'a, S> ColourSchemeBuilder<'a, S> where S: colour_scheme_state::State, - S::Variant: colour_scheme_state::IsSet, S::Name: colour_scheme_state::IsSet, + S::Variant: colour_scheme_state::IsSet, S::Colours: colour_scheme_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/notebook/entry.rs b/crates/weaver-api/src/sh_weaver/notebook/entry.rs index 548bed3..051727c 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/entry.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/entry.rs @@ -24,6 +24,11 @@ pub struct Entry<'a> { /// The content of the notebook entry. This should be some flavor of Markdown. #[serde(borrow)] pub content: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub content_warnings: std::option::Option< + crate::sh_weaver::notebook::ContentWarnings<'a>, + >, /// Client-declared timestamp when this was originally created. pub created_at: jacquard_common::types::string::Datetime, /// The set of images and records, if any, embedded in the notebook entry. @@ -34,6 +39,9 @@ pub struct Entry<'a> { pub path: crate::sh_weaver::notebook::Path<'a>, #[serde(skip_serializing_if = "std::option::Option::is_none")] #[serde(borrow)] + pub rating: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] pub tags: std::option::Option>, #[serde(borrow)] pub title: crate::sh_weaver::notebook::Title<'a>, @@ -52,67 +60,67 @@ pub mod entry_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Path; + type Content; type Title; + type Path; type CreatedAt; - type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Path = Unset; + type Content = Unset; type Title = Unset; + type Path = Unset; type CreatedAt = Unset; - type Content = Unset; } - ///State transition - sets the `path` field to Set - pub struct SetPath(PhantomData S>); - impl sealed::Sealed for SetPath {} - impl State for SetPath { - type Path = Set; + ///State transition - sets the `content` field to Set + pub struct SetContent(PhantomData S>); + impl sealed::Sealed for SetContent {} + impl State for SetContent { + type Content = Set; type Title = S::Title; + type Path = S::Path; type CreatedAt = S::CreatedAt; - type Content = S::Content; } ///State transition - sets the `title` field to Set pub struct SetTitle(PhantomData S>); impl sealed::Sealed for SetTitle {} impl State for SetTitle { - type Path = S::Path; + type Content = S::Content; type Title = Set; + type Path = S::Path; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `path` field to Set + pub struct SetPath(PhantomData S>); + impl sealed::Sealed for SetPath {} + impl State for SetPath { type Content = S::Content; + type Title = S::Title; + type Path = Set; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Path = S::Path; - type Title = S::Title; - type CreatedAt = Set; type Content = S::Content; - } - ///State transition - sets the `content` field to Set - pub struct SetContent(PhantomData S>); - impl sealed::Sealed for SetContent {} - impl State for SetContent { - type Path = S::Path; type Title = S::Title; - type CreatedAt = S::CreatedAt; - type Content = Set; + type Path = S::Path; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `path` field - pub struct path(()); + ///Marker type for the `content` field + pub struct content(()); ///Marker type for the `title` field pub struct title(()); + ///Marker type for the `path` field + pub struct path(()); ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `content` field - pub struct content(()); } } @@ -122,9 +130,11 @@ pub struct EntryBuilder<'a, S: entry_state::State> { __unsafe_private_named: ( ::core::option::Option>>, ::core::option::Option>, + ::core::option::Option>, ::core::option::Option, ::core::option::Option>, ::core::option::Option>, + ::core::option::Option>, ::core::option::Option>, ::core::option::Option>, ::core::option::Option, @@ -144,7 +154,18 @@ impl<'a> EntryBuilder<'a, entry_state::Empty> { pub fn new() -> Self { EntryBuilder { _phantom_state: ::core::marker::PhantomData, - __unsafe_private_named: (None, None, None, None, None, None, None, None), + __unsafe_private_named: ( + None, + None, + None, + None, + None, + None, + None, + None, + None, + None, + ), _phantom: ::core::marker::PhantomData, } } @@ -188,6 +209,25 @@ where } } +impl<'a, S: entry_state::State> EntryBuilder<'a, S> { + /// Set the `contentWarnings` field (optional) + pub fn content_warnings( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `contentWarnings` field to an Option value (optional) + pub fn maybe_content_warnings( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + impl<'a, S> EntryBuilder<'a, S> where S: entry_state::State, @@ -198,7 +238,7 @@ where mut self, value: impl Into, ) -> EntryBuilder<'a, entry_state::SetCreatedAt> { - self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); EntryBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, @@ -210,12 +250,12 @@ where impl<'a, S: entry_state::State> EntryBuilder<'a, S> { /// Set the `embeds` field (optional) pub fn embeds(mut self, value: impl Into>>) -> Self { - self.__unsafe_private_named.3 = value.into(); + self.__unsafe_private_named.4 = value.into(); self } /// Set the `embeds` field to an Option value (optional) pub fn maybe_embeds(mut self, value: Option>) -> Self { - self.__unsafe_private_named.3 = value; + self.__unsafe_private_named.4 = value; self } } @@ -230,7 +270,7 @@ where mut self, value: impl Into>, ) -> EntryBuilder<'a, entry_state::SetPath> { - self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); EntryBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, @@ -239,13 +279,32 @@ where } } +impl<'a, S: entry_state::State> EntryBuilder<'a, S> { + /// Set the `rating` field (optional) + pub fn rating( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `rating` field to an Option value (optional) + pub fn maybe_rating( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + impl<'a, S: entry_state::State> EntryBuilder<'a, S> { /// Set the `tags` field (optional) pub fn tags( mut self, value: impl Into>>, ) -> Self { - self.__unsafe_private_named.5 = value.into(); + self.__unsafe_private_named.7 = value.into(); self } /// Set the `tags` field to an Option value (optional) @@ -253,7 +312,7 @@ impl<'a, S: entry_state::State> EntryBuilder<'a, S> { mut self, value: Option>, ) -> Self { - self.__unsafe_private_named.5 = value; + self.__unsafe_private_named.7 = value; self } } @@ -268,7 +327,7 @@ where mut self, value: impl Into>, ) -> EntryBuilder<'a, entry_state::SetTitle> { - self.__unsafe_private_named.6 = ::core::option::Option::Some(value.into()); + self.__unsafe_private_named.8 = ::core::option::Option::Some(value.into()); EntryBuilder { _phantom_state: ::core::marker::PhantomData, __unsafe_private_named: self.__unsafe_private_named, @@ -283,7 +342,7 @@ impl<'a, S: entry_state::State> EntryBuilder<'a, S> { mut self, value: impl Into>, ) -> Self { - self.__unsafe_private_named.7 = value.into(); + self.__unsafe_private_named.9 = value.into(); self } /// Set the `updatedAt` field to an Option value (optional) @@ -291,7 +350,7 @@ impl<'a, S: entry_state::State> EntryBuilder<'a, S> { mut self, value: Option, ) -> Self { - self.__unsafe_private_named.7 = value; + self.__unsafe_private_named.9 = value; self } } @@ -299,22 +358,24 @@ impl<'a, S: entry_state::State> EntryBuilder<'a, S> { impl<'a, S> EntryBuilder<'a, S> where S: entry_state::State, - S::Path: entry_state::IsSet, + S::Content: entry_state::IsSet, S::Title: entry_state::IsSet, + S::Path: entry_state::IsSet, S::CreatedAt: entry_state::IsSet, - S::Content: entry_state::IsSet, { /// Build the final struct pub fn build(self) -> Entry<'a> { Entry { authors: self.__unsafe_private_named.0, content: self.__unsafe_private_named.1.unwrap(), - created_at: self.__unsafe_private_named.2.unwrap(), - embeds: self.__unsafe_private_named.3, - path: self.__unsafe_private_named.4.unwrap(), - tags: self.__unsafe_private_named.5, - title: self.__unsafe_private_named.6.unwrap(), - updated_at: self.__unsafe_private_named.7, + content_warnings: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3.unwrap(), + embeds: self.__unsafe_private_named.4, + path: self.__unsafe_private_named.5.unwrap(), + rating: self.__unsafe_private_named.6, + tags: self.__unsafe_private_named.7, + title: self.__unsafe_private_named.8.unwrap(), + updated_at: self.__unsafe_private_named.9, extra_data: Default::default(), } } @@ -329,12 +390,14 @@ where Entry { authors: self.__unsafe_private_named.0, content: self.__unsafe_private_named.1.unwrap(), - created_at: self.__unsafe_private_named.2.unwrap(), - embeds: self.__unsafe_private_named.3, - path: self.__unsafe_private_named.4.unwrap(), - tags: self.__unsafe_private_named.5, - title: self.__unsafe_private_named.6.unwrap(), - updated_at: self.__unsafe_private_named.7, + content_warnings: self.__unsafe_private_named.2, + created_at: self.__unsafe_private_named.3.unwrap(), + embeds: self.__unsafe_private_named.4, + path: self.__unsafe_private_named.5.unwrap(), + rating: self.__unsafe_private_named.6, + tags: self.__unsafe_private_named.7, + title: self.__unsafe_private_named.8.unwrap(), + updated_at: self.__unsafe_private_named.9, extra_data: Some(extra_data), } } @@ -450,6 +513,17 @@ fn lexicon_doc_sh_weaver_notebook_entry() -> ::jacquard_lexicon::lexicon::Lexico known_values: None, }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "contentWarnings", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#contentWarnings", + ), + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static( "createdAt", @@ -553,6 +627,15 @@ fn lexicon_doc_sh_weaver_notebook_entry() -> ::jacquard_lexicon::lexicon::Lexico ), }), ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("rating"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#contentRating", + ), + }), + ); map.insert( ::jacquard_common::smol_str::SmolStr::new_static("tags"), ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_chapter.rs b/crates/weaver-api/src/sh_weaver/notebook/get_chapter.rs new file mode 100644 index 0000000..8ac32e6 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_chapter.rs @@ -0,0 +1,235 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getChapter +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetChapter<'a> { + #[serde(borrow)] + pub chapter: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub entry_cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub entry_limit: std::option::Option, +} + +pub mod get_chapter_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Chapter; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Chapter = Unset; + } + ///State transition - sets the `chapter` field to Set + pub struct SetChapter(PhantomData S>); + impl sealed::Sealed for SetChapter {} + impl State for SetChapter { + type Chapter = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `chapter` field + pub struct chapter(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetChapterBuilder<'a, S: get_chapter_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetChapter<'a> { + /// Create a new builder for this type + pub fn new() -> GetChapterBuilder<'a, get_chapter_state::Empty> { + GetChapterBuilder::new() + } +} + +impl<'a> GetChapterBuilder<'a, get_chapter_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetChapterBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetChapterBuilder<'a, S> +where + S: get_chapter_state::State, + S::Chapter: get_chapter_state::IsUnset, +{ + /// Set the `chapter` field (required) + pub fn chapter( + mut self, + value: impl Into>, + ) -> GetChapterBuilder<'a, get_chapter_state::SetChapter> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetChapterBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_chapter_state::State> GetChapterBuilder<'a, S> { + /// Set the `entryCursor` field (optional) + pub fn entry_cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `entryCursor` field to an Option value (optional) + pub fn maybe_entry_cursor( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_chapter_state::State> GetChapterBuilder<'a, S> { + /// Set the `entryLimit` field (optional) + pub fn entry_limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `entryLimit` field to an Option value (optional) + pub fn maybe_entry_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetChapterBuilder<'a, S> +where + S: get_chapter_state::State, + S::Chapter: get_chapter_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetChapter<'a> { + GetChapter { + chapter: self.__unsafe_private_named.0.unwrap(), + entry_cursor: self.__unsafe_private_named.1, + entry_limit: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetChapterOutput<'a> { + #[serde(borrow)] + pub chapter: crate::sh_weaver::notebook::ChapterView<'a>, + #[serde(borrow)] + pub entries: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub entry_cursor: std::option::Option>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum GetChapterError<'a> { + #[serde(rename = "ChapterNotFound")] + ChapterNotFound(std::option::Option), +} + +impl std::fmt::Display for GetChapterError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::ChapterNotFound(msg) => { + write!(f, "ChapterNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.notebook.getChapter +pub struct GetChapterResponse; +impl jacquard_common::xrpc::XrpcResp for GetChapterResponse { + const NSID: &'static str = "sh.weaver.notebook.getChapter"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetChapterOutput<'de>; + type Err<'de> = GetChapterError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetChapter<'a> { + const NSID: &'static str = "sh.weaver.notebook.getChapter"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetChapterResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getChapter +pub struct GetChapterRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetChapterRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getChapter"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetChapter<'de>; + type Response = GetChapterResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_continue_reading.rs b/crates/weaver-api/src/sh_weaver/notebook/get_continue_reading.rs new file mode 100644 index 0000000..5a51e07 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_continue_reading.rs @@ -0,0 +1,131 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getContinueReading +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetContinueReading { + ///(default: 10, min: 1, max: 20) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, +} + +pub mod get_continue_reading_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct GetContinueReadingBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: (::core::option::Option,), +} + +impl GetContinueReading { + /// Create a new builder for this type + pub fn new() -> GetContinueReadingBuilder { + GetContinueReadingBuilder::new() + } +} + +impl GetContinueReadingBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetContinueReadingBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl GetContinueReadingBuilder { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl GetContinueReadingBuilder +where + S: get_continue_reading_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetContinueReading { + GetContinueReading { + limit: self.__unsafe_private_named.0, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetContinueReadingOutput<'a> { + #[serde(borrow)] + pub items: Vec>, +} + +/// Response type for +///sh.weaver.notebook.getContinueReading +pub struct GetContinueReadingResponse; +impl jacquard_common::xrpc::XrpcResp for GetContinueReadingResponse { + const NSID: &'static str = "sh.weaver.notebook.getContinueReading"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetContinueReadingOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetContinueReading { + const NSID: &'static str = "sh.weaver.notebook.getContinueReading"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetContinueReadingResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getContinueReading +pub struct GetContinueReadingRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetContinueReadingRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getContinueReading"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetContinueReading; + type Response = GetContinueReadingResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_entry_by_title.rs b/crates/weaver-api/src/sh_weaver/notebook/get_entry_by_title.rs index 7ef15dc..d0bb77c 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/get_entry_by_title.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/get_entry_by_title.rs @@ -32,37 +32,37 @@ pub mod get_entry_by_title_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Title; type Notebook; + type Title; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Title = Unset; type Notebook = Unset; - } - ///State transition - sets the `title` field to Set - pub struct SetTitle(PhantomData S>); - impl sealed::Sealed for SetTitle {} - impl State for SetTitle { - type Title = Set; - type Notebook = S::Notebook; + type Title = Unset; } ///State transition - sets the `notebook` field to Set pub struct SetNotebook(PhantomData S>); impl sealed::Sealed for SetNotebook {} impl State for SetNotebook { - type Title = S::Title; type Notebook = Set; + type Title = S::Title; + } + ///State transition - sets the `title` field to Set + pub struct SetTitle(PhantomData S>); + impl sealed::Sealed for SetTitle {} + impl State for SetTitle { + type Notebook = S::Notebook; + type Title = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `title` field - pub struct title(()); ///Marker type for the `notebook` field pub struct notebook(()); + ///Marker type for the `title` field + pub struct title(()); } } @@ -135,8 +135,8 @@ where impl<'a, S> GetEntryByTitleBuilder<'a, S> where S: get_entry_by_title_state::State, - S::Title: get_entry_by_title_state::IsSet, S::Notebook: get_entry_by_title_state::IsSet, + S::Title: get_entry_by_title_state::IsSet, { /// Build the final struct pub fn build(self) -> GetEntryByTitle<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_entry_detail.rs b/crates/weaver-api/src/sh_weaver/notebook/get_entry_detail.rs new file mode 100644 index 0000000..5cb1961 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_entry_detail.rs @@ -0,0 +1,220 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getEntryDetail +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetEntryDetail<'a> { + #[serde(borrow)] + pub entry: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub notebook_context: std::option::Option>, +} + +pub mod get_entry_detail_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Entry; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Entry = Unset; + } + ///State transition - sets the `entry` field to Set + pub struct SetEntry(PhantomData S>); + impl sealed::Sealed for SetEntry {} + impl State for SetEntry { + type Entry = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `entry` field + pub struct entry(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetEntryDetailBuilder<'a, S: get_entry_detail_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetEntryDetail<'a> { + /// Create a new builder for this type + pub fn new() -> GetEntryDetailBuilder<'a, get_entry_detail_state::Empty> { + GetEntryDetailBuilder::new() + } +} + +impl<'a> GetEntryDetailBuilder<'a, get_entry_detail_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetEntryDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetEntryDetailBuilder<'a, S> +where + S: get_entry_detail_state::State, + S::Entry: get_entry_detail_state::IsUnset, +{ + /// Set the `entry` field (required) + pub fn entry( + mut self, + value: impl Into>, + ) -> GetEntryDetailBuilder<'a, get_entry_detail_state::SetEntry> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetEntryDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_entry_detail_state::State> GetEntryDetailBuilder<'a, S> { + /// Set the `notebookContext` field (optional) + pub fn notebook_context( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `notebookContext` field to an Option value (optional) + pub fn maybe_notebook_context( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetEntryDetailBuilder<'a, S> +where + S: get_entry_detail_state::State, + S::Entry: get_entry_detail_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetEntryDetail<'a> { + GetEntryDetail { + entry: self.__unsafe_private_named.0.unwrap(), + notebook_context: self.__unsafe_private_named.1, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetEntryDetailOutput<'a> { + #[serde(borrow)] + pub entry: crate::sh_weaver::notebook::EntryView<'a>, + pub notebook_count: i64, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub notebooks: std::option::Option< + Vec>, + >, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum GetEntryDetailError<'a> { + #[serde(rename = "EntryNotFound")] + EntryNotFound(std::option::Option), +} + +impl std::fmt::Display for GetEntryDetailError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::EntryNotFound(msg) => { + write!(f, "EntryNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.notebook.getEntryDetail +pub struct GetEntryDetailResponse; +impl jacquard_common::xrpc::XrpcResp for GetEntryDetailResponse { + const NSID: &'static str = "sh.weaver.notebook.getEntryDetail"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetEntryDetailOutput<'de>; + type Err<'de> = GetEntryDetailError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetEntryDetail<'a> { + const NSID: &'static str = "sh.weaver.notebook.getEntryDetail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetEntryDetailResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getEntryDetail +pub struct GetEntryDetailRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetEntryDetailRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getEntryDetail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetEntryDetail<'de>; + type Response = GetEntryDetailResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_entry_feed.rs b/crates/weaver-api/src/sh_weaver/notebook/get_entry_feed.rs new file mode 100644 index 0000000..15c1ed2 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_entry_feed.rs @@ -0,0 +1,202 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getEntryFeed +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct GetEntryFeed<'a> { + ///(default: "chronological") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub algorithm: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub feed: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: std::option::Option>>, +} + +pub mod get_entry_feed_state { + + pub use crate::builder_types::{IsSet, IsUnset, Set, Unset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct GetEntryFeedBuilder<'a, S: get_entry_feed_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetEntryFeed<'a> { + /// Create a new builder for this type + pub fn new() -> GetEntryFeedBuilder<'a, get_entry_feed_state::Empty> { + GetEntryFeedBuilder::new() + } +} + +impl<'a> GetEntryFeedBuilder<'a, get_entry_feed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetEntryFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_entry_feed_state::State> GetEntryFeedBuilder<'a, S> { + /// Set the `algorithm` field (optional) + pub fn algorithm(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `algorithm` field to an Option value (optional) + pub fn maybe_algorithm(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_entry_feed_state::State> GetEntryFeedBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor(mut self, value: impl Into>>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_entry_feed_state::State> GetEntryFeedBuilder<'a, S> { + /// Set the `feed` field (optional) + pub fn feed( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `feed` field to an Option value (optional) + pub fn maybe_feed(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_entry_feed_state::State> GetEntryFeedBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: get_entry_feed_state::State> GetEntryFeedBuilder<'a, S> { + /// Set the `tags` field (optional) + pub fn tags(mut self, value: impl Into>>>) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `tags` field to an Option value (optional) + pub fn maybe_tags(mut self, value: Option>>) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> GetEntryFeedBuilder<'a, S> +where + S: get_entry_feed_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetEntryFeed<'a> { + GetEntryFeed { + algorithm: self.__unsafe_private_named.0, + cursor: self.__unsafe_private_named.1, + feed: self.__unsafe_private_named.2, + limit: self.__unsafe_private_named.3, + tags: self.__unsafe_private_named.4, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, serde::Deserialize, Debug, Clone, PartialEq, Eq, jacquard_derive::IntoStatic, +)] +#[serde(rename_all = "camelCase")] +pub struct GetEntryFeedOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub feed: Vec>, +} + +/// Response type for +///sh.weaver.notebook.getEntryFeed +pub struct GetEntryFeedResponse; +impl jacquard_common::xrpc::XrpcResp for GetEntryFeedResponse { + const NSID: &'static str = "sh.weaver.notebook.getEntryFeed"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetEntryFeedOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetEntryFeed<'a> { + const NSID: &'static str = "sh.weaver.notebook.getEntryFeed"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetEntryFeedResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getEntryFeed +pub struct GetEntryFeedRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetEntryFeedRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getEntryFeed"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetEntryFeed<'de>; + type Response = GetEntryFeedResponse; +} diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_notebook_chapters.rs b/crates/weaver-api/src/sh_weaver/notebook/get_notebook_chapters.rs new file mode 100644 index 0000000..bca21ff --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_notebook_chapters.rs @@ -0,0 +1,196 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getNotebookChapters +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetNotebookChapters<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub notebook: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_notebook_chapters_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Notebook; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Notebook = Unset; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Notebook = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `notebook` field + pub struct notebook(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetNotebookChaptersBuilder<'a, S: get_notebook_chapters_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetNotebookChapters<'a> { + /// Create a new builder for this type + pub fn new() -> GetNotebookChaptersBuilder<'a, get_notebook_chapters_state::Empty> { + GetNotebookChaptersBuilder::new() + } +} + +impl<'a> GetNotebookChaptersBuilder<'a, get_notebook_chapters_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetNotebookChaptersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_notebook_chapters_state::State> GetNotebookChaptersBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_notebook_chapters_state::State> GetNotebookChaptersBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetNotebookChaptersBuilder<'a, S> +where + S: get_notebook_chapters_state::State, + S::Notebook: get_notebook_chapters_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> GetNotebookChaptersBuilder<'a, get_notebook_chapters_state::SetNotebook> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetNotebookChaptersBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetNotebookChaptersBuilder<'a, S> +where + S: get_notebook_chapters_state::State, + S::Notebook: get_notebook_chapters_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetNotebookChapters<'a> { + GetNotebookChapters { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + notebook: self.__unsafe_private_named.2.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetNotebookChaptersOutput<'a> { + #[serde(borrow)] + pub chapters: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, +} + +/// Response type for +///sh.weaver.notebook.getNotebookChapters +pub struct GetNotebookChaptersResponse; +impl jacquard_common::xrpc::XrpcResp for GetNotebookChaptersResponse { + const NSID: &'static str = "sh.weaver.notebook.getNotebookChapters"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetNotebookChaptersOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetNotebookChapters<'a> { + const NSID: &'static str = "sh.weaver.notebook.getNotebookChapters"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetNotebookChaptersResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getNotebookChapters +pub struct GetNotebookChaptersRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetNotebookChaptersRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getNotebookChapters"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetNotebookChapters<'de>; + type Response = GetNotebookChaptersResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_notebook_detail.rs b/crates/weaver-api/src/sh_weaver/notebook/get_notebook_detail.rs new file mode 100644 index 0000000..310b184 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_notebook_detail.rs @@ -0,0 +1,235 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getNotebookDetail +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetNotebookDetail<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub entry_cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub entry_limit: std::option::Option, + #[serde(borrow)] + pub notebook: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_notebook_detail_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Notebook; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Notebook = Unset; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Notebook = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `notebook` field + pub struct notebook(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetNotebookDetailBuilder<'a, S: get_notebook_detail_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetNotebookDetail<'a> { + /// Create a new builder for this type + pub fn new() -> GetNotebookDetailBuilder<'a, get_notebook_detail_state::Empty> { + GetNotebookDetailBuilder::new() + } +} + +impl<'a> GetNotebookDetailBuilder<'a, get_notebook_detail_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetNotebookDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_notebook_detail_state::State> GetNotebookDetailBuilder<'a, S> { + /// Set the `entryCursor` field (optional) + pub fn entry_cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `entryCursor` field to an Option value (optional) + pub fn maybe_entry_cursor( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_notebook_detail_state::State> GetNotebookDetailBuilder<'a, S> { + /// Set the `entryLimit` field (optional) + pub fn entry_limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `entryLimit` field to an Option value (optional) + pub fn maybe_entry_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetNotebookDetailBuilder<'a, S> +where + S: get_notebook_detail_state::State, + S::Notebook: get_notebook_detail_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> GetNotebookDetailBuilder<'a, get_notebook_detail_state::SetNotebook> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + GetNotebookDetailBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetNotebookDetailBuilder<'a, S> +where + S: get_notebook_detail_state::State, + S::Notebook: get_notebook_detail_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetNotebookDetail<'a> { + GetNotebookDetail { + entry_cursor: self.__unsafe_private_named.0, + entry_limit: self.__unsafe_private_named.1, + notebook: self.__unsafe_private_named.2.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetNotebookDetailOutput<'a> { + #[serde(borrow)] + pub entries: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub entry_cursor: std::option::Option>, + #[serde(borrow)] + pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum GetNotebookDetailError<'a> { + #[serde(rename = "NotebookNotFound")] + NotebookNotFound(std::option::Option), +} + +impl std::fmt::Display for GetNotebookDetailError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::NotebookNotFound(msg) => { + write!(f, "NotebookNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.notebook.getNotebookDetail +pub struct GetNotebookDetailResponse; +impl jacquard_common::xrpc::XrpcResp for GetNotebookDetailResponse { + const NSID: &'static str = "sh.weaver.notebook.getNotebookDetail"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetNotebookDetailOutput<'de>; + type Err<'de> = GetNotebookDetailError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetNotebookDetail<'a> { + const NSID: &'static str = "sh.weaver.notebook.getNotebookDetail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetNotebookDetailResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getNotebookDetail +pub struct GetNotebookDetailRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetNotebookDetailRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getNotebookDetail"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetNotebookDetail<'de>; + type Response = GetNotebookDetailResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_notebook_feed.rs b/crates/weaver-api/src/sh_weaver/notebook/get_notebook_feed.rs new file mode 100644 index 0000000..5d7aa66 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_notebook_feed.rs @@ -0,0 +1,232 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getNotebookFeed +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetNotebookFeed<'a> { + ///(default: "chronological") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub algorithm: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub feed: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: std::option::Option>>, +} + +pub mod get_notebook_feed_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct GetNotebookFeedBuilder<'a, S: get_notebook_feed_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetNotebookFeed<'a> { + /// Create a new builder for this type + pub fn new() -> GetNotebookFeedBuilder<'a, get_notebook_feed_state::Empty> { + GetNotebookFeedBuilder::new() + } +} + +impl<'a> GetNotebookFeedBuilder<'a, get_notebook_feed_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetNotebookFeedBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_notebook_feed_state::State> GetNotebookFeedBuilder<'a, S> { + /// Set the `algorithm` field (optional) + pub fn algorithm( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `algorithm` field to an Option value (optional) + pub fn maybe_algorithm( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_notebook_feed_state::State> GetNotebookFeedBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_notebook_feed_state::State> GetNotebookFeedBuilder<'a, S> { + /// Set the `feed` field (optional) + pub fn feed( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `feed` field to an Option value (optional) + pub fn maybe_feed( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: get_notebook_feed_state::State> GetNotebookFeedBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S: get_notebook_feed_state::State> GetNotebookFeedBuilder<'a, S> { + /// Set the `tags` field (optional) + pub fn tags( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `tags` field to an Option value (optional) + pub fn maybe_tags( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> GetNotebookFeedBuilder<'a, S> +where + S: get_notebook_feed_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetNotebookFeed<'a> { + GetNotebookFeed { + algorithm: self.__unsafe_private_named.0, + cursor: self.__unsafe_private_named.1, + feed: self.__unsafe_private_named.2, + limit: self.__unsafe_private_named.3, + tags: self.__unsafe_private_named.4, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetNotebookFeedOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub notebooks: Vec>, +} + +/// Response type for +///sh.weaver.notebook.getNotebookFeed +pub struct GetNotebookFeedResponse; +impl jacquard_common::xrpc::XrpcResp for GetNotebookFeedResponse { + const NSID: &'static str = "sh.weaver.notebook.getNotebookFeed"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetNotebookFeedOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetNotebookFeed<'a> { + const NSID: &'static str = "sh.weaver.notebook.getNotebookFeed"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetNotebookFeedResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getNotebookFeed +pub struct GetNotebookFeedRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetNotebookFeedRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getNotebookFeed"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetNotebookFeed<'de>; + type Response = GetNotebookFeedResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_page.rs b/crates/weaver-api/src/sh_weaver/notebook/get_page.rs new file mode 100644 index 0000000..d282a7b --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_page.rs @@ -0,0 +1,190 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getPage +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetPage<'a> { + #[serde(borrow)] + pub page: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_page_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Page; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Page = Unset; + } + ///State transition - sets the `page` field to Set + pub struct SetPage(PhantomData S>); + impl sealed::Sealed for SetPage {} + impl State for SetPage { + type Page = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `page` field + pub struct page(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetPageBuilder<'a, S: get_page_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetPage<'a> { + /// Create a new builder for this type + pub fn new() -> GetPageBuilder<'a, get_page_state::Empty> { + GetPageBuilder::new() + } +} + +impl<'a> GetPageBuilder<'a, get_page_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetPageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetPageBuilder<'a, S> +where + S: get_page_state::State, + S::Page: get_page_state::IsUnset, +{ + /// Set the `page` field (required) + pub fn page( + mut self, + value: impl Into>, + ) -> GetPageBuilder<'a, get_page_state::SetPage> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetPageBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetPageBuilder<'a, S> +where + S: get_page_state::State, + S::Page: get_page_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetPage<'a> { + GetPage { + page: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetPageOutput<'a> { + #[serde(borrow)] + pub entries: Vec>, + #[serde(borrow)] + pub page: crate::sh_weaver::notebook::PageView<'a>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum GetPageError<'a> { + #[serde(rename = "PageNotFound")] + PageNotFound(std::option::Option), +} + +impl std::fmt::Display for GetPageError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::PageNotFound(msg) => { + write!(f, "PageNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.notebook.getPage +pub struct GetPageResponse; +impl jacquard_common::xrpc::XrpcResp for GetPageResponse { + const NSID: &'static str = "sh.weaver.notebook.getPage"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetPageOutput<'de>; + type Err<'de> = GetPageError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetPage<'a> { + const NSID: &'static str = "sh.weaver.notebook.getPage"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetPageResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getPage +pub struct GetPageRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetPageRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getPage"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetPage<'de>; + type Response = GetPageResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_published_versions.rs b/crates/weaver-api/src/sh_weaver/notebook/get_published_versions.rs new file mode 100644 index 0000000..5666157 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_published_versions.rs @@ -0,0 +1,186 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getPublishedVersions +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetPublishedVersions<'a> { + #[serde(borrow)] + pub entry: jacquard_common::types::string::AtUri<'a>, + /// (default: false) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub include_content: std::option::Option, +} + +pub mod get_published_versions_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Entry; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Entry = Unset; + } + ///State transition - sets the `entry` field to Set + pub struct SetEntry(PhantomData S>); + impl sealed::Sealed for SetEntry {} + impl State for SetEntry { + type Entry = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `entry` field + pub struct entry(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetPublishedVersionsBuilder<'a, S: get_published_versions_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetPublishedVersions<'a> { + /// Create a new builder for this type + pub fn new() -> GetPublishedVersionsBuilder< + 'a, + get_published_versions_state::Empty, + > { + GetPublishedVersionsBuilder::new() + } +} + +impl<'a> GetPublishedVersionsBuilder<'a, get_published_versions_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetPublishedVersionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetPublishedVersionsBuilder<'a, S> +where + S: get_published_versions_state::State, + S::Entry: get_published_versions_state::IsUnset, +{ + /// Set the `entry` field (required) + pub fn entry( + mut self, + value: impl Into>, + ) -> GetPublishedVersionsBuilder<'a, get_published_versions_state::SetEntry> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + GetPublishedVersionsBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_published_versions_state::State> GetPublishedVersionsBuilder<'a, S> { + /// Set the `includeContent` field (optional) + pub fn include_content(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `includeContent` field to an Option value (optional) + pub fn maybe_include_content(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S> GetPublishedVersionsBuilder<'a, S> +where + S: get_published_versions_state::State, + S::Entry: get_published_versions_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetPublishedVersions<'a> { + GetPublishedVersions { + entry: self.__unsafe_private_named.0.unwrap(), + include_content: self.__unsafe_private_named.1, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetPublishedVersionsOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub canonical: std::option::Option< + crate::sh_weaver::notebook::PublishedVersionView<'a>, + >, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub has_divergence: std::option::Option, + /// Full entry records if includeContent=true + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub records: std::option::Option>>, + #[serde(borrow)] + pub versions: Vec>, +} + +/// Response type for +///sh.weaver.notebook.getPublishedVersions +pub struct GetPublishedVersionsResponse; +impl jacquard_common::xrpc::XrpcResp for GetPublishedVersionsResponse { + const NSID: &'static str = "sh.weaver.notebook.getPublishedVersions"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetPublishedVersionsOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetPublishedVersions<'a> { + const NSID: &'static str = "sh.weaver.notebook.getPublishedVersions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetPublishedVersionsResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getPublishedVersions +pub struct GetPublishedVersionsRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetPublishedVersionsRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getPublishedVersions"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetPublishedVersions<'de>; + type Response = GetPublishedVersionsResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_reading_history.rs b/crates/weaver-api/src/sh_weaver/notebook/get_reading_history.rs new file mode 100644 index 0000000..6088078 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_reading_history.rs @@ -0,0 +1,512 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getReadingHistory +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetReadingHistory<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + ///(default: "all") + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: std::option::Option>, +} + +pub mod get_reading_history_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct GetReadingHistoryBuilder<'a, S: get_reading_history_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetReadingHistory<'a> { + /// Create a new builder for this type + pub fn new() -> GetReadingHistoryBuilder<'a, get_reading_history_state::Empty> { + GetReadingHistoryBuilder::new() + } +} + +impl<'a> GetReadingHistoryBuilder<'a, get_reading_history_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetReadingHistoryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_reading_history_state::State> GetReadingHistoryBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_reading_history_state::State> GetReadingHistoryBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_reading_history_state::State> GetReadingHistoryBuilder<'a, S> { + /// Set the `status` field (optional) + pub fn status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `status` field to an Option value (optional) + pub fn maybe_status(mut self, value: Option>) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetReadingHistoryBuilder<'a, S> +where + S: get_reading_history_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetReadingHistory<'a> { + GetReadingHistory { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + status: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetReadingHistoryOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub history: Vec< + crate::sh_weaver::notebook::get_reading_history::ReadingHistoryItem<'a>, + >, +} + +/// Response type for +///sh.weaver.notebook.getReadingHistory +pub struct GetReadingHistoryResponse; +impl jacquard_common::xrpc::XrpcResp for GetReadingHistoryResponse { + const NSID: &'static str = "sh.weaver.notebook.getReadingHistory"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetReadingHistoryOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetReadingHistory<'a> { + const NSID: &'static str = "sh.weaver.notebook.getReadingHistory"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetReadingHistoryResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getReadingHistory +pub struct GetReadingHistoryRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetReadingHistoryRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getReadingHistory"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetReadingHistory<'de>; + type Response = GetReadingHistoryResponse; +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ReadingHistoryItem<'a> { + /// The entry the user was last reading. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub current_entry: std::option::Option>, + #[serde(borrow)] + pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, + #[serde(borrow)] + pub progress: crate::sh_weaver::notebook::ReadingProgress<'a>, +} + +pub mod reading_history_item_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Progress; + type Notebook; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Progress = Unset; + type Notebook = Unset; + } + ///State transition - sets the `progress` field to Set + pub struct SetProgress(PhantomData S>); + impl sealed::Sealed for SetProgress {} + impl State for SetProgress { + type Progress = Set; + type Notebook = S::Notebook; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Progress = S::Progress; + type Notebook = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `progress` field + pub struct progress(()); + ///Marker type for the `notebook` field + pub struct notebook(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ReadingHistoryItemBuilder<'a, S: reading_history_item_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ReadingHistoryItem<'a> { + /// Create a new builder for this type + pub fn new() -> ReadingHistoryItemBuilder<'a, reading_history_item_state::Empty> { + ReadingHistoryItemBuilder::new() + } +} + +impl<'a> ReadingHistoryItemBuilder<'a, reading_history_item_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ReadingHistoryItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: reading_history_item_state::State> ReadingHistoryItemBuilder<'a, S> { + /// Set the `currentEntry` field (optional) + pub fn current_entry( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `currentEntry` field to an Option value (optional) + pub fn maybe_current_entry( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> ReadingHistoryItemBuilder<'a, S> +where + S: reading_history_item_state::State, + S::Notebook: reading_history_item_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> ReadingHistoryItemBuilder<'a, reading_history_item_state::SetNotebook> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ReadingHistoryItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReadingHistoryItemBuilder<'a, S> +where + S: reading_history_item_state::State, + S::Progress: reading_history_item_state::IsUnset, +{ + /// Set the `progress` field (required) + pub fn progress( + mut self, + value: impl Into>, + ) -> ReadingHistoryItemBuilder<'a, reading_history_item_state::SetProgress> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ReadingHistoryItemBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ReadingHistoryItemBuilder<'a, S> +where + S: reading_history_item_state::State, + S::Progress: reading_history_item_state::IsSet, + S::Notebook: reading_history_item_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ReadingHistoryItem<'a> { + ReadingHistoryItem { + current_entry: self.__unsafe_private_named.0, + notebook: self.__unsafe_private_named.1.unwrap(), + progress: self.__unsafe_private_named.2.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> ReadingHistoryItem<'a> { + ReadingHistoryItem { + current_entry: self.__unsafe_private_named.0, + notebook: self.__unsafe_private_named.1.unwrap(), + progress: self.__unsafe_private_named.2.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_notebook_getReadingHistory() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.getReadingHistory", + ), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("main"), + ::jacquard_lexicon::lexicon::LexUserType::XrpcQuery(::jacquard_lexicon::lexicon::LexXrpcQuery { + description: None, + parameters: Some( + ::jacquard_lexicon::lexicon::LexXrpcQueryParameter::Params(::jacquard_lexicon::lexicon::LexXrpcParameters { + description: None, + required: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cursor"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("limit"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("status"), + ::jacquard_lexicon::lexicon::LexXrpcParametersProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Filter by reading status.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ), + output: None, + errors: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("readingHistoryItem"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: None, + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("notebook"), + ::jacquard_common::smol_str::SmolStr::new_static("progress") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "currentEntry", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#entryView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notebook"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#notebookView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("progress"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#readingProgress", + ), + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for ReadingHistoryItem<'a> { + fn nsid() -> &'static str { + "sh.weaver.notebook.getReadingHistory" + } + fn def_name() -> &'static str { + "readingHistoryItem" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notebook_getReadingHistory() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/get_similar_notebooks.rs b/crates/weaver-api/src/sh_weaver/notebook/get_similar_notebooks.rs new file mode 100644 index 0000000..3e2b23c --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/get_similar_notebooks.rs @@ -0,0 +1,172 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.getSimilarNotebooks +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetSimilarNotebooks<'a> { + ///(default: 10, min: 1, max: 50) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub notebook: jacquard_common::types::string::AtUri<'a>, +} + +pub mod get_similar_notebooks_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Notebook; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Notebook = Unset; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Notebook = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `notebook` field + pub struct notebook(()); + } +} + +/// Builder for constructing an instance of this type +pub struct GetSimilarNotebooksBuilder<'a, S: get_similar_notebooks_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetSimilarNotebooks<'a> { + /// Create a new builder for this type + pub fn new() -> GetSimilarNotebooksBuilder<'a, get_similar_notebooks_state::Empty> { + GetSimilarNotebooksBuilder::new() + } +} + +impl<'a> GetSimilarNotebooksBuilder<'a, get_similar_notebooks_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSimilarNotebooksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_similar_notebooks_state::State> GetSimilarNotebooksBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> GetSimilarNotebooksBuilder<'a, S> +where + S: get_similar_notebooks_state::State, + S::Notebook: get_similar_notebooks_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> GetSimilarNotebooksBuilder<'a, get_similar_notebooks_state::SetNotebook> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + GetSimilarNotebooksBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> GetSimilarNotebooksBuilder<'a, S> +where + S: get_similar_notebooks_state::State, + S::Notebook: get_similar_notebooks_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> GetSimilarNotebooks<'a> { + GetSimilarNotebooks { + limit: self.__unsafe_private_named.0, + notebook: self.__unsafe_private_named.1.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetSimilarNotebooksOutput<'a> { + #[serde(borrow)] + pub notebooks: Vec>, +} + +/// Response type for +///sh.weaver.notebook.getSimilarNotebooks +pub struct GetSimilarNotebooksResponse; +impl jacquard_common::xrpc::XrpcResp for GetSimilarNotebooksResponse { + const NSID: &'static str = "sh.weaver.notebook.getSimilarNotebooks"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSimilarNotebooksOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSimilarNotebooks<'a> { + const NSID: &'static str = "sh.weaver.notebook.getSimilarNotebooks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSimilarNotebooksResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.getSimilarNotebooks +pub struct GetSimilarNotebooksRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSimilarNotebooksRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.getSimilarNotebooks"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSimilarNotebooks<'de>; + type Response = GetSimilarNotebooksResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/page.rs b/crates/weaver-api/src/sh_weaver/notebook/page.rs index 7817be8..f59c364 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/page.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/page.rs @@ -45,50 +45,50 @@ pub mod page_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Authors; - type Notebook; type EntryList; + type Notebook; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Authors = Unset; - type Notebook = Unset; type EntryList = Unset; + type Notebook = Unset; } ///State transition - sets the `authors` field to Set pub struct SetAuthors(PhantomData S>); impl sealed::Sealed for SetAuthors {} impl State for SetAuthors { type Authors = Set; - type Notebook = S::Notebook; - type EntryList = S::EntryList; - } - ///State transition - sets the `notebook` field to Set - pub struct SetNotebook(PhantomData S>); - impl sealed::Sealed for SetNotebook {} - impl State for SetNotebook { - type Authors = S::Authors; - type Notebook = Set; type EntryList = S::EntryList; + type Notebook = S::Notebook; } ///State transition - sets the `entry_list` field to Set pub struct SetEntryList(PhantomData S>); impl sealed::Sealed for SetEntryList {} impl State for SetEntryList { type Authors = S::Authors; - type Notebook = S::Notebook; type EntryList = Set; + type Notebook = S::Notebook; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Authors = S::Authors; + type EntryList = S::EntryList; + type Notebook = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `authors` field pub struct authors(()); - ///Marker type for the `notebook` field - pub struct notebook(()); ///Marker type for the `entry_list` field pub struct entry_list(()); + ///Marker type for the `notebook` field + pub struct notebook(()); } } @@ -222,8 +222,8 @@ impl<'a, S> PageBuilder<'a, S> where S: page_state::State, S::Authors: page_state::IsSet, - S::Notebook: page_state::IsSet, S::EntryList: page_state::IsSet, + S::Notebook: page_state::IsSet, { /// Build the final struct pub fn build(self) -> Page<'a> { diff --git a/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs b/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs new file mode 100644 index 0000000..57ea4c1 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/resolve_entry.rs @@ -0,0 +1,279 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.resolveEntry +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ResolveEntry<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(borrow)] + pub entry: jacquard_common::CowStr<'a>, + #[serde(borrow)] + pub notebook: jacquard_common::CowStr<'a>, +} + +pub mod resolve_entry_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Notebook; + type Entry; + type Actor; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Notebook = Unset; + type Entry = Unset; + type Actor = Unset; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Notebook = Set; + type Entry = S::Entry; + type Actor = S::Actor; + } + ///State transition - sets the `entry` field to Set + pub struct SetEntry(PhantomData S>); + impl sealed::Sealed for SetEntry {} + impl State for SetEntry { + type Notebook = S::Notebook; + type Entry = Set; + type Actor = S::Actor; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Notebook = S::Notebook; + type Entry = S::Entry; + type Actor = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `notebook` field + pub struct notebook(()); + ///Marker type for the `entry` field + pub struct entry(()); + ///Marker type for the `actor` field + pub struct actor(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ResolveEntryBuilder<'a, S: resolve_entry_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ResolveEntry<'a> { + /// Create a new builder for this type + pub fn new() -> ResolveEntryBuilder<'a, resolve_entry_state::Empty> { + ResolveEntryBuilder::new() + } +} + +impl<'a> ResolveEntryBuilder<'a, resolve_entry_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ResolveEntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveEntryBuilder<'a, S> +where + S: resolve_entry_state::State, + S::Actor: resolve_entry_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> ResolveEntryBuilder<'a, resolve_entry_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ResolveEntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveEntryBuilder<'a, S> +where + S: resolve_entry_state::State, + S::Entry: resolve_entry_state::IsUnset, +{ + /// Set the `entry` field (required) + pub fn entry( + mut self, + value: impl Into>, + ) -> ResolveEntryBuilder<'a, resolve_entry_state::SetEntry> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + ResolveEntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveEntryBuilder<'a, S> +where + S: resolve_entry_state::State, + S::Notebook: resolve_entry_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> ResolveEntryBuilder<'a, resolve_entry_state::SetNotebook> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + ResolveEntryBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveEntryBuilder<'a, S> +where + S: resolve_entry_state::State, + S::Notebook: resolve_entry_state::IsSet, + S::Entry: resolve_entry_state::IsSet, + S::Actor: resolve_entry_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ResolveEntry<'a> { + ResolveEntry { + actor: self.__unsafe_private_named.0.unwrap(), + entry: self.__unsafe_private_named.1.unwrap(), + notebook: self.__unsafe_private_named.2.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ResolveEntryOutput<'a> { + #[serde(borrow)] + pub entry: crate::sh_weaver::notebook::EntryView<'a>, + pub notebook_count: i64, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub notebooks: std::option::Option< + Vec>, + >, + #[serde(borrow)] + pub record: jacquard_common::types::value::Data<'a>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum ResolveEntryError<'a> { + #[serde(rename = "NotebookNotFound")] + NotebookNotFound(std::option::Option), + #[serde(rename = "EntryNotFound")] + EntryNotFound(std::option::Option), +} + +impl std::fmt::Display for ResolveEntryError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::NotebookNotFound(msg) => { + write!(f, "NotebookNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::EntryNotFound(msg) => { + write!(f, "EntryNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.notebook.resolveEntry +pub struct ResolveEntryResponse; +impl jacquard_common::xrpc::XrpcResp for ResolveEntryResponse { + const NSID: &'static str = "sh.weaver.notebook.resolveEntry"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ResolveEntryOutput<'de>; + type Err<'de> = ResolveEntryError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveEntry<'a> { + const NSID: &'static str = "sh.weaver.notebook.resolveEntry"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ResolveEntryResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.resolveEntry +pub struct ResolveEntryRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ResolveEntryRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.resolveEntry"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ResolveEntry<'de>; + type Response = ResolveEntryResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs b/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs new file mode 100644 index 0000000..8e27ef7 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/resolve_notebook.rs @@ -0,0 +1,271 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.resolveNotebook +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ResolveNotebook<'a> { + #[serde(borrow)] + pub actor: jacquard_common::types::ident::AtIdentifier<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub entry_cursor: std::option::Option>, + ///(default: 50, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub entry_limit: std::option::Option, + #[serde(borrow)] + pub name: jacquard_common::CowStr<'a>, +} + +pub mod resolve_notebook_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Actor; + type Name; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Actor = Unset; + type Name = Unset; + } + ///State transition - sets the `actor` field to Set + pub struct SetActor(PhantomData S>); + impl sealed::Sealed for SetActor {} + impl State for SetActor { + type Actor = Set; + type Name = S::Name; + } + ///State transition - sets the `name` field to Set + pub struct SetName(PhantomData S>); + impl sealed::Sealed for SetName {} + impl State for SetName { + type Actor = S::Actor; + type Name = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `actor` field + pub struct actor(()); + ///Marker type for the `name` field + pub struct name(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ResolveNotebookBuilder<'a, S: resolve_notebook_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ResolveNotebook<'a> { + /// Create a new builder for this type + pub fn new() -> ResolveNotebookBuilder<'a, resolve_notebook_state::Empty> { + ResolveNotebookBuilder::new() + } +} + +impl<'a> ResolveNotebookBuilder<'a, resolve_notebook_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ResolveNotebookBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveNotebookBuilder<'a, S> +where + S: resolve_notebook_state::State, + S::Actor: resolve_notebook_state::IsUnset, +{ + /// Set the `actor` field (required) + pub fn actor( + mut self, + value: impl Into>, + ) -> ResolveNotebookBuilder<'a, resolve_notebook_state::SetActor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ResolveNotebookBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: resolve_notebook_state::State> ResolveNotebookBuilder<'a, S> { + /// Set the `entryCursor` field (optional) + pub fn entry_cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `entryCursor` field to an Option value (optional) + pub fn maybe_entry_cursor( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: resolve_notebook_state::State> ResolveNotebookBuilder<'a, S> { + /// Set the `entryLimit` field (optional) + pub fn entry_limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `entryLimit` field to an Option value (optional) + pub fn maybe_entry_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> ResolveNotebookBuilder<'a, S> +where + S: resolve_notebook_state::State, + S::Name: resolve_notebook_state::IsUnset, +{ + /// Set the `name` field (required) + pub fn name( + mut self, + value: impl Into>, + ) -> ResolveNotebookBuilder<'a, resolve_notebook_state::SetName> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + ResolveNotebookBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveNotebookBuilder<'a, S> +where + S: resolve_notebook_state::State, + S::Actor: resolve_notebook_state::IsSet, + S::Name: resolve_notebook_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ResolveNotebook<'a> { + ResolveNotebook { + actor: self.__unsafe_private_named.0.unwrap(), + entry_cursor: self.__unsafe_private_named.1, + entry_limit: self.__unsafe_private_named.2, + name: self.__unsafe_private_named.3.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ResolveNotebookOutput<'a> { + #[serde(borrow)] + pub entries: Vec>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub entry_cursor: std::option::Option>, + #[serde(borrow)] + pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum ResolveNotebookError<'a> { + #[serde(rename = "NotebookNotFound")] + NotebookNotFound(std::option::Option), +} + +impl std::fmt::Display for ResolveNotebookError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::NotebookNotFound(msg) => { + write!(f, "NotebookNotFound")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.notebook.resolveNotebook +pub struct ResolveNotebookResponse; +impl jacquard_common::xrpc::XrpcResp for ResolveNotebookResponse { + const NSID: &'static str = "sh.weaver.notebook.resolveNotebook"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ResolveNotebookOutput<'de>; + type Err<'de> = ResolveNotebookError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveNotebook<'a> { + const NSID: &'static str = "sh.weaver.notebook.resolveNotebook"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ResolveNotebookResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.resolveNotebook +pub struct ResolveNotebookRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ResolveNotebookRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.resolveNotebook"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ResolveNotebook<'de>; + type Response = ResolveNotebookResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/resolve_version_conflict.rs b/crates/weaver-api/src/sh_weaver/notebook/resolve_version_conflict.rs new file mode 100644 index 0000000..98d1be1 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/resolve_version_conflict.rs @@ -0,0 +1,199 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.resolveVersionConflict +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ResolveVersionConflict<'a> { + #[serde(borrow)] + pub uris: Vec>, +} + +pub mod resolve_version_conflict_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Uris; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Uris = Unset; + } + ///State transition - sets the `uris` field to Set + pub struct SetUris(PhantomData S>); + impl sealed::Sealed for SetUris {} + impl State for SetUris { + type Uris = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `uris` field + pub struct uris(()); + } +} + +/// Builder for constructing an instance of this type +pub struct ResolveVersionConflictBuilder<'a, S: resolve_version_conflict_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> ResolveVersionConflict<'a> { + /// Create a new builder for this type + pub fn new() -> ResolveVersionConflictBuilder< + 'a, + resolve_version_conflict_state::Empty, + > { + ResolveVersionConflictBuilder::new() + } +} + +impl<'a> ResolveVersionConflictBuilder<'a, resolve_version_conflict_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + ResolveVersionConflictBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveVersionConflictBuilder<'a, S> +where + S: resolve_version_conflict_state::State, + S::Uris: resolve_version_conflict_state::IsUnset, +{ + /// Set the `uris` field (required) + pub fn uris( + mut self, + value: impl Into>>, + ) -> ResolveVersionConflictBuilder<'a, resolve_version_conflict_state::SetUris> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + ResolveVersionConflictBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> ResolveVersionConflictBuilder<'a, S> +where + S: resolve_version_conflict_state::State, + S::Uris: resolve_version_conflict_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> ResolveVersionConflict<'a> { + ResolveVersionConflict { + uris: self.__unsafe_private_named.0.unwrap(), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct ResolveVersionConflictOutput<'a> { + #[serde(borrow)] + pub canonical: crate::sh_weaver::notebook::PublishedVersionView<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub collaboration_state: std::option::Option< + crate::sh_weaver::collab::CollaborationStateView<'a>, + >, + #[serde(borrow)] + pub related: Vec>, +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + thiserror::Error, + miette::Diagnostic, + jacquard_derive::IntoStatic +)] +#[serde(tag = "error", content = "message")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum ResolveVersionConflictError<'a> { + /// The URIs don't appear to be related versions + #[serde(rename = "NoRelatedVersions")] + NoRelatedVersions(std::option::Option), +} + +impl std::fmt::Display for ResolveVersionConflictError<'_> { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::NoRelatedVersions(msg) => { + write!(f, "NoRelatedVersions")?; + if let Some(msg) = msg { + write!(f, ": {}", msg)?; + } + Ok(()) + } + Self::Unknown(err) => write!(f, "Unknown error: {:?}", err), + } + } +} + +/// Response type for +///sh.weaver.notebook.resolveVersionConflict +pub struct ResolveVersionConflictResponse; +impl jacquard_common::xrpc::XrpcResp for ResolveVersionConflictResponse { + const NSID: &'static str = "sh.weaver.notebook.resolveVersionConflict"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = ResolveVersionConflictOutput<'de>; + type Err<'de> = ResolveVersionConflictError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for ResolveVersionConflict<'a> { + const NSID: &'static str = "sh.weaver.notebook.resolveVersionConflict"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = ResolveVersionConflictResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.resolveVersionConflict +pub struct ResolveVersionConflictRequest; +impl jacquard_common::xrpc::XrpcEndpoint for ResolveVersionConflictRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.resolveVersionConflict"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = ResolveVersionConflict<'de>; + type Response = ResolveVersionConflictResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/search_entries.rs b/crates/weaver-api/src/sh_weaver/notebook/search_entries.rs new file mode 100644 index 0000000..fa545f1 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/search_entries.rs @@ -0,0 +1,244 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.searchEntries +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SearchEntries<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub author: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 25, min: 1, max: 100) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(borrow)] + pub q: jacquard_common::CowStr<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub tags: std::option::Option>>, +} + +pub mod search_entries_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Q; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Q = Unset; + } + ///State transition - sets the `q` field to Set + pub struct SetQ(PhantomData S>); + impl sealed::Sealed for SetQ {} + impl State for SetQ { + type Q = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `q` field + pub struct q(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SearchEntriesBuilder<'a, S: search_entries_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SearchEntries<'a> { + /// Create a new builder for this type + pub fn new() -> SearchEntriesBuilder<'a, search_entries_state::Empty> { + SearchEntriesBuilder::new() + } +} + +impl<'a> SearchEntriesBuilder<'a, search_entries_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SearchEntriesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_entries_state::State> SearchEntriesBuilder<'a, S> { + /// Set the `author` field (optional) + pub fn author( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `author` field to an Option value (optional) + pub fn maybe_author( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: search_entries_state::State> SearchEntriesBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: search_entries_state::State> SearchEntriesBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> SearchEntriesBuilder<'a, S> +where + S: search_entries_state::State, + S::Q: search_entries_state::IsUnset, +{ + /// Set the `q` field (required) + pub fn q( + mut self, + value: impl Into>, + ) -> SearchEntriesBuilder<'a, search_entries_state::SetQ> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + SearchEntriesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: search_entries_state::State> SearchEntriesBuilder<'a, S> { + /// Set the `tags` field (optional) + pub fn tags( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.4 = value.into(); + self + } + /// Set the `tags` field to an Option value (optional) + pub fn maybe_tags( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.4 = value; + self + } +} + +impl<'a, S> SearchEntriesBuilder<'a, S> +where + S: search_entries_state::State, + S::Q: search_entries_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SearchEntries<'a> { + SearchEntries { + author: self.__unsafe_private_named.0, + cursor: self.__unsafe_private_named.1, + limit: self.__unsafe_private_named.2, + q: self.__unsafe_private_named.3.unwrap(), + tags: self.__unsafe_private_named.4, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SearchEntriesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub entries: Vec>, +} + +/// Response type for +///sh.weaver.notebook.searchEntries +pub struct SearchEntriesResponse; +impl jacquard_common::xrpc::XrpcResp for SearchEntriesResponse { + const NSID: &'static str = "sh.weaver.notebook.searchEntries"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = SearchEntriesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for SearchEntries<'a> { + const NSID: &'static str = "sh.weaver.notebook.searchEntries"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = SearchEntriesResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.searchEntries +pub struct SearchEntriesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for SearchEntriesRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.searchEntries"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = SearchEntries<'de>; + type Response = SearchEntriesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notebook/theme.rs b/crates/weaver-api/src/sh_weaver/notebook/theme.rs index 7647aa9..55ad5a3 100644 --- a/crates/weaver-api/src/sh_weaver/notebook/theme.rs +++ b/crates/weaver-api/src/sh_weaver/notebook/theme.rs @@ -37,50 +37,50 @@ pub mod code_theme_file_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Name; - type Content; type Did; + type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Name = Unset; - type Content = Unset; type Did = Unset; + type Content = Unset; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { type Name = Set; - type Content = S::Content; - type Did = S::Did; - } - ///State transition - sets the `content` field to Set - pub struct SetContent(PhantomData S>); - impl sealed::Sealed for SetContent {} - impl State for SetContent { - type Name = S::Name; - type Content = Set; type Did = S::Did; + type Content = S::Content; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Name = S::Name; - type Content = S::Content; type Did = Set; + type Content = S::Content; + } + ///State transition - sets the `content` field to Set + pub struct SetContent(PhantomData S>); + impl sealed::Sealed for SetContent {} + impl State for SetContent { + type Name = S::Name; + type Did = S::Did; + type Content = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `name` field pub struct name(()); - ///Marker type for the `content` field - pub struct content(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `content` field + pub struct content(()); } } @@ -174,8 +174,8 @@ impl<'a, S> CodeThemeFileBuilder<'a, S> where S: code_theme_file_state::State, S::Name: code_theme_file_state::IsSet, - S::Content: code_theme_file_state::IsSet, S::Did: code_theme_file_state::IsSet, + S::Content: code_theme_file_state::IsSet, { /// Build the final struct pub fn build(self) -> CodeThemeFile<'a> { @@ -837,51 +837,51 @@ pub mod font_file_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Content; - type Name; type Did; + type Name; + type Content; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Content = Unset; - type Name = Unset; type Did = Unset; + type Name = Unset; + type Content = Unset; } - ///State transition - sets the `content` field to Set - pub struct SetContent(PhantomData S>); - impl sealed::Sealed for SetContent {} - impl State for SetContent { - type Content = Set; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; type Name = S::Name; - type Did = S::Did; + type Content = S::Content; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { - type Content = S::Content; - type Name = Set; type Did = S::Did; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { + type Name = Set; type Content = S::Content; + } + ///State transition - sets the `content` field to Set + pub struct SetContent(PhantomData S>); + impl sealed::Sealed for SetContent {} + impl State for SetContent { + type Did = S::Did; type Name = S::Name; - type Did = Set; + type Content = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `content` field - pub struct content(()); - ///Marker type for the `name` field - pub struct name(()); ///Marker type for the `did` field pub struct did(()); + ///Marker type for the `name` field + pub struct name(()); + ///Marker type for the `content` field + pub struct content(()); } } @@ -974,9 +974,9 @@ where impl<'a, S> FontFileBuilder<'a, S> where S: font_file_state::State, - S::Content: font_file_state::IsSet, - S::Name: font_file_state::IsSet, S::Did: font_file_state::IsSet, + S::Name: font_file_state::IsSet, + S::Content: font_file_state::IsSet, { /// Build the final struct pub fn build(self) -> FontFile<'a> { @@ -1067,105 +1067,105 @@ pub mod theme_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type LightCodeTheme; - type DarkCodeTheme; - type DarkScheme; + type Spacing; type Fonts; type LightScheme; - type Spacing; + type DarkCodeTheme; + type LightCodeTheme; + type DarkScheme; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type LightCodeTheme = Unset; - type DarkCodeTheme = Unset; - type DarkScheme = Unset; + type Spacing = Unset; type Fonts = Unset; type LightScheme = Unset; - type Spacing = Unset; + type DarkCodeTheme = Unset; + type LightCodeTheme = Unset; + type DarkScheme = Unset; } - ///State transition - sets the `light_code_theme` field to Set - pub struct SetLightCodeTheme(PhantomData S>); - impl sealed::Sealed for SetLightCodeTheme {} - impl State for SetLightCodeTheme { - type LightCodeTheme = Set; - type DarkCodeTheme = S::DarkCodeTheme; - type DarkScheme = S::DarkScheme; + ///State transition - sets the `spacing` field to Set + pub struct SetSpacing(PhantomData S>); + impl sealed::Sealed for SetSpacing {} + impl State for SetSpacing { + type Spacing = Set; type Fonts = S::Fonts; type LightScheme = S::LightScheme; - type Spacing = S::Spacing; - } - ///State transition - sets the `dark_code_theme` field to Set - pub struct SetDarkCodeTheme(PhantomData S>); - impl sealed::Sealed for SetDarkCodeTheme {} - impl State for SetDarkCodeTheme { + type DarkCodeTheme = S::DarkCodeTheme; type LightCodeTheme = S::LightCodeTheme; - type DarkCodeTheme = Set; type DarkScheme = S::DarkScheme; - type Fonts = S::Fonts; - type LightScheme = S::LightScheme; - type Spacing = S::Spacing; - } - ///State transition - sets the `dark_scheme` field to Set - pub struct SetDarkScheme(PhantomData S>); - impl sealed::Sealed for SetDarkScheme {} - impl State for SetDarkScheme { - type LightCodeTheme = S::LightCodeTheme; - type DarkCodeTheme = S::DarkCodeTheme; - type DarkScheme = Set; - type Fonts = S::Fonts; - type LightScheme = S::LightScheme; - type Spacing = S::Spacing; } ///State transition - sets the `fonts` field to Set pub struct SetFonts(PhantomData S>); impl sealed::Sealed for SetFonts {} impl State for SetFonts { - type LightCodeTheme = S::LightCodeTheme; - type DarkCodeTheme = S::DarkCodeTheme; - type DarkScheme = S::DarkScheme; + type Spacing = S::Spacing; type Fonts = Set; type LightScheme = S::LightScheme; - type Spacing = S::Spacing; + type DarkCodeTheme = S::DarkCodeTheme; + type LightCodeTheme = S::LightCodeTheme; + type DarkScheme = S::DarkScheme; } ///State transition - sets the `light_scheme` field to Set pub struct SetLightScheme(PhantomData S>); impl sealed::Sealed for SetLightScheme {} impl State for SetLightScheme { - type LightCodeTheme = S::LightCodeTheme; - type DarkCodeTheme = S::DarkCodeTheme; - type DarkScheme = S::DarkScheme; + type Spacing = S::Spacing; type Fonts = S::Fonts; type LightScheme = Set; - type Spacing = S::Spacing; + type DarkCodeTheme = S::DarkCodeTheme; + type LightCodeTheme = S::LightCodeTheme; + type DarkScheme = S::DarkScheme; } - ///State transition - sets the `spacing` field to Set - pub struct SetSpacing(PhantomData S>); - impl sealed::Sealed for SetSpacing {} - impl State for SetSpacing { + ///State transition - sets the `dark_code_theme` field to Set + pub struct SetDarkCodeTheme(PhantomData S>); + impl sealed::Sealed for SetDarkCodeTheme {} + impl State for SetDarkCodeTheme { + type Spacing = S::Spacing; + type Fonts = S::Fonts; + type LightScheme = S::LightScheme; + type DarkCodeTheme = Set; type LightCodeTheme = S::LightCodeTheme; + type DarkScheme = S::DarkScheme; + } + ///State transition - sets the `light_code_theme` field to Set + pub struct SetLightCodeTheme(PhantomData S>); + impl sealed::Sealed for SetLightCodeTheme {} + impl State for SetLightCodeTheme { + type Spacing = S::Spacing; + type Fonts = S::Fonts; + type LightScheme = S::LightScheme; type DarkCodeTheme = S::DarkCodeTheme; + type LightCodeTheme = Set; type DarkScheme = S::DarkScheme; + } + ///State transition - sets the `dark_scheme` field to Set + pub struct SetDarkScheme(PhantomData S>); + impl sealed::Sealed for SetDarkScheme {} + impl State for SetDarkScheme { + type Spacing = S::Spacing; type Fonts = S::Fonts; type LightScheme = S::LightScheme; - type Spacing = Set; + type DarkCodeTheme = S::DarkCodeTheme; + type LightCodeTheme = S::LightCodeTheme; + type DarkScheme = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `light_code_theme` field - pub struct light_code_theme(()); - ///Marker type for the `dark_code_theme` field - pub struct dark_code_theme(()); - ///Marker type for the `dark_scheme` field - pub struct dark_scheme(()); + ///Marker type for the `spacing` field + pub struct spacing(()); ///Marker type for the `fonts` field pub struct fonts(()); ///Marker type for the `light_scheme` field pub struct light_scheme(()); - ///Marker type for the `spacing` field - pub struct spacing(()); + ///Marker type for the `dark_code_theme` field + pub struct dark_code_theme(()); + ///Marker type for the `light_code_theme` field + pub struct light_code_theme(()); + ///Marker type for the `dark_scheme` field + pub struct dark_scheme(()); } } @@ -1338,12 +1338,12 @@ where impl<'a, S> ThemeBuilder<'a, S> where S: theme_state::State, - S::LightCodeTheme: theme_state::IsSet, - S::DarkCodeTheme: theme_state::IsSet, - S::DarkScheme: theme_state::IsSet, + S::Spacing: theme_state::IsSet, S::Fonts: theme_state::IsSet, S::LightScheme: theme_state::IsSet, - S::Spacing: theme_state::IsSet, + S::DarkCodeTheme: theme_state::IsSet, + S::LightCodeTheme: theme_state::IsSet, + S::DarkScheme: theme_state::IsSet, { /// Build the final struct pub fn build(self) -> Theme<'a> { @@ -1442,49 +1442,49 @@ pub mod theme_fonts_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Body; type Heading; + type Body; type Monospace; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Body = Unset; type Heading = Unset; + type Body = Unset; type Monospace = Unset; } - ///State transition - sets the `body` field to Set - pub struct SetBody(PhantomData S>); - impl sealed::Sealed for SetBody {} - impl State for SetBody { - type Body = Set; - type Heading = S::Heading; - type Monospace = S::Monospace; - } ///State transition - sets the `heading` field to Set pub struct SetHeading(PhantomData S>); impl sealed::Sealed for SetHeading {} impl State for SetHeading { - type Body = S::Body; type Heading = Set; + type Body = S::Body; + type Monospace = S::Monospace; + } + ///State transition - sets the `body` field to Set + pub struct SetBody(PhantomData S>); + impl sealed::Sealed for SetBody {} + impl State for SetBody { + type Heading = S::Heading; + type Body = Set; type Monospace = S::Monospace; } ///State transition - sets the `monospace` field to Set pub struct SetMonospace(PhantomData S>); impl sealed::Sealed for SetMonospace {} impl State for SetMonospace { - type Body = S::Body; type Heading = S::Heading; + type Body = S::Body; type Monospace = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `body` field - pub struct body(()); ///Marker type for the `heading` field pub struct heading(()); + ///Marker type for the `body` field + pub struct body(()); ///Marker type for the `monospace` field pub struct monospace(()); } @@ -1579,8 +1579,8 @@ where impl<'a, S> ThemeFontsBuilder<'a, S> where S: theme_fonts_state::State, - S::Body: theme_fonts_state::IsSet, S::Heading: theme_fonts_state::IsSet, + S::Body: theme_fonts_state::IsSet, S::Monospace: theme_fonts_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/sh_weaver/notebook/update_reading_progress.rs b/crates/weaver-api/src/sh_weaver/notebook/update_reading_progress.rs new file mode 100644 index 0000000..bcd866d --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notebook/update_reading_progress.rs @@ -0,0 +1,245 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notebook.updateReadingProgress +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateReadingProgress<'a> { + /// The entry the user is currently on. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub current_entry: std::option::Option>, + #[serde(borrow)] + pub notebook: jacquard_common::types::string::AtUri<'a>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub percent_complete: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub status: std::option::Option>, +} + +pub mod update_reading_progress_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Notebook; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Notebook = Unset; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type Notebook = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `notebook` field + pub struct notebook(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateReadingProgressBuilder<'a, S: update_reading_progress_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> UpdateReadingProgress<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateReadingProgressBuilder< + 'a, + update_reading_progress_state::Empty, + > { + UpdateReadingProgressBuilder::new() + } +} + +impl<'a> UpdateReadingProgressBuilder<'a, update_reading_progress_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateReadingProgressBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: update_reading_progress_state::State> UpdateReadingProgressBuilder<'a, S> { + /// Set the `currentEntry` field (optional) + pub fn current_entry( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `currentEntry` field to an Option value (optional) + pub fn maybe_current_entry( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S> UpdateReadingProgressBuilder<'a, S> +where + S: update_reading_progress_state::State, + S::Notebook: update_reading_progress_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> UpdateReadingProgressBuilder< + 'a, + update_reading_progress_state::SetNotebook, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + UpdateReadingProgressBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: update_reading_progress_state::State> UpdateReadingProgressBuilder<'a, S> { + /// Set the `percentComplete` field (optional) + pub fn percent_complete(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `percentComplete` field to an Option value (optional) + pub fn maybe_percent_complete(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S: update_reading_progress_state::State> UpdateReadingProgressBuilder<'a, S> { + /// Set the `status` field (optional) + pub fn status( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `status` field to an Option value (optional) + pub fn maybe_status(mut self, value: Option>) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> UpdateReadingProgressBuilder<'a, S> +where + S: update_reading_progress_state::State, + S::Notebook: update_reading_progress_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UpdateReadingProgress<'a> { + UpdateReadingProgress { + current_entry: self.__unsafe_private_named.0, + notebook: self.__unsafe_private_named.1.unwrap(), + percent_complete: self.__unsafe_private_named.2, + status: self.__unsafe_private_named.3, + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> UpdateReadingProgress<'a> { + UpdateReadingProgress { + current_entry: self.__unsafe_private_named.0, + notebook: self.__unsafe_private_named.1.unwrap(), + percent_complete: self.__unsafe_private_named.2, + status: self.__unsafe_private_named.3, + extra_data: Some(extra_data), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateReadingProgressOutput<'a> { + #[serde(borrow)] + pub progress: crate::sh_weaver::notebook::ReadingProgress<'a>, +} + +/// Response type for +///sh.weaver.notebook.updateReadingProgress +pub struct UpdateReadingProgressResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateReadingProgressResponse { + const NSID: &'static str = "sh.weaver.notebook.updateReadingProgress"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UpdateReadingProgressOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateReadingProgress<'a> { + const NSID: &'static str = "sh.weaver.notebook.updateReadingProgress"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateReadingProgressResponse; +} + +/// Endpoint type for +///sh.weaver.notebook.updateReadingProgress +pub struct UpdateReadingProgressRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateReadingProgressRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notebook.updateReadingProgress"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateReadingProgress<'de>; + type Response = UpdateReadingProgressResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notification.rs b/crates/weaver-api/src/sh_weaver/notification.rs new file mode 100644 index 0000000..4463c6b --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notification.rs @@ -0,0 +1,1504 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notification.defs +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +pub mod get_subscription_updates; +pub mod get_unread_count; +pub mod update_seen; + +/// A notification for a user. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct Notification<'a> { + #[serde(borrow)] + pub author: crate::sh_weaver::actor::ProfileViewBasic<'a>, + #[serde(borrow)] + pub cid: jacquard_common::types::string::Cid<'a>, + pub indexed_at: jacquard_common::types::string::Datetime, + pub is_read: bool, + #[serde(borrow)] + pub reason: crate::sh_weaver::notification::NotificationReason<'a>, + /// The subject of the notification (entry, notebook, etc). + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub reason_subject: std::option::Option>, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub record: std::option::Option>, + #[serde(borrow)] + pub uri: jacquard_common::types::string::AtUri<'a>, +} + +pub mod notification_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type IsRead; + type IndexedAt; + type Cid; + type Reason; + type Uri; + type Author; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type IsRead = Unset; + type IndexedAt = Unset; + type Cid = Unset; + type Reason = Unset; + type Uri = Unset; + type Author = Unset; + } + ///State transition - sets the `is_read` field to Set + pub struct SetIsRead(PhantomData S>); + impl sealed::Sealed for SetIsRead {} + impl State for SetIsRead { + type IsRead = Set; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Reason = S::Reason; + type Uri = S::Uri; + type Author = S::Author; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type IsRead = S::IsRead; + type IndexedAt = Set; + type Cid = S::Cid; + type Reason = S::Reason; + type Uri = S::Uri; + type Author = S::Author; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; + type Cid = Set; + type Reason = S::Reason; + type Uri = S::Uri; + type Author = S::Author; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Reason = Set; + type Uri = S::Uri; + type Author = S::Author; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Reason = S::Reason; + type Uri = Set; + type Author = S::Author; + } + ///State transition - sets the `author` field to Set + pub struct SetAuthor(PhantomData S>); + impl sealed::Sealed for SetAuthor {} + impl State for SetAuthor { + type IsRead = S::IsRead; + type IndexedAt = S::IndexedAt; + type Cid = S::Cid; + type Reason = S::Reason; + type Uri = S::Uri; + type Author = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `is_read` field + pub struct is_read(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); + ///Marker type for the `cid` field + pub struct cid(()); + ///Marker type for the `reason` field + pub struct reason(()); + ///Marker type for the `uri` field + pub struct uri(()); + ///Marker type for the `author` field + pub struct author(()); + } +} + +/// Builder for constructing an instance of this type +pub struct NotificationBuilder<'a, S: notification_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> Notification<'a> { + /// Create a new builder for this type + pub fn new() -> NotificationBuilder<'a, notification_state::Empty> { + NotificationBuilder::new() + } +} + +impl<'a> NotificationBuilder<'a, notification_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + NotificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationBuilder<'a, S> +where + S: notification_state::State, + S::Author: notification_state::IsUnset, +{ + /// Set the `author` field (required) + pub fn author( + mut self, + value: impl Into>, + ) -> NotificationBuilder<'a, notification_state::SetAuthor> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + NotificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationBuilder<'a, S> +where + S: notification_state::State, + S::Cid: notification_state::IsUnset, +{ + /// Set the `cid` field (required) + pub fn cid( + mut self, + value: impl Into>, + ) -> NotificationBuilder<'a, notification_state::SetCid> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + NotificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationBuilder<'a, S> +where + S: notification_state::State, + S::IndexedAt: notification_state::IsUnset, +{ + /// Set the `indexedAt` field (required) + pub fn indexed_at( + mut self, + value: impl Into, + ) -> NotificationBuilder<'a, notification_state::SetIndexedAt> { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + NotificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationBuilder<'a, S> +where + S: notification_state::State, + S::IsRead: notification_state::IsUnset, +{ + /// Set the `isRead` field (required) + pub fn is_read( + mut self, + value: impl Into, + ) -> NotificationBuilder<'a, notification_state::SetIsRead> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + NotificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationBuilder<'a, S> +where + S: notification_state::State, + S::Reason: notification_state::IsUnset, +{ + /// Set the `reason` field (required) + pub fn reason( + mut self, + value: impl Into>, + ) -> NotificationBuilder<'a, notification_state::SetReason> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + NotificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: notification_state::State> NotificationBuilder<'a, S> { + /// Set the `reasonSubject` field (optional) + pub fn reason_subject( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.5 = value.into(); + self + } + /// Set the `reasonSubject` field to an Option value (optional) + pub fn maybe_reason_subject( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.5 = value; + self + } +} + +impl<'a, S: notification_state::State> NotificationBuilder<'a, S> { + /// Set the `record` field (optional) + pub fn record( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.6 = value.into(); + self + } + /// Set the `record` field to an Option value (optional) + pub fn maybe_record( + mut self, + value: Option>, + ) -> Self { + self.__unsafe_private_named.6 = value; + self + } +} + +impl<'a, S> NotificationBuilder<'a, S> +where + S: notification_state::State, + S::Uri: notification_state::IsUnset, +{ + /// Set the `uri` field (required) + pub fn uri( + mut self, + value: impl Into>, + ) -> NotificationBuilder<'a, notification_state::SetUri> { + self.__unsafe_private_named.7 = ::core::option::Option::Some(value.into()); + NotificationBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationBuilder<'a, S> +where + S: notification_state::State, + S::IsRead: notification_state::IsSet, + S::IndexedAt: notification_state::IsSet, + S::Cid: notification_state::IsSet, + S::Reason: notification_state::IsSet, + S::Uri: notification_state::IsSet, + S::Author: notification_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> Notification<'a> { + Notification { + author: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + is_read: self.__unsafe_private_named.3.unwrap(), + reason: self.__unsafe_private_named.4.unwrap(), + reason_subject: self.__unsafe_private_named.5, + record: self.__unsafe_private_named.6, + uri: self.__unsafe_private_named.7.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> Notification<'a> { + Notification { + author: self.__unsafe_private_named.0.unwrap(), + cid: self.__unsafe_private_named.1.unwrap(), + indexed_at: self.__unsafe_private_named.2.unwrap(), + is_read: self.__unsafe_private_named.3.unwrap(), + reason: self.__unsafe_private_named.4.unwrap(), + reason_subject: self.__unsafe_private_named.5, + record: self.__unsafe_private_named.6, + uri: self.__unsafe_private_named.7.unwrap(), + extra_data: Some(extra_data), + } + } +} + +fn lexicon_doc_sh_weaver_notification_defs() -> ::jacquard_lexicon::lexicon::LexiconDoc< + 'static, +> { + ::jacquard_lexicon::lexicon::LexiconDoc { + lexicon: ::jacquard_lexicon::lexicon::Lexicon::Lexicon1, + id: ::jacquard_common::CowStr::new_static("sh.weaver.notification.defs"), + revision: None, + description: None, + defs: { + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notification"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "A notification for a user.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_common::smol_str::SmolStr::new_static("author"), + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_common::smol_str::SmolStr::new_static("isRead"), + ::jacquard_common::smol_str::SmolStr::new_static("indexedAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("author"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("cid"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Cid, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "indexedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("isRead"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#notificationReason", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "reasonSubject", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "The subject of the notification (entry, notebook, etc).", + ), + ), + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("record"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Unknown(::jacquard_lexicon::lexicon::LexUnknown { + description: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("uri"), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::AtUri, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notificationGroup"), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "Grouped notifications (e.g., '5 people liked your entry').", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_common::smol_str::SmolStr::new_static("count"), + ::jacquard_common::smol_str::SmolStr::new_static("actors"), + ::jacquard_common::smol_str::SmolStr::new_static("mostRecentAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("actors"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Most recent actors (up to 5).", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.actor.defs#profileViewBasic", + ), + }), + min_length: None, + max_length: Some(5usize), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("count"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Integer(::jacquard_lexicon::lexicon::LexInteger { + description: None, + default: None, + minimum: None, + maximum: None, + r#enum: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("isRead"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Boolean(::jacquard_lexicon::lexicon::LexBoolean { + description: None, + default: None, + r#const: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "mostRecentAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("reason"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "#notificationReason", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("subject"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Union(::jacquard_lexicon::lexicon::LexRefUnion { + description: None, + refs: vec![ + ::jacquard_common::CowStr::new_static("sh.weaver.notebook.defs#notebookView"), + ::jacquard_common::CowStr::new_static("sh.weaver.notebook.defs#entryView") + ], + closed: None, + }), + ); + map + }, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notificationReason"), + ::jacquard_lexicon::lexicon::LexUserType::String(::jacquard_lexicon::lexicon::LexString { + description: Some( + ::jacquard_common::CowStr::new_static( + "Why this notification was generated.", + ), + ), + format: None, + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "subscriptionUpdateView", + ), + ::jacquard_lexicon::lexicon::LexUserType::Object(::jacquard_lexicon::lexicon::LexObject { + description: Some( + ::jacquard_common::CowStr::new_static( + "New content from a notebook subscription.", + ), + ), + required: Some( + vec![ + ::jacquard_common::smol_str::SmolStr::new_static("notebook"), + ::jacquard_common::smol_str::SmolStr::new_static("newEntries"), + ::jacquard_common::smol_str::SmolStr::new_static("updatedAt") + ], + ), + nullable: None, + properties: { + #[allow(unused_mut)] + let mut map = ::std::collections::BTreeMap::new(); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "newEntries", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "New entries since last check.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#entryView", + ), + }), + min_length: None, + max_length: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static("notebook"), + ::jacquard_lexicon::lexicon::LexObjectProperty::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#notebookView", + ), + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "updatedAt", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::String(::jacquard_lexicon::lexicon::LexString { + description: None, + format: Some( + ::jacquard_lexicon::lexicon::LexStringFormat::Datetime, + ), + default: None, + min_length: None, + max_length: None, + min_graphemes: None, + max_graphemes: None, + r#enum: None, + r#const: None, + known_values: None, + }), + ); + map.insert( + ::jacquard_common::smol_str::SmolStr::new_static( + "updatedEntries", + ), + ::jacquard_lexicon::lexicon::LexObjectProperty::Array(::jacquard_lexicon::lexicon::LexArray { + description: Some( + ::jacquard_common::CowStr::new_static( + "Entries that were updated.", + ), + ), + items: ::jacquard_lexicon::lexicon::LexArrayItem::Ref(::jacquard_lexicon::lexicon::LexRef { + description: None, + r#ref: ::jacquard_common::CowStr::new_static( + "sh.weaver.notebook.defs#entryView", + ), + }), + min_length: None, + max_length: None, + }), + ); + map + }, + }), + ); + map + }, + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for Notification<'a> { + fn nsid() -> &'static str { + "sh.weaver.notification.defs" + } + fn def_name() -> &'static str { + "notification" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notification_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} + +/// Grouped notifications (e.g., '5 people liked your entry'). +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct NotificationGroup<'a> { + /// Most recent actors (up to 5). + #[serde(borrow)] + pub actors: Vec>, + pub count: i64, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub is_read: std::option::Option, + pub most_recent_at: jacquard_common::types::string::Datetime, + #[serde(borrow)] + pub reason: crate::sh_weaver::notification::NotificationReason<'a>, + #[serde(borrow)] + pub subject: NotificationGroupSubject<'a>, +} + +pub mod notification_group_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type Reason; + type Count; + type Actors; + type MostRecentAt; + type Subject; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type Reason = Unset; + type Count = Unset; + type Actors = Unset; + type MostRecentAt = Unset; + type Subject = Unset; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Reason = Set; + type Count = S::Count; + type Actors = S::Actors; + type MostRecentAt = S::MostRecentAt; + type Subject = S::Subject; + } + ///State transition - sets the `count` field to Set + pub struct SetCount(PhantomData S>); + impl sealed::Sealed for SetCount {} + impl State for SetCount { + type Reason = S::Reason; + type Count = Set; + type Actors = S::Actors; + type MostRecentAt = S::MostRecentAt; + type Subject = S::Subject; + } + ///State transition - sets the `actors` field to Set + pub struct SetActors(PhantomData S>); + impl sealed::Sealed for SetActors {} + impl State for SetActors { + type Reason = S::Reason; + type Count = S::Count; + type Actors = Set; + type MostRecentAt = S::MostRecentAt; + type Subject = S::Subject; + } + ///State transition - sets the `most_recent_at` field to Set + pub struct SetMostRecentAt(PhantomData S>); + impl sealed::Sealed for SetMostRecentAt {} + impl State for SetMostRecentAt { + type Reason = S::Reason; + type Count = S::Count; + type Actors = S::Actors; + type MostRecentAt = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Reason = S::Reason; + type Count = S::Count; + type Actors = S::Actors; + type MostRecentAt = S::MostRecentAt; + type Subject = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `reason` field + pub struct reason(()); + ///Marker type for the `count` field + pub struct count(()); + ///Marker type for the `actors` field + pub struct actors(()); + ///Marker type for the `most_recent_at` field + pub struct most_recent_at(()); + ///Marker type for the `subject` field + pub struct subject(()); + } +} + +/// Builder for constructing an instance of this type +pub struct NotificationGroupBuilder<'a, S: notification_group_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option, + ::core::option::Option>, + ::core::option::Option>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> NotificationGroup<'a> { + /// Create a new builder for this type + pub fn new() -> NotificationGroupBuilder<'a, notification_group_state::Empty> { + NotificationGroupBuilder::new() + } +} + +impl<'a> NotificationGroupBuilder<'a, notification_group_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + NotificationGroupBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationGroupBuilder<'a, S> +where + S: notification_group_state::State, + S::Actors: notification_group_state::IsUnset, +{ + /// Set the `actors` field (required) + pub fn actors( + mut self, + value: impl Into>>, + ) -> NotificationGroupBuilder<'a, notification_group_state::SetActors> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + NotificationGroupBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationGroupBuilder<'a, S> +where + S: notification_group_state::State, + S::Count: notification_group_state::IsUnset, +{ + /// Set the `count` field (required) + pub fn count( + mut self, + value: impl Into, + ) -> NotificationGroupBuilder<'a, notification_group_state::SetCount> { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + NotificationGroupBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: notification_group_state::State> NotificationGroupBuilder<'a, S> { + /// Set the `isRead` field (optional) + pub fn is_read(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `isRead` field to an Option value (optional) + pub fn maybe_is_read(mut self, value: Option) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> NotificationGroupBuilder<'a, S> +where + S: notification_group_state::State, + S::MostRecentAt: notification_group_state::IsUnset, +{ + /// Set the `mostRecentAt` field (required) + pub fn most_recent_at( + mut self, + value: impl Into, + ) -> NotificationGroupBuilder<'a, notification_group_state::SetMostRecentAt> { + self.__unsafe_private_named.3 = ::core::option::Option::Some(value.into()); + NotificationGroupBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationGroupBuilder<'a, S> +where + S: notification_group_state::State, + S::Reason: notification_group_state::IsUnset, +{ + /// Set the `reason` field (required) + pub fn reason( + mut self, + value: impl Into>, + ) -> NotificationGroupBuilder<'a, notification_group_state::SetReason> { + self.__unsafe_private_named.4 = ::core::option::Option::Some(value.into()); + NotificationGroupBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationGroupBuilder<'a, S> +where + S: notification_group_state::State, + S::Subject: notification_group_state::IsUnset, +{ + /// Set the `subject` field (required) + pub fn subject( + mut self, + value: impl Into>, + ) -> NotificationGroupBuilder<'a, notification_group_state::SetSubject> { + self.__unsafe_private_named.5 = ::core::option::Option::Some(value.into()); + NotificationGroupBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> NotificationGroupBuilder<'a, S> +where + S: notification_group_state::State, + S::Reason: notification_group_state::IsSet, + S::Count: notification_group_state::IsSet, + S::Actors: notification_group_state::IsSet, + S::MostRecentAt: notification_group_state::IsSet, + S::Subject: notification_group_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> NotificationGroup<'a> { + NotificationGroup { + actors: self.__unsafe_private_named.0.unwrap(), + count: self.__unsafe_private_named.1.unwrap(), + is_read: self.__unsafe_private_named.2, + most_recent_at: self.__unsafe_private_named.3.unwrap(), + reason: self.__unsafe_private_named.4.unwrap(), + subject: self.__unsafe_private_named.5.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> NotificationGroup<'a> { + NotificationGroup { + actors: self.__unsafe_private_named.0.unwrap(), + count: self.__unsafe_private_named.1.unwrap(), + is_read: self.__unsafe_private_named.2, + most_recent_at: self.__unsafe_private_named.3.unwrap(), + reason: self.__unsafe_private_named.4.unwrap(), + subject: self.__unsafe_private_named.5.unwrap(), + extra_data: Some(extra_data), + } + } +} + +#[jacquard_derive::open_union] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(tag = "$type")] +#[serde(bound(deserialize = "'de: 'a"))] +pub enum NotificationGroupSubject<'a> { + #[serde(rename = "sh.weaver.notebook.defs#notebookView")] + NotebookView(Box>), + #[serde(rename = "sh.weaver.notebook.defs#entryView")] + EntryView(Box>), +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for NotificationGroup<'a> { + fn nsid() -> &'static str { + "sh.weaver.notification.defs" + } + fn def_name() -> &'static str { + "notificationGroup" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notification_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + { + let value = &self.actors; + #[allow(unused_comparisons)] + if value.len() > 5usize { + return Err(::jacquard_lexicon::validation::ConstraintError::MaxLength { + path: ::jacquard_lexicon::validation::ValidationPath::from_field( + "actors", + ), + max: 5usize, + actual: value.len(), + }); + } + } + Ok(()) + } +} + +/// Why this notification was generated. +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub enum NotificationReason<'a> { + Like, + Bookmark, + Follow, + FollowAccept, + Subscribe, + SubscribeAccept, + CollaborationInvite, + CollaborationAccept, + NewEntry, + EntryUpdate, + Mention, + Tag, + Comment, + Other(jacquard_common::CowStr<'a>), +} + +impl<'a> NotificationReason<'a> { + pub fn as_str(&self) -> &str { + match self { + Self::Like => "like", + Self::Bookmark => "bookmark", + Self::Follow => "follow", + Self::FollowAccept => "followAccept", + Self::Subscribe => "subscribe", + Self::SubscribeAccept => "subscribeAccept", + Self::CollaborationInvite => "collaborationInvite", + Self::CollaborationAccept => "collaborationAccept", + Self::NewEntry => "newEntry", + Self::EntryUpdate => "entryUpdate", + Self::Mention => "mention", + Self::Tag => "tag", + Self::Comment => "comment", + Self::Other(s) => s.as_ref(), + } + } +} + +impl<'a> From<&'a str> for NotificationReason<'a> { + fn from(s: &'a str) -> Self { + match s { + "like" => Self::Like, + "bookmark" => Self::Bookmark, + "follow" => Self::Follow, + "followAccept" => Self::FollowAccept, + "subscribe" => Self::Subscribe, + "subscribeAccept" => Self::SubscribeAccept, + "collaborationInvite" => Self::CollaborationInvite, + "collaborationAccept" => Self::CollaborationAccept, + "newEntry" => Self::NewEntry, + "entryUpdate" => Self::EntryUpdate, + "mention" => Self::Mention, + "tag" => Self::Tag, + "comment" => Self::Comment, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> From for NotificationReason<'a> { + fn from(s: String) -> Self { + match s.as_str() { + "like" => Self::Like, + "bookmark" => Self::Bookmark, + "follow" => Self::Follow, + "followAccept" => Self::FollowAccept, + "subscribe" => Self::Subscribe, + "subscribeAccept" => Self::SubscribeAccept, + "collaborationInvite" => Self::CollaborationInvite, + "collaborationAccept" => Self::CollaborationAccept, + "newEntry" => Self::NewEntry, + "entryUpdate" => Self::EntryUpdate, + "mention" => Self::Mention, + "tag" => Self::Tag, + "comment" => Self::Comment, + _ => Self::Other(jacquard_common::CowStr::from(s)), + } + } +} + +impl<'a> AsRef for NotificationReason<'a> { + fn as_ref(&self) -> &str { + self.as_str() + } +} + +impl<'a> serde::Serialize for NotificationReason<'a> { + fn serialize(&self, serializer: S) -> Result + where + S: serde::Serializer, + { + serializer.serialize_str(self.as_str()) + } +} + +impl<'de, 'a> serde::Deserialize<'de> for NotificationReason<'a> +where + 'de: 'a, +{ + fn deserialize(deserializer: D) -> Result + where + D: serde::Deserializer<'de>, + { + let s = <&'de str>::deserialize(deserializer)?; + Ok(Self::from(s)) + } +} + +impl jacquard_common::IntoStatic for NotificationReason<'_> { + type Output = NotificationReason<'static>; + fn into_static(self) -> Self::Output { + match self { + NotificationReason::Like => NotificationReason::Like, + NotificationReason::Bookmark => NotificationReason::Bookmark, + NotificationReason::Follow => NotificationReason::Follow, + NotificationReason::FollowAccept => NotificationReason::FollowAccept, + NotificationReason::Subscribe => NotificationReason::Subscribe, + NotificationReason::SubscribeAccept => NotificationReason::SubscribeAccept, + NotificationReason::CollaborationInvite => { + NotificationReason::CollaborationInvite + } + NotificationReason::CollaborationAccept => { + NotificationReason::CollaborationAccept + } + NotificationReason::NewEntry => NotificationReason::NewEntry, + NotificationReason::EntryUpdate => NotificationReason::EntryUpdate, + NotificationReason::Mention => NotificationReason::Mention, + NotificationReason::Tag => NotificationReason::Tag, + NotificationReason::Comment => NotificationReason::Comment, + NotificationReason::Other(v) => NotificationReason::Other(v.into_static()), + } + } +} + +/// New content from a notebook subscription. +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct SubscriptionUpdateView<'a> { + /// New entries since last check. + #[serde(borrow)] + pub new_entries: Vec>, + #[serde(borrow)] + pub notebook: crate::sh_weaver::notebook::NotebookView<'a>, + pub updated_at: jacquard_common::types::string::Datetime, + /// Entries that were updated. + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub updated_entries: std::option::Option< + Vec>, + >, +} + +pub mod subscription_update_view_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type NewEntries; + type UpdatedAt; + type Notebook; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type NewEntries = Unset; + type UpdatedAt = Unset; + type Notebook = Unset; + } + ///State transition - sets the `new_entries` field to Set + pub struct SetNewEntries(PhantomData S>); + impl sealed::Sealed for SetNewEntries {} + impl State for SetNewEntries { + type NewEntries = Set; + type UpdatedAt = S::UpdatedAt; + type Notebook = S::Notebook; + } + ///State transition - sets the `updated_at` field to Set + pub struct SetUpdatedAt(PhantomData S>); + impl sealed::Sealed for SetUpdatedAt {} + impl State for SetUpdatedAt { + type NewEntries = S::NewEntries; + type UpdatedAt = Set; + type Notebook = S::Notebook; + } + ///State transition - sets the `notebook` field to Set + pub struct SetNotebook(PhantomData S>); + impl sealed::Sealed for SetNotebook {} + impl State for SetNotebook { + type NewEntries = S::NewEntries; + type UpdatedAt = S::UpdatedAt; + type Notebook = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `new_entries` field + pub struct new_entries(()); + ///Marker type for the `updated_at` field + pub struct updated_at(()); + ///Marker type for the `notebook` field + pub struct notebook(()); + } +} + +/// Builder for constructing an instance of this type +pub struct SubscriptionUpdateViewBuilder<'a, S: subscription_update_view_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>>, + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option>>, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> SubscriptionUpdateView<'a> { + /// Create a new builder for this type + pub fn new() -> SubscriptionUpdateViewBuilder< + 'a, + subscription_update_view_state::Empty, + > { + SubscriptionUpdateViewBuilder::new() + } +} + +impl<'a> SubscriptionUpdateViewBuilder<'a, subscription_update_view_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + SubscriptionUpdateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubscriptionUpdateViewBuilder<'a, S> +where + S: subscription_update_view_state::State, + S::NewEntries: subscription_update_view_state::IsUnset, +{ + /// Set the `newEntries` field (required) + pub fn new_entries( + mut self, + value: impl Into>>, + ) -> SubscriptionUpdateViewBuilder< + 'a, + subscription_update_view_state::SetNewEntries, + > { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + SubscriptionUpdateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubscriptionUpdateViewBuilder<'a, S> +where + S: subscription_update_view_state::State, + S::Notebook: subscription_update_view_state::IsUnset, +{ + /// Set the `notebook` field (required) + pub fn notebook( + mut self, + value: impl Into>, + ) -> SubscriptionUpdateViewBuilder< + 'a, + subscription_update_view_state::SetNotebook, + > { + self.__unsafe_private_named.1 = ::core::option::Option::Some(value.into()); + SubscriptionUpdateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> SubscriptionUpdateViewBuilder<'a, S> +where + S: subscription_update_view_state::State, + S::UpdatedAt: subscription_update_view_state::IsUnset, +{ + /// Set the `updatedAt` field (required) + pub fn updated_at( + mut self, + value: impl Into, + ) -> SubscriptionUpdateViewBuilder< + 'a, + subscription_update_view_state::SetUpdatedAt, + > { + self.__unsafe_private_named.2 = ::core::option::Option::Some(value.into()); + SubscriptionUpdateViewBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: subscription_update_view_state::State> SubscriptionUpdateViewBuilder<'a, S> { + /// Set the `updatedEntries` field (optional) + pub fn updated_entries( + mut self, + value: impl Into>>>, + ) -> Self { + self.__unsafe_private_named.3 = value.into(); + self + } + /// Set the `updatedEntries` field to an Option value (optional) + pub fn maybe_updated_entries( + mut self, + value: Option>>, + ) -> Self { + self.__unsafe_private_named.3 = value; + self + } +} + +impl<'a, S> SubscriptionUpdateViewBuilder<'a, S> +where + S: subscription_update_view_state::State, + S::NewEntries: subscription_update_view_state::IsSet, + S::UpdatedAt: subscription_update_view_state::IsSet, + S::Notebook: subscription_update_view_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> SubscriptionUpdateView<'a> { + SubscriptionUpdateView { + new_entries: self.__unsafe_private_named.0.unwrap(), + notebook: self.__unsafe_private_named.1.unwrap(), + updated_at: self.__unsafe_private_named.2.unwrap(), + updated_entries: self.__unsafe_private_named.3, + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> SubscriptionUpdateView<'a> { + SubscriptionUpdateView { + new_entries: self.__unsafe_private_named.0.unwrap(), + notebook: self.__unsafe_private_named.1.unwrap(), + updated_at: self.__unsafe_private_named.2.unwrap(), + updated_entries: self.__unsafe_private_named.3, + extra_data: Some(extra_data), + } + } +} + +impl<'a> ::jacquard_lexicon::schema::LexiconSchema for SubscriptionUpdateView<'a> { + fn nsid() -> &'static str { + "sh.weaver.notification.defs" + } + fn def_name() -> &'static str { + "subscriptionUpdateView" + } + fn lexicon_doc() -> ::jacquard_lexicon::lexicon::LexiconDoc<'static> { + lexicon_doc_sh_weaver_notification_defs() + } + fn validate( + &self, + ) -> ::std::result::Result<(), ::jacquard_lexicon::validation::ConstraintError> { + Ok(()) + } +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notification/get_subscription_updates.rs b/crates/weaver-api/src/sh_weaver/notification/get_subscription_updates.rs new file mode 100644 index 0000000..b0e3ad4 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notification/get_subscription_updates.rs @@ -0,0 +1,185 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notification.getSubscriptionUpdates +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetSubscriptionUpdates<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + ///(default: 20, min: 1, max: 50) + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub limit: std::option::Option, + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub since: std::option::Option, +} + +pub mod get_subscription_updates_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct GetSubscriptionUpdatesBuilder<'a, S: get_subscription_updates_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option>, + ::core::option::Option, + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> GetSubscriptionUpdates<'a> { + /// Create a new builder for this type + pub fn new() -> GetSubscriptionUpdatesBuilder< + 'a, + get_subscription_updates_state::Empty, + > { + GetSubscriptionUpdatesBuilder::new() + } +} + +impl<'a> GetSubscriptionUpdatesBuilder<'a, get_subscription_updates_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetSubscriptionUpdatesBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None, None, None), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S: get_subscription_updates_state::State> GetSubscriptionUpdatesBuilder<'a, S> { + /// Set the `cursor` field (optional) + pub fn cursor( + mut self, + value: impl Into>>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `cursor` field to an Option value (optional) + pub fn maybe_cursor(mut self, value: Option>) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl<'a, S: get_subscription_updates_state::State> GetSubscriptionUpdatesBuilder<'a, S> { + /// Set the `limit` field (optional) + pub fn limit(mut self, value: impl Into>) -> Self { + self.__unsafe_private_named.1 = value.into(); + self + } + /// Set the `limit` field to an Option value (optional) + pub fn maybe_limit(mut self, value: Option) -> Self { + self.__unsafe_private_named.1 = value; + self + } +} + +impl<'a, S: get_subscription_updates_state::State> GetSubscriptionUpdatesBuilder<'a, S> { + /// Set the `since` field (optional) + pub fn since( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.2 = value.into(); + self + } + /// Set the `since` field to an Option value (optional) + pub fn maybe_since( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.2 = value; + self + } +} + +impl<'a, S> GetSubscriptionUpdatesBuilder<'a, S> +where + S: get_subscription_updates_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetSubscriptionUpdates<'a> { + GetSubscriptionUpdates { + cursor: self.__unsafe_private_named.0, + limit: self.__unsafe_private_named.1, + since: self.__unsafe_private_named.2, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetSubscriptionUpdatesOutput<'a> { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + #[serde(borrow)] + pub cursor: std::option::Option>, + #[serde(borrow)] + pub updates: Vec>, +} + +/// Response type for +///sh.weaver.notification.getSubscriptionUpdates +pub struct GetSubscriptionUpdatesResponse; +impl jacquard_common::xrpc::XrpcResp for GetSubscriptionUpdatesResponse { + const NSID: &'static str = "sh.weaver.notification.getSubscriptionUpdates"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetSubscriptionUpdatesOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for GetSubscriptionUpdates<'a> { + const NSID: &'static str = "sh.weaver.notification.getSubscriptionUpdates"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetSubscriptionUpdatesResponse; +} + +/// Endpoint type for +///sh.weaver.notification.getSubscriptionUpdates +pub struct GetSubscriptionUpdatesRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetSubscriptionUpdatesRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notification.getSubscriptionUpdates"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetSubscriptionUpdates<'de>; + type Response = GetSubscriptionUpdatesResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notification/get_unread_count.rs b/crates/weaver-api/src/sh_weaver/notification/get_unread_count.rs new file mode 100644 index 0000000..24e0b83 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notification/get_unread_count.rs @@ -0,0 +1,137 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notification.getUnreadCount +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetUnreadCount { + #[serde(skip_serializing_if = "std::option::Option::is_none")] + pub seen_at: std::option::Option, +} + +pub mod get_unread_count_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed {} + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty {} + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members {} +} + +/// Builder for constructing an instance of this type +pub struct GetUnreadCountBuilder { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ), +} + +impl GetUnreadCount { + /// Create a new builder for this type + pub fn new() -> GetUnreadCountBuilder { + GetUnreadCountBuilder::new() + } +} + +impl GetUnreadCountBuilder { + /// Create a new builder with all fields unset + pub fn new() -> Self { + GetUnreadCountBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + } + } +} + +impl GetUnreadCountBuilder { + /// Set the `seenAt` field (optional) + pub fn seen_at( + mut self, + value: impl Into>, + ) -> Self { + self.__unsafe_private_named.0 = value.into(); + self + } + /// Set the `seenAt` field to an Option value (optional) + pub fn maybe_seen_at( + mut self, + value: Option, + ) -> Self { + self.__unsafe_private_named.0 = value; + self + } +} + +impl GetUnreadCountBuilder +where + S: get_unread_count_state::State, +{ + /// Build the final struct + pub fn build(self) -> GetUnreadCount { + GetUnreadCount { + seen_at: self.__unsafe_private_named.0, + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct GetUnreadCountOutput<'a> { + pub count: i64, +} + +/// Response type for +///sh.weaver.notification.getUnreadCount +pub struct GetUnreadCountResponse; +impl jacquard_common::xrpc::XrpcResp for GetUnreadCountResponse { + const NSID: &'static str = "sh.weaver.notification.getUnreadCount"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = GetUnreadCountOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl jacquard_common::xrpc::XrpcRequest for GetUnreadCount { + const NSID: &'static str = "sh.weaver.notification.getUnreadCount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Response = GetUnreadCountResponse; +} + +/// Endpoint type for +///sh.weaver.notification.getUnreadCount +pub struct GetUnreadCountRequest; +impl jacquard_common::xrpc::XrpcEndpoint for GetUnreadCountRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notification.getUnreadCount"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query; + type Request<'de> = GetUnreadCount; + type Response = GetUnreadCountResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/sh_weaver/notification/update_seen.rs b/crates/weaver-api/src/sh_weaver/notification/update_seen.rs new file mode 100644 index 0000000..5dc1198 --- /dev/null +++ b/crates/weaver-api/src/sh_weaver/notification/update_seen.rs @@ -0,0 +1,169 @@ +// @generated by jacquard-lexicon. DO NOT EDIT. +// +// Lexicon: sh.weaver.notification.updateSeen +// +// This file was automatically generated from Lexicon schemas. +// Any manual changes will be overwritten on the next regeneration. + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateSeen<'a> { + pub seen_at: jacquard_common::types::string::Datetime, +} + +pub mod update_seen_state { + + pub use crate::builder_types::{Set, Unset, IsSet, IsUnset}; + #[allow(unused)] + use ::core::marker::PhantomData; + mod sealed { + pub trait Sealed {} + } + /// State trait tracking which required fields have been set + pub trait State: sealed::Sealed { + type SeenAt; + } + /// Empty state - all required fields are unset + pub struct Empty(()); + impl sealed::Sealed for Empty {} + impl State for Empty { + type SeenAt = Unset; + } + ///State transition - sets the `seen_at` field to Set + pub struct SetSeenAt(PhantomData S>); + impl sealed::Sealed for SetSeenAt {} + impl State for SetSeenAt { + type SeenAt = Set; + } + /// Marker types for field names + #[allow(non_camel_case_types)] + pub mod members { + ///Marker type for the `seen_at` field + pub struct seen_at(()); + } +} + +/// Builder for constructing an instance of this type +pub struct UpdateSeenBuilder<'a, S: update_seen_state::State> { + _phantom_state: ::core::marker::PhantomData S>, + __unsafe_private_named: ( + ::core::option::Option, + ), + _phantom: ::core::marker::PhantomData<&'a ()>, +} + +impl<'a> UpdateSeen<'a> { + /// Create a new builder for this type + pub fn new() -> UpdateSeenBuilder<'a, update_seen_state::Empty> { + UpdateSeenBuilder::new() + } +} + +impl<'a> UpdateSeenBuilder<'a, update_seen_state::Empty> { + /// Create a new builder with all fields unset + pub fn new() -> Self { + UpdateSeenBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: (None,), + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateSeenBuilder<'a, S> +where + S: update_seen_state::State, + S::SeenAt: update_seen_state::IsUnset, +{ + /// Set the `seenAt` field (required) + pub fn seen_at( + mut self, + value: impl Into, + ) -> UpdateSeenBuilder<'a, update_seen_state::SetSeenAt> { + self.__unsafe_private_named.0 = ::core::option::Option::Some(value.into()); + UpdateSeenBuilder { + _phantom_state: ::core::marker::PhantomData, + __unsafe_private_named: self.__unsafe_private_named, + _phantom: ::core::marker::PhantomData, + } + } +} + +impl<'a, S> UpdateSeenBuilder<'a, S> +where + S: update_seen_state::State, + S::SeenAt: update_seen_state::IsSet, +{ + /// Build the final struct + pub fn build(self) -> UpdateSeen<'a> { + UpdateSeen { + seen_at: self.__unsafe_private_named.0.unwrap(), + extra_data: Default::default(), + } + } + /// Build the final struct with custom extra_data + pub fn build_with_data( + self, + extra_data: std::collections::BTreeMap< + jacquard_common::smol_str::SmolStr, + jacquard_common::types::value::Data<'a>, + >, + ) -> UpdateSeen<'a> { + UpdateSeen { + seen_at: self.__unsafe_private_named.0.unwrap(), + extra_data: Some(extra_data), + } + } +} + +#[jacquard_derive::lexicon] +#[derive( + serde::Serialize, + serde::Deserialize, + Debug, + Clone, + PartialEq, + Eq, + jacquard_derive::IntoStatic, + Default +)] +#[serde(rename_all = "camelCase")] +pub struct UpdateSeenOutput<'a> {} +/// Response type for +///sh.weaver.notification.updateSeen +pub struct UpdateSeenResponse; +impl jacquard_common::xrpc::XrpcResp for UpdateSeenResponse { + const NSID: &'static str = "sh.weaver.notification.updateSeen"; + const ENCODING: &'static str = "application/json"; + type Output<'de> = UpdateSeenOutput<'de>; + type Err<'de> = jacquard_common::xrpc::GenericError<'de>; +} + +impl<'a> jacquard_common::xrpc::XrpcRequest for UpdateSeen<'a> { + const NSID: &'static str = "sh.weaver.notification.updateSeen"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Response = UpdateSeenResponse; +} + +/// Endpoint type for +///sh.weaver.notification.updateSeen +pub struct UpdateSeenRequest; +impl jacquard_common::xrpc::XrpcEndpoint for UpdateSeenRequest { + const PATH: &'static str = "/xrpc/sh.weaver.notification.updateSeen"; + const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Procedure( + "application/json", + ); + type Request<'de> = UpdateSeen<'de>; + type Response = UpdateSeenResponse; +} \ No newline at end of file diff --git a/crates/weaver-api/src/tools_ozone/communication.rs b/crates/weaver-api/src/tools_ozone/communication.rs index 3b4759f..8c97541 100644 --- a/crates/weaver-api/src/tools_ozone/communication.rs +++ b/crates/weaver-api/src/tools_ozone/communication.rs @@ -55,10 +55,10 @@ pub mod template_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Disabled; type LastUpdatedBy; - type ContentMarkdown; type UpdatedAt; - type Disabled; + type ContentMarkdown; type Name; type CreatedAt; type Id; @@ -67,34 +67,34 @@ pub mod template_view_state { pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Disabled = Unset; type LastUpdatedBy = Unset; - type ContentMarkdown = Unset; type UpdatedAt = Unset; - type Disabled = Unset; + type ContentMarkdown = Unset; type Name = Unset; type CreatedAt = Unset; type Id = Unset; } - ///State transition - sets the `last_updated_by` field to Set - pub struct SetLastUpdatedBy(PhantomData S>); - impl sealed::Sealed for SetLastUpdatedBy {} - impl State for SetLastUpdatedBy { - type LastUpdatedBy = Set; - type ContentMarkdown = S::ContentMarkdown; + ///State transition - sets the `disabled` field to Set + pub struct SetDisabled(PhantomData S>); + impl sealed::Sealed for SetDisabled {} + impl State for SetDisabled { + type Disabled = Set; + type LastUpdatedBy = S::LastUpdatedBy; type UpdatedAt = S::UpdatedAt; - type Disabled = S::Disabled; + type ContentMarkdown = S::ContentMarkdown; type Name = S::Name; type CreatedAt = S::CreatedAt; type Id = S::Id; } - ///State transition - sets the `content_markdown` field to Set - pub struct SetContentMarkdown(PhantomData S>); - impl sealed::Sealed for SetContentMarkdown {} - impl State for SetContentMarkdown { - type LastUpdatedBy = S::LastUpdatedBy; - type ContentMarkdown = Set; - type UpdatedAt = S::UpdatedAt; + ///State transition - sets the `last_updated_by` field to Set + pub struct SetLastUpdatedBy(PhantomData S>); + impl sealed::Sealed for SetLastUpdatedBy {} + impl State for SetLastUpdatedBy { type Disabled = S::Disabled; + type LastUpdatedBy = Set; + type UpdatedAt = S::UpdatedAt; + type ContentMarkdown = S::ContentMarkdown; type Name = S::Name; type CreatedAt = S::CreatedAt; type Id = S::Id; @@ -103,22 +103,22 @@ pub mod template_view_state { pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { + type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; - type ContentMarkdown = S::ContentMarkdown; type UpdatedAt = Set; - type Disabled = S::Disabled; + type ContentMarkdown = S::ContentMarkdown; type Name = S::Name; type CreatedAt = S::CreatedAt; type Id = S::Id; } - ///State transition - sets the `disabled` field to Set - pub struct SetDisabled(PhantomData S>); - impl sealed::Sealed for SetDisabled {} - impl State for SetDisabled { + ///State transition - sets the `content_markdown` field to Set + pub struct SetContentMarkdown(PhantomData S>); + impl sealed::Sealed for SetContentMarkdown {} + impl State for SetContentMarkdown { + type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; - type ContentMarkdown = S::ContentMarkdown; type UpdatedAt = S::UpdatedAt; - type Disabled = Set; + type ContentMarkdown = Set; type Name = S::Name; type CreatedAt = S::CreatedAt; type Id = S::Id; @@ -127,10 +127,10 @@ pub mod template_view_state { pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { + type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; - type ContentMarkdown = S::ContentMarkdown; type UpdatedAt = S::UpdatedAt; - type Disabled = S::Disabled; + type ContentMarkdown = S::ContentMarkdown; type Name = Set; type CreatedAt = S::CreatedAt; type Id = S::Id; @@ -139,10 +139,10 @@ pub mod template_view_state { pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { + type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; - type ContentMarkdown = S::ContentMarkdown; type UpdatedAt = S::UpdatedAt; - type Disabled = S::Disabled; + type ContentMarkdown = S::ContentMarkdown; type Name = S::Name; type CreatedAt = Set; type Id = S::Id; @@ -151,10 +151,10 @@ pub mod template_view_state { pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { + type Disabled = S::Disabled; type LastUpdatedBy = S::LastUpdatedBy; - type ContentMarkdown = S::ContentMarkdown; type UpdatedAt = S::UpdatedAt; - type Disabled = S::Disabled; + type ContentMarkdown = S::ContentMarkdown; type Name = S::Name; type CreatedAt = S::CreatedAt; type Id = Set; @@ -162,14 +162,14 @@ pub mod template_view_state { /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `disabled` field + pub struct disabled(()); ///Marker type for the `last_updated_by` field pub struct last_updated_by(()); - ///Marker type for the `content_markdown` field - pub struct content_markdown(()); ///Marker type for the `updated_at` field pub struct updated_at(()); - ///Marker type for the `disabled` field - pub struct disabled(()); + ///Marker type for the `content_markdown` field + pub struct content_markdown(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `created_at` field @@ -395,10 +395,10 @@ where impl<'a, S> TemplateViewBuilder<'a, S> where S: template_view_state::State, + S::Disabled: template_view_state::IsSet, S::LastUpdatedBy: template_view_state::IsSet, - S::ContentMarkdown: template_view_state::IsSet, S::UpdatedAt: template_view_state::IsSet, - S::Disabled: template_view_state::IsSet, + S::ContentMarkdown: template_view_state::IsSet, S::Name: template_view_state::IsSet, S::CreatedAt: template_view_state::IsSet, S::Id: template_view_state::IsSet, diff --git a/crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs b/crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs index 41af3c9..b8ee1f3 100644 --- a/crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs +++ b/crates/weaver-api/src/tools_ozone/hosting/get_account_history.rs @@ -463,50 +463,50 @@ pub mod event_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type CreatedBy; - type CreatedAt; type Details; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type CreatedBy = Unset; - type CreatedAt = Unset; type Details = Unset; + type CreatedAt = Unset; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { type CreatedBy = Set; - type CreatedAt = S::CreatedAt; - type Details = S::Details; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedBy = S::CreatedBy; - type CreatedAt = Set; type Details = S::Details; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `details` field to Set pub struct SetDetails(PhantomData S>); impl sealed::Sealed for SetDetails {} impl State for SetDetails { type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; type Details = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedBy = S::CreatedBy; + type Details = S::Details; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `created_by` field pub struct created_by(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `details` field pub struct details(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -600,8 +600,8 @@ impl<'a, S> EventBuilder<'a, S> where S: event_state::State, S::CreatedBy: event_state::IsSet, - S::CreatedAt: event_state::IsSet, S::Details: event_state::IsSet, + S::CreatedAt: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { diff --git a/crates/weaver-api/src/tools_ozone/moderation.rs b/crates/weaver-api/src/tools_ozone/moderation.rs index 02c2b26..f721668 100644 --- a/crates/weaver-api/src/tools_ozone/moderation.rs +++ b/crates/weaver-api/src/tools_ozone/moderation.rs @@ -5098,50 +5098,50 @@ pub mod age_assurance_event_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type CreatedAt; - type Status; type AttemptId; + type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type CreatedAt = Unset; - type Status = Unset; type AttemptId = Unset; + type Status = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type CreatedAt = Set; - type Status = S::Status; - type AttemptId = S::AttemptId; - } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { - type CreatedAt = S::CreatedAt; - type Status = Set; type AttemptId = S::AttemptId; + type Status = S::Status; } ///State transition - sets the `attempt_id` field to Set pub struct SetAttemptId(PhantomData S>); impl sealed::Sealed for SetAttemptId {} impl State for SetAttemptId { type CreatedAt = S::CreatedAt; - type Status = S::Status; type AttemptId = Set; + type Status = S::Status; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { + type CreatedAt = S::CreatedAt; + type AttemptId = S::AttemptId; + type Status = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `status` field - pub struct status(()); ///Marker type for the `attempt_id` field pub struct attempt_id(()); + ///Marker type for the `status` field + pub struct status(()); } } @@ -5380,8 +5380,8 @@ impl<'a, S> AgeAssuranceEventBuilder<'a, S> where S: age_assurance_event_state::State, S::CreatedAt: age_assurance_event_state::IsSet, - S::Status: age_assurance_event_state::IsSet, S::AttemptId: age_assurance_event_state::IsSet, + S::Status: age_assurance_event_state::IsSet, { /// Build the final struct pub fn build(self) -> AgeAssuranceEvent<'a> { @@ -5518,67 +5518,67 @@ pub mod blob_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedAt; type Cid; - type Size; type MimeType; + type Size; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedAt = Unset; type Cid = Unset; - type Size = Unset; type MimeType = Unset; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedAt = Set; - type Cid = S::Cid; - type Size = S::Size; - type MimeType = S::MimeType; + type Size = Unset; + type CreatedAt = Unset; } ///State transition - sets the `cid` field to Set pub struct SetCid(PhantomData S>); impl sealed::Sealed for SetCid {} impl State for SetCid { - type CreatedAt = S::CreatedAt; type Cid = Set; - type Size = S::Size; type MimeType = S::MimeType; + type Size = S::Size; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `mime_type` field to Set + pub struct SetMimeType(PhantomData S>); + impl sealed::Sealed for SetMimeType {} + impl State for SetMimeType { + type Cid = S::Cid; + type MimeType = Set; + type Size = S::Size; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `size` field to Set pub struct SetSize(PhantomData S>); impl sealed::Sealed for SetSize {} impl State for SetSize { - type CreatedAt = S::CreatedAt; type Cid = S::Cid; - type Size = Set; type MimeType = S::MimeType; - } - ///State transition - sets the `mime_type` field to Set - pub struct SetMimeType(PhantomData S>); - impl sealed::Sealed for SetMimeType {} - impl State for SetMimeType { + type Size = Set; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { type Cid = S::Cid; + type MimeType = S::MimeType; type Size = S::Size; - type MimeType = Set; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `size` field - pub struct size(()); ///Marker type for the `mime_type` field pub struct mime_type(()); + ///Marker type for the `size` field + pub struct size(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -5725,10 +5725,10 @@ where impl<'a, S> BlobViewBuilder<'a, S> where S: blob_view_state::State, - S::CreatedAt: blob_view_state::IsSet, S::Cid: blob_view_state::IsSet, - S::Size: blob_view_state::IsSet, S::MimeType: blob_view_state::IsSet, + S::Size: blob_view_state::IsSet, + S::CreatedAt: blob_view_state::IsSet, { /// Build the final struct pub fn build(self) -> BlobView<'a> { @@ -6088,37 +6088,37 @@ pub mod image_details_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Width; type Height; + type Width; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Width = Unset; type Height = Unset; - } - ///State transition - sets the `width` field to Set - pub struct SetWidth(PhantomData S>); - impl sealed::Sealed for SetWidth {} - impl State for SetWidth { - type Width = Set; - type Height = S::Height; + type Width = Unset; } ///State transition - sets the `height` field to Set pub struct SetHeight(PhantomData S>); impl sealed::Sealed for SetHeight {} impl State for SetHeight { - type Width = S::Width; type Height = Set; + type Width = S::Width; + } + ///State transition - sets the `width` field to Set + pub struct SetWidth(PhantomData S>); + impl sealed::Sealed for SetWidth {} + impl State for SetWidth { + type Height = S::Height; + type Width = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `width` field - pub struct width(()); ///Marker type for the `height` field pub struct height(()); + ///Marker type for the `width` field + pub struct width(()); } } @@ -6188,8 +6188,8 @@ where impl<'a, S> ImageDetailsBuilder<'a, S> where S: image_details_state::State, - S::Width: image_details_state::IsSet, S::Height: image_details_state::IsSet, + S::Width: image_details_state::IsSet, { /// Build the final struct pub fn build(self) -> ImageDetails<'a> { @@ -7724,105 +7724,105 @@ pub mod mod_event_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedBy; - type CreatedAt; type Id; type Event; - type Subject; type SubjectBlobCids; + type Subject; + type CreatedBy; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedBy = Unset; - type CreatedAt = Unset; type Id = Unset; type Event = Unset; - type Subject = Unset; type SubjectBlobCids = Unset; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type CreatedBy = Set; - type CreatedAt = S::CreatedAt; - type Id = S::Id; - type Event = S::Event; - type Subject = S::Subject; - type SubjectBlobCids = S::SubjectBlobCids; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedBy = S::CreatedBy; - type CreatedAt = Set; - type Id = S::Id; - type Event = S::Event; - type Subject = S::Subject; - type SubjectBlobCids = S::SubjectBlobCids; + type Subject = Unset; + type CreatedBy = Unset; + type CreatedAt = Unset; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; type Id = Set; type Event = S::Event; - type Subject = S::Subject; type SubjectBlobCids = S::SubjectBlobCids; + type Subject = S::Subject; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `event` field to Set pub struct SetEvent(PhantomData S>); impl sealed::Sealed for SetEvent {} impl State for SetEvent { + type Id = S::Id; + type Event = Set; + type SubjectBlobCids = S::SubjectBlobCids; + type Subject = S::Subject; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `subject_blob_cids` field to Set + pub struct SetSubjectBlobCids(PhantomData S>); + impl sealed::Sealed for SetSubjectBlobCids {} + impl State for SetSubjectBlobCids { type Id = S::Id; - type Event = Set; + type Event = S::Event; + type SubjectBlobCids = Set; type Subject = S::Subject; - type SubjectBlobCids = S::SubjectBlobCids; + type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { + type Id = S::Id; + type Event = S::Event; + type SubjectBlobCids = S::SubjectBlobCids; + type Subject = Set; type CreatedBy = S::CreatedBy; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { type Id = S::Id; type Event = S::Event; - type Subject = Set; type SubjectBlobCids = S::SubjectBlobCids; - } - ///State transition - sets the `subject_blob_cids` field to Set - pub struct SetSubjectBlobCids(PhantomData S>); - impl sealed::Sealed for SetSubjectBlobCids {} - impl State for SetSubjectBlobCids { - type CreatedBy = S::CreatedBy; + type Subject = S::Subject; + type CreatedBy = Set; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { type Id = S::Id; type Event = S::Event; + type SubjectBlobCids = S::SubjectBlobCids; type Subject = S::Subject; - type SubjectBlobCids = Set; + type CreatedBy = S::CreatedBy; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_by` field - pub struct created_by(()); - ///Marker type for the `created_at` field - pub struct created_at(()); ///Marker type for the `id` field pub struct id(()); ///Marker type for the `event` field pub struct event(()); - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `subject_blob_cids` field pub struct subject_blob_cids(()); + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -8045,12 +8045,12 @@ impl<'a, S: mod_event_view_state::State> ModEventViewBuilder<'a, S> { impl<'a, S> ModEventViewBuilder<'a, S> where S: mod_event_view_state::State, - S::CreatedBy: mod_event_view_state::IsSet, - S::CreatedAt: mod_event_view_state::IsSet, S::Id: mod_event_view_state::IsSet, S::Event: mod_event_view_state::IsSet, - S::Subject: mod_event_view_state::IsSet, S::SubjectBlobCids: mod_event_view_state::IsSet, + S::Subject: mod_event_view_state::IsSet, + S::CreatedBy: mod_event_view_state::IsSet, + S::CreatedAt: mod_event_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventView<'a> { @@ -8244,105 +8244,105 @@ pub mod mod_event_view_detail_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedBy; - type SubjectBlobs; - type Event; type CreatedAt; type Subject; type Id; + type SubjectBlobs; + type Event; + type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedBy = Unset; - type SubjectBlobs = Unset; - type Event = Unset; type CreatedAt = Unset; type Subject = Unset; type Id = Unset; + type SubjectBlobs = Unset; + type Event = Unset; + type CreatedBy = Unset; } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type CreatedBy = Set; - type SubjectBlobs = S::SubjectBlobs; - type Event = S::Event; - type CreatedAt = S::CreatedAt; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; type Subject = S::Subject; type Id = S::Id; - } - ///State transition - sets the `subject_blobs` field to Set - pub struct SetSubjectBlobs(PhantomData S>); - impl sealed::Sealed for SetSubjectBlobs {} - impl State for SetSubjectBlobs { - type CreatedBy = S::CreatedBy; - type SubjectBlobs = Set; + type SubjectBlobs = S::SubjectBlobs; type Event = S::Event; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { type CreatedAt = S::CreatedAt; - type Subject = S::Subject; + type Subject = Set; type Id = S::Id; - } - ///State transition - sets the `event` field to Set - pub struct SetEvent(PhantomData S>); - impl sealed::Sealed for SetEvent {} - impl State for SetEvent { - type CreatedBy = S::CreatedBy; type SubjectBlobs = S::SubjectBlobs; - type Event = Set; + type Event = S::Event; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { type CreatedAt = S::CreatedAt; type Subject = S::Subject; - type Id = S::Id; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedBy = S::CreatedBy; + type Id = Set; type SubjectBlobs = S::SubjectBlobs; type Event = S::Event; - type CreatedAt = Set; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `subject_blobs` field to Set + pub struct SetSubjectBlobs(PhantomData S>); + impl sealed::Sealed for SetSubjectBlobs {} + impl State for SetSubjectBlobs { + type CreatedAt = S::CreatedAt; type Subject = S::Subject; type Id = S::Id; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type CreatedBy = S::CreatedBy; - type SubjectBlobs = S::SubjectBlobs; + type SubjectBlobs = Set; type Event = S::Event; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `event` field to Set + pub struct SetEvent(PhantomData S>); + impl sealed::Sealed for SetEvent {} + impl State for SetEvent { type CreatedAt = S::CreatedAt; - type Subject = Set; + type Subject = S::Subject; type Id = S::Id; - } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type CreatedBy = S::CreatedBy; type SubjectBlobs = S::SubjectBlobs; - type Event = S::Event; + type Event = Set; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { type CreatedAt = S::CreatedAt; type Subject = S::Subject; - type Id = Set; + type Id = S::Id; + type SubjectBlobs = S::SubjectBlobs; + type Event = S::Event; + type CreatedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_by` field - pub struct created_by(()); - ///Marker type for the `subject_blobs` field - pub struct subject_blobs(()); - ///Marker type for the `event` field - pub struct event(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `subject` field pub struct subject(()); ///Marker type for the `id` field pub struct id(()); + ///Marker type for the `subject_blobs` field + pub struct subject_blobs(()); + ///Marker type for the `event` field + pub struct event(()); + ///Marker type for the `created_by` field + pub struct created_by(()); } } @@ -8515,12 +8515,12 @@ where impl<'a, S> ModEventViewDetailBuilder<'a, S> where S: mod_event_view_detail_state::State, - S::CreatedBy: mod_event_view_detail_state::IsSet, - S::SubjectBlobs: mod_event_view_detail_state::IsSet, - S::Event: mod_event_view_detail_state::IsSet, S::CreatedAt: mod_event_view_detail_state::IsSet, S::Subject: mod_event_view_detail_state::IsSet, S::Id: mod_event_view_detail_state::IsSet, + S::SubjectBlobs: mod_event_view_detail_state::IsSet, + S::Event: mod_event_view_detail_state::IsSet, + S::CreatedBy: mod_event_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> ModEventViewDetail<'a> { @@ -9088,127 +9088,127 @@ pub mod record_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type Value; + type BlobCids; + type Repo; type Uri; type Cid; - type BlobCids; - type Moderation; type IndexedAt; - type Value; - type Repo; + type Moderation; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type Value = Unset; + type BlobCids = Unset; + type Repo = Unset; type Uri = Unset; type Cid = Unset; - type BlobCids = Unset; - type Moderation = Unset; type IndexedAt = Unset; - type Value = Unset; - type Repo = Unset; + type Moderation = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Cid = S::Cid; + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { + type Value = Set; type BlobCids = S::BlobCids; - type Moderation = S::Moderation; - type IndexedAt = S::IndexedAt; - type Value = S::Value; type Repo = S::Repo; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { type Uri = S::Uri; - type Cid = Set; - type BlobCids = S::BlobCids; - type Moderation = S::Moderation; + type Cid = S::Cid; type IndexedAt = S::IndexedAt; - type Value = S::Value; - type Repo = S::Repo; + type Moderation = S::Moderation; } ///State transition - sets the `blob_cids` field to Set pub struct SetBlobCids(PhantomData S>); impl sealed::Sealed for SetBlobCids {} impl State for SetBlobCids { + type Value = S::Value; + type BlobCids = Set; + type Repo = S::Repo; type Uri = S::Uri; type Cid = S::Cid; - type BlobCids = Set; - type Moderation = S::Moderation; type IndexedAt = S::IndexedAt; - type Value = S::Value; - type Repo = S::Repo; + type Moderation = S::Moderation; } - ///State transition - sets the `moderation` field to Set - pub struct SetModeration(PhantomData S>); - impl sealed::Sealed for SetModeration {} - impl State for SetModeration { + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { + type Value = S::Value; + type BlobCids = S::BlobCids; + type Repo = Set; type Uri = S::Uri; type Cid = S::Cid; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Value = S::Value; type BlobCids = S::BlobCids; - type Moderation = Set; + type Repo = S::Repo; + type Uri = Set; + type Cid = S::Cid; type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + } + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { type Value = S::Value; + type BlobCids = S::BlobCids; type Repo = S::Repo; + type Uri = S::Uri; + type Cid = Set; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Uri = S::Uri; - type Cid = S::Cid; - type BlobCids = S::BlobCids; - type Moderation = S::Moderation; - type IndexedAt = Set; type Value = S::Value; + type BlobCids = S::BlobCids; type Repo = S::Repo; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { type Uri = S::Uri; type Cid = S::Cid; - type BlobCids = S::BlobCids; + type IndexedAt = Set; type Moderation = S::Moderation; - type IndexedAt = S::IndexedAt; - type Value = Set; - type Repo = S::Repo; } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { + ///State transition - sets the `moderation` field to Set + pub struct SetModeration(PhantomData S>); + impl sealed::Sealed for SetModeration {} + impl State for SetModeration { + type Value = S::Value; + type BlobCids = S::BlobCids; + type Repo = S::Repo; type Uri = S::Uri; type Cid = S::Cid; - type BlobCids = S::BlobCids; - type Moderation = S::Moderation; type IndexedAt = S::IndexedAt; - type Value = S::Value; - type Repo = Set; + type Moderation = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `value` field + pub struct value(()); + ///Marker type for the `blob_cids` field + pub struct blob_cids(()); + ///Marker type for the `repo` field + pub struct repo(()); ///Marker type for the `uri` field pub struct uri(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `blob_cids` field - pub struct blob_cids(()); - ///Marker type for the `moderation` field - pub struct moderation(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); - ///Marker type for the `value` field - pub struct value(()); - ///Marker type for the `repo` field - pub struct repo(()); + ///Marker type for the `moderation` field + pub struct moderation(()); } } @@ -9381,13 +9381,13 @@ where impl<'a, S> RecordViewBuilder<'a, S> where S: record_view_state::State, + S::Value: record_view_state::IsSet, + S::BlobCids: record_view_state::IsSet, + S::Repo: record_view_state::IsSet, S::Uri: record_view_state::IsSet, S::Cid: record_view_state::IsSet, - S::BlobCids: record_view_state::IsSet, - S::Moderation: record_view_state::IsSet, S::IndexedAt: record_view_state::IsSet, - S::Value: record_view_state::IsSet, - S::Repo: record_view_state::IsSet, + S::Moderation: record_view_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordView<'a> { @@ -9480,127 +9480,127 @@ pub mod record_view_detail_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; - type Repo; - type Blobs; type Cid; - type IndexedAt; type Value; + type Blobs; + type IndexedAt; type Moderation; + type Repo; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; - type Repo = Unset; - type Blobs = Unset; type Cid = Unset; - type IndexedAt = Unset; type Value = Unset; + type Blobs = Unset; + type IndexedAt = Unset; type Moderation = Unset; + type Repo = Unset; + type Uri = Unset; } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Repo = S::Repo; + ///State transition - sets the `cid` field to Set + pub struct SetCid(PhantomData S>); + impl sealed::Sealed for SetCid {} + impl State for SetCid { + type Cid = Set; + type Value = S::Value; type Blobs = S::Blobs; - type Cid = S::Cid; type IndexedAt = S::IndexedAt; - type Value = S::Value; type Moderation = S::Moderation; - } - ///State transition - sets the `repo` field to Set - pub struct SetRepo(PhantomData S>); - impl sealed::Sealed for SetRepo {} - impl State for SetRepo { + type Repo = S::Repo; type Uri = S::Uri; - type Repo = Set; - type Blobs = S::Blobs; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { type Cid = S::Cid; + type Value = Set; + type Blobs = S::Blobs; type IndexedAt = S::IndexedAt; - type Value = S::Value; type Moderation = S::Moderation; + type Repo = S::Repo; + type Uri = S::Uri; } ///State transition - sets the `blobs` field to Set pub struct SetBlobs(PhantomData S>); impl sealed::Sealed for SetBlobs {} impl State for SetBlobs { - type Uri = S::Uri; - type Repo = S::Repo; - type Blobs = Set; type Cid = S::Cid; - type IndexedAt = S::IndexedAt; type Value = S::Value; - type Moderation = S::Moderation; - } - ///State transition - sets the `cid` field to Set - pub struct SetCid(PhantomData S>); - impl sealed::Sealed for SetCid {} - impl State for SetCid { - type Uri = S::Uri; - type Repo = S::Repo; - type Blobs = S::Blobs; - type Cid = Set; + type Blobs = Set; type IndexedAt = S::IndexedAt; - type Value = S::Value; type Moderation = S::Moderation; + type Repo = S::Repo; + type Uri = S::Uri; } ///State transition - sets the `indexed_at` field to Set pub struct SetIndexedAt(PhantomData S>); impl sealed::Sealed for SetIndexedAt {} impl State for SetIndexedAt { - type Uri = S::Uri; - type Repo = S::Repo; - type Blobs = S::Blobs; type Cid = S::Cid; - type IndexedAt = Set; type Value = S::Value; - type Moderation = S::Moderation; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { - type Uri = S::Uri; - type Repo = S::Repo; type Blobs = S::Blobs; - type Cid = S::Cid; - type IndexedAt = S::IndexedAt; - type Value = Set; + type IndexedAt = Set; type Moderation = S::Moderation; + type Repo = S::Repo; + type Uri = S::Uri; } ///State transition - sets the `moderation` field to Set pub struct SetModeration(PhantomData S>); impl sealed::Sealed for SetModeration {} impl State for SetModeration { - type Uri = S::Uri; - type Repo = S::Repo; + type Cid = S::Cid; + type Value = S::Value; type Blobs = S::Blobs; + type IndexedAt = S::IndexedAt; + type Moderation = Set; + type Repo = S::Repo; + type Uri = S::Uri; + } + ///State transition - sets the `repo` field to Set + pub struct SetRepo(PhantomData S>); + impl sealed::Sealed for SetRepo {} + impl State for SetRepo { type Cid = S::Cid; + type Value = S::Value; + type Blobs = S::Blobs; type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Cid = S::Cid; type Value = S::Value; - type Moderation = Set; + type Blobs = S::Blobs; + type IndexedAt = S::IndexedAt; + type Moderation = S::Moderation; + type Repo = S::Repo; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); - ///Marker type for the `repo` field - pub struct repo(()); - ///Marker type for the `blobs` field - pub struct blobs(()); ///Marker type for the `cid` field pub struct cid(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); ///Marker type for the `value` field pub struct value(()); + ///Marker type for the `blobs` field + pub struct blobs(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); ///Marker type for the `moderation` field pub struct moderation(()); + ///Marker type for the `repo` field + pub struct repo(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -9793,13 +9793,13 @@ where impl<'a, S> RecordViewDetailBuilder<'a, S> where S: record_view_detail_state::State, - S::Uri: record_view_detail_state::IsSet, - S::Repo: record_view_detail_state::IsSet, - S::Blobs: record_view_detail_state::IsSet, S::Cid: record_view_detail_state::IsSet, - S::IndexedAt: record_view_detail_state::IsSet, S::Value: record_view_detail_state::IsSet, + S::Blobs: record_view_detail_state::IsSet, + S::IndexedAt: record_view_detail_state::IsSet, S::Moderation: record_view_detail_state::IsSet, + S::Repo: record_view_detail_state::IsSet, + S::Uri: record_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> RecordViewDetail<'a> { @@ -10100,85 +10100,85 @@ pub mod repo_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type RelatedRecords; type Did; - type IndexedAt; + type RelatedRecords; type Moderation; type Handle; + type IndexedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type RelatedRecords = Unset; type Did = Unset; - type IndexedAt = Unset; + type RelatedRecords = Unset; type Moderation = Unset; type Handle = Unset; - } - ///State transition - sets the `related_records` field to Set - pub struct SetRelatedRecords(PhantomData S>); - impl sealed::Sealed for SetRelatedRecords {} - impl State for SetRelatedRecords { - type RelatedRecords = Set; - type Did = S::Did; - type IndexedAt = S::IndexedAt; - type Moderation = S::Moderation; - type Handle = S::Handle; + type IndexedAt = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type RelatedRecords = S::RelatedRecords; type Did = Set; - type IndexedAt = S::IndexedAt; + type RelatedRecords = S::RelatedRecords; type Moderation = S::Moderation; type Handle = S::Handle; + type IndexedAt = S::IndexedAt; } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type RelatedRecords = S::RelatedRecords; + ///State transition - sets the `related_records` field to Set + pub struct SetRelatedRecords(PhantomData S>); + impl sealed::Sealed for SetRelatedRecords {} + impl State for SetRelatedRecords { type Did = S::Did; - type IndexedAt = Set; + type RelatedRecords = Set; type Moderation = S::Moderation; type Handle = S::Handle; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `moderation` field to Set pub struct SetModeration(PhantomData S>); impl sealed::Sealed for SetModeration {} impl State for SetModeration { - type RelatedRecords = S::RelatedRecords; type Did = S::Did; - type IndexedAt = S::IndexedAt; + type RelatedRecords = S::RelatedRecords; type Moderation = Set; type Handle = S::Handle; + type IndexedAt = S::IndexedAt; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { - type RelatedRecords = S::RelatedRecords; type Did = S::Did; - type IndexedAt = S::IndexedAt; + type RelatedRecords = S::RelatedRecords; type Moderation = S::Moderation; type Handle = Set; + type IndexedAt = S::IndexedAt; + } + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { + type Did = S::Did; + type RelatedRecords = S::RelatedRecords; + type Moderation = S::Moderation; + type Handle = S::Handle; + type IndexedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `related_records` field - pub struct related_records(()); ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `indexed_at` field - pub struct indexed_at(()); + ///Marker type for the `related_records` field + pub struct related_records(()); ///Marker type for the `moderation` field pub struct moderation(()); ///Marker type for the `handle` field pub struct handle(()); + ///Marker type for the `indexed_at` field + pub struct indexed_at(()); } } @@ -10434,11 +10434,11 @@ impl<'a, S: repo_view_state::State> RepoViewBuilder<'a, S> { impl<'a, S> RepoViewBuilder<'a, S> where S: repo_view_state::State, - S::RelatedRecords: repo_view_state::IsSet, S::Did: repo_view_state::IsSet, - S::IndexedAt: repo_view_state::IsSet, + S::RelatedRecords: repo_view_state::IsSet, S::Moderation: repo_view_state::IsSet, S::Handle: repo_view_state::IsSet, + S::IndexedAt: repo_view_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoView<'a> { @@ -10561,84 +10561,84 @@ pub mod repo_view_detail_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Did; - type Moderation; - type Handle; type IndexedAt; + type Handle; type RelatedRecords; + type Moderation; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Did = Unset; - type Moderation = Unset; - type Handle = Unset; type IndexedAt = Unset; + type Handle = Unset; type RelatedRecords = Unset; + type Moderation = Unset; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { type Did = Set; - type Moderation = S::Moderation; - type Handle = S::Handle; type IndexedAt = S::IndexedAt; + type Handle = S::Handle; type RelatedRecords = S::RelatedRecords; + type Moderation = S::Moderation; } - ///State transition - sets the `moderation` field to Set - pub struct SetModeration(PhantomData S>); - impl sealed::Sealed for SetModeration {} - impl State for SetModeration { + ///State transition - sets the `indexed_at` field to Set + pub struct SetIndexedAt(PhantomData S>); + impl sealed::Sealed for SetIndexedAt {} + impl State for SetIndexedAt { type Did = S::Did; - type Moderation = Set; + type IndexedAt = Set; type Handle = S::Handle; - type IndexedAt = S::IndexedAt; type RelatedRecords = S::RelatedRecords; + type Moderation = S::Moderation; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type Did = S::Did; - type Moderation = S::Moderation; - type Handle = Set; type IndexedAt = S::IndexedAt; + type Handle = Set; type RelatedRecords = S::RelatedRecords; - } - ///State transition - sets the `indexed_at` field to Set - pub struct SetIndexedAt(PhantomData S>); - impl sealed::Sealed for SetIndexedAt {} - impl State for SetIndexedAt { - type Did = S::Did; type Moderation = S::Moderation; - type Handle = S::Handle; - type IndexedAt = Set; - type RelatedRecords = S::RelatedRecords; } ///State transition - sets the `related_records` field to Set pub struct SetRelatedRecords(PhantomData S>); impl sealed::Sealed for SetRelatedRecords {} impl State for SetRelatedRecords { type Did = S::Did; - type Moderation = S::Moderation; - type Handle = S::Handle; type IndexedAt = S::IndexedAt; + type Handle = S::Handle; type RelatedRecords = Set; + type Moderation = S::Moderation; + } + ///State transition - sets the `moderation` field to Set + pub struct SetModeration(PhantomData S>); + impl sealed::Sealed for SetModeration {} + impl State for SetModeration { + type Did = S::Did; + type IndexedAt = S::IndexedAt; + type Handle = S::Handle; + type RelatedRecords = S::RelatedRecords; + type Moderation = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `moderation` field - pub struct moderation(()); - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `indexed_at` field pub struct indexed_at(()); + ///Marker type for the `handle` field + pub struct handle(()); ///Marker type for the `related_records` field pub struct related_records(()); + ///Marker type for the `moderation` field + pub struct moderation(()); } } @@ -10958,10 +10958,10 @@ impl<'a, S> RepoViewDetailBuilder<'a, S> where S: repo_view_detail_state::State, S::Did: repo_view_detail_state::IsSet, - S::Moderation: repo_view_detail_state::IsSet, - S::Handle: repo_view_detail_state::IsSet, S::IndexedAt: repo_view_detail_state::IsSet, + S::Handle: repo_view_detail_state::IsSet, S::RelatedRecords: repo_view_detail_state::IsSet, + S::Moderation: repo_view_detail_state::IsSet, { /// Build the final struct pub fn build(self) -> RepoViewDetail<'a> { @@ -11208,177 +11208,177 @@ pub mod reporter_stats_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type ReportedRecordCount; + type Did; + type RecordReportCount; + type AccountReportCount; type ReportedAccountCount; - type LabeledAccountCount; - type TakendownRecordCount; type TakendownAccountCount; - type AccountReportCount; - type RecordReportCount; - type Did; + type TakendownRecordCount; + type ReportedRecordCount; type LabeledRecordCount; + type LabeledAccountCount; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type ReportedRecordCount = Unset; + type Did = Unset; + type RecordReportCount = Unset; + type AccountReportCount = Unset; type ReportedAccountCount = Unset; - type LabeledAccountCount = Unset; - type TakendownRecordCount = Unset; type TakendownAccountCount = Unset; - type AccountReportCount = Unset; - type RecordReportCount = Unset; - type Did = Unset; + type TakendownRecordCount = Unset; + type ReportedRecordCount = Unset; type LabeledRecordCount = Unset; + type LabeledAccountCount = Unset; } - ///State transition - sets the `reported_record_count` field to Set - pub struct SetReportedRecordCount(PhantomData S>); - impl sealed::Sealed for SetReportedRecordCount {} - impl State for SetReportedRecordCount { - type ReportedRecordCount = Set; + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Did = Set; + type RecordReportCount = S::RecordReportCount; + type AccountReportCount = S::AccountReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; + type LabeledRecordCount = S::LabeledRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + } + ///State transition - sets the `record_report_count` field to Set + pub struct SetRecordReportCount(PhantomData S>); + impl sealed::Sealed for SetRecordReportCount {} + impl State for SetRecordReportCount { + type Did = S::Did; + type RecordReportCount = Set; type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; + type ReportedAccountCount = S::ReportedAccountCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; + type LabeledRecordCount = S::LabeledRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; + } + ///State transition - sets the `account_report_count` field to Set + pub struct SetAccountReportCount(PhantomData S>); + impl sealed::Sealed for SetAccountReportCount {} + impl State for SetAccountReportCount { type Did = S::Did; + type RecordReportCount = S::RecordReportCount; + type AccountReportCount = Set; + type ReportedAccountCount = S::ReportedAccountCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; type LabeledRecordCount = S::LabeledRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; } ///State transition - sets the `reported_account_count` field to Set pub struct SetReportedAccountCount(PhantomData S>); impl sealed::Sealed for SetReportedAccountCount {} impl State for SetReportedAccountCount { - type ReportedRecordCount = S::ReportedRecordCount; + type Did = S::Did; + type RecordReportCount = S::RecordReportCount; + type AccountReportCount = S::AccountReportCount; type ReportedAccountCount = Set; - type LabeledAccountCount = S::LabeledAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; type TakendownAccountCount = S::TakendownAccountCount; - type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; - type Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; - } - ///State transition - sets the `labeled_account_count` field to Set - pub struct SetLabeledAccountCount(PhantomData S>); - impl sealed::Sealed for SetLabeledAccountCount {} - impl State for SetLabeledAccountCount { - type ReportedRecordCount = S::ReportedRecordCount; - type ReportedAccountCount = S::ReportedAccountCount; - type LabeledAccountCount = Set; type TakendownRecordCount = S::TakendownRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; - type Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; - } - ///State transition - sets the `takendown_record_count` field to Set - pub struct SetTakendownRecordCount(PhantomData S>); - impl sealed::Sealed for SetTakendownRecordCount {} - impl State for SetTakendownRecordCount { type ReportedRecordCount = S::ReportedRecordCount; - type ReportedAccountCount = S::ReportedAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; - type TakendownRecordCount = Set; - type TakendownAccountCount = S::TakendownAccountCount; - type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; - type Did = S::Did; type LabeledRecordCount = S::LabeledRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; } ///State transition - sets the `takendown_account_count` field to Set pub struct SetTakendownAccountCount(PhantomData S>); impl sealed::Sealed for SetTakendownAccountCount {} impl State for SetTakendownAccountCount { - type ReportedRecordCount = S::ReportedRecordCount; - type ReportedAccountCount = S::ReportedAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; - type TakendownAccountCount = Set; - type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; type Did = S::Did; - type LabeledRecordCount = S::LabeledRecordCount; - } - ///State transition - sets the `account_report_count` field to Set - pub struct SetAccountReportCount(PhantomData S>); - impl sealed::Sealed for SetAccountReportCount {} - impl State for SetAccountReportCount { - type ReportedRecordCount = S::ReportedRecordCount; + type RecordReportCount = S::RecordReportCount; + type AccountReportCount = S::AccountReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; + type TakendownAccountCount = Set; type TakendownRecordCount = S::TakendownRecordCount; - type TakendownAccountCount = S::TakendownAccountCount; - type AccountReportCount = Set; - type RecordReportCount = S::RecordReportCount; - type Did = S::Did; + type ReportedRecordCount = S::ReportedRecordCount; type LabeledRecordCount = S::LabeledRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; } - ///State transition - sets the `record_report_count` field to Set - pub struct SetRecordReportCount(PhantomData S>); - impl sealed::Sealed for SetRecordReportCount {} - impl State for SetRecordReportCount { - type ReportedRecordCount = S::ReportedRecordCount; + ///State transition - sets the `takendown_record_count` field to Set + pub struct SetTakendownRecordCount(PhantomData S>); + impl sealed::Sealed for SetTakendownRecordCount {} + impl State for SetTakendownRecordCount { + type Did = S::Did; + type RecordReportCount = S::RecordReportCount; + type AccountReportCount = S::AccountReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; type TakendownAccountCount = S::TakendownAccountCount; - type AccountReportCount = S::AccountReportCount; - type RecordReportCount = Set; - type Did = S::Did; + type TakendownRecordCount = Set; + type ReportedRecordCount = S::ReportedRecordCount; type LabeledRecordCount = S::LabeledRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type ReportedRecordCount = S::ReportedRecordCount; + ///State transition - sets the `reported_record_count` field to Set + pub struct SetReportedRecordCount(PhantomData S>); + impl sealed::Sealed for SetReportedRecordCount {} + impl State for SetReportedRecordCount { + type Did = S::Did; + type RecordReportCount = S::RecordReportCount; + type AccountReportCount = S::AccountReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; type TakendownAccountCount = S::TakendownAccountCount; - type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; - type Did = Set; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = Set; type LabeledRecordCount = S::LabeledRecordCount; + type LabeledAccountCount = S::LabeledAccountCount; } ///State transition - sets the `labeled_record_count` field to Set pub struct SetLabeledRecordCount(PhantomData S>); impl sealed::Sealed for SetLabeledRecordCount {} impl State for SetLabeledRecordCount { - type ReportedRecordCount = S::ReportedRecordCount; + type Did = S::Did; + type RecordReportCount = S::RecordReportCount; + type AccountReportCount = S::AccountReportCount; type ReportedAccountCount = S::ReportedAccountCount; - type LabeledAccountCount = S::LabeledAccountCount; - type TakendownRecordCount = S::TakendownRecordCount; type TakendownAccountCount = S::TakendownAccountCount; - type AccountReportCount = S::AccountReportCount; - type RecordReportCount = S::RecordReportCount; - type Did = S::Did; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; type LabeledRecordCount = Set; + type LabeledAccountCount = S::LabeledAccountCount; + } + ///State transition - sets the `labeled_account_count` field to Set + pub struct SetLabeledAccountCount(PhantomData S>); + impl sealed::Sealed for SetLabeledAccountCount {} + impl State for SetLabeledAccountCount { + type Did = S::Did; + type RecordReportCount = S::RecordReportCount; + type AccountReportCount = S::AccountReportCount; + type ReportedAccountCount = S::ReportedAccountCount; + type TakendownAccountCount = S::TakendownAccountCount; + type TakendownRecordCount = S::TakendownRecordCount; + type ReportedRecordCount = S::ReportedRecordCount; + type LabeledRecordCount = S::LabeledRecordCount; + type LabeledAccountCount = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `reported_record_count` field - pub struct reported_record_count(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `record_report_count` field + pub struct record_report_count(()); + ///Marker type for the `account_report_count` field + pub struct account_report_count(()); ///Marker type for the `reported_account_count` field pub struct reported_account_count(()); - ///Marker type for the `labeled_account_count` field - pub struct labeled_account_count(()); - ///Marker type for the `takendown_record_count` field - pub struct takendown_record_count(()); ///Marker type for the `takendown_account_count` field pub struct takendown_account_count(()); - ///Marker type for the `account_report_count` field - pub struct account_report_count(()); - ///Marker type for the `record_report_count` field - pub struct record_report_count(()); - ///Marker type for the `did` field - pub struct did(()); + ///Marker type for the `takendown_record_count` field + pub struct takendown_record_count(()); + ///Marker type for the `reported_record_count` field + pub struct reported_record_count(()); ///Marker type for the `labeled_record_count` field pub struct labeled_record_count(()); + ///Marker type for the `labeled_account_count` field + pub struct labeled_account_count(()); } } @@ -11601,15 +11601,15 @@ where impl<'a, S> ReporterStatsBuilder<'a, S> where S: reporter_stats_state::State, - S::ReportedRecordCount: reporter_stats_state::IsSet, - S::ReportedAccountCount: reporter_stats_state::IsSet, - S::LabeledAccountCount: reporter_stats_state::IsSet, - S::TakendownRecordCount: reporter_stats_state::IsSet, - S::TakendownAccountCount: reporter_stats_state::IsSet, - S::AccountReportCount: reporter_stats_state::IsSet, - S::RecordReportCount: reporter_stats_state::IsSet, S::Did: reporter_stats_state::IsSet, + S::RecordReportCount: reporter_stats_state::IsSet, + S::AccountReportCount: reporter_stats_state::IsSet, + S::ReportedAccountCount: reporter_stats_state::IsSet, + S::TakendownAccountCount: reporter_stats_state::IsSet, + S::TakendownRecordCount: reporter_stats_state::IsSet, + S::ReportedRecordCount: reporter_stats_state::IsSet, S::LabeledRecordCount: reporter_stats_state::IsSet, + S::LabeledAccountCount: reporter_stats_state::IsSet, { /// Build the final struct pub fn build(self) -> ReporterStats<'a> { @@ -11887,105 +11887,105 @@ pub mod scheduled_action_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Status; type Id; - type CreatedBy; - type CreatedAt; - type Did; type Action; + type Did; + type CreatedAt; + type CreatedBy; + type Status; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Status = Unset; type Id = Unset; - type CreatedBy = Unset; - type CreatedAt = Unset; - type Did = Unset; type Action = Unset; - } - ///State transition - sets the `status` field to Set - pub struct SetStatus(PhantomData S>); - impl sealed::Sealed for SetStatus {} - impl State for SetStatus { - type Status = Set; - type Id = S::Id; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Did = S::Did; - type Action = S::Action; + type Did = Unset; + type CreatedAt = Unset; + type CreatedBy = Unset; + type Status = Unset; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { - type Status = S::Status; type Id = Set; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Did = S::Did; type Action = S::Action; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { + type Did = S::Did; + type CreatedAt = S::CreatedAt; + type CreatedBy = S::CreatedBy; type Status = S::Status; + } + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData S>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { type Id = S::Id; - type CreatedBy = Set; - type CreatedAt = S::CreatedAt; + type Action = Set; type Did = S::Did; + type CreatedAt = S::CreatedAt; + type CreatedBy = S::CreatedBy; + type Status = S::Status; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Id = S::Id; type Action = S::Action; + type Did = Set; + type CreatedAt = S::CreatedAt; + type CreatedBy = S::CreatedBy; + type Status = S::Status; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { - type Status = S::Status; type Id = S::Id; - type CreatedBy = S::CreatedBy; - type CreatedAt = Set; - type Did = S::Did; type Action = S::Action; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { + type Did = S::Did; + type CreatedAt = Set; + type CreatedBy = S::CreatedBy; type Status = S::Status; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { type Id = S::Id; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; - type Did = Set; type Action = S::Action; - } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData S>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { + type Did = S::Did; + type CreatedAt = S::CreatedAt; + type CreatedBy = Set; type Status = S::Status; + } + ///State transition - sets the `status` field to Set + pub struct SetStatus(PhantomData S>); + impl sealed::Sealed for SetStatus {} + impl State for SetStatus { type Id = S::Id; - type CreatedBy = S::CreatedBy; - type CreatedAt = S::CreatedAt; + type Action = S::Action; type Did = S::Did; - type Action = Set; + type CreatedAt = S::CreatedAt; + type CreatedBy = S::CreatedBy; + type Status = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `status` field - pub struct status(()); ///Marker type for the `id` field pub struct id(()); - ///Marker type for the `created_by` field - pub struct created_by(()); - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `action` field pub struct action(()); + ///Marker type for the `did` field + pub struct did(()); + ///Marker type for the `created_at` field + pub struct created_at(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `status` field + pub struct status(()); } } @@ -12322,12 +12322,12 @@ impl<'a, S: scheduled_action_view_state::State> ScheduledActionViewBuilder<'a, S impl<'a, S> ScheduledActionViewBuilder<'a, S> where S: scheduled_action_view_state::State, - S::Status: scheduled_action_view_state::IsSet, S::Id: scheduled_action_view_state::IsSet, - S::CreatedBy: scheduled_action_view_state::IsSet, - S::CreatedAt: scheduled_action_view_state::IsSet, - S::Did: scheduled_action_view_state::IsSet, S::Action: scheduled_action_view_state::IsSet, + S::Did: scheduled_action_view_state::IsSet, + S::CreatedAt: scheduled_action_view_state::IsSet, + S::CreatedBy: scheduled_action_view_state::IsSet, + S::Status: scheduled_action_view_state::IsSet, { /// Build the final struct pub fn build(self) -> ScheduledActionView<'a> { @@ -12617,85 +12617,85 @@ pub mod subject_status_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Id; - type CreatedAt; - type Subject; type UpdatedAt; type ReviewState; + type Subject; + type Id; + type CreatedAt; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Id = Unset; - type CreatedAt = Unset; - type Subject = Unset; type UpdatedAt = Unset; type ReviewState = Unset; - } - ///State transition - sets the `id` field to Set - pub struct SetId(PhantomData S>); - impl sealed::Sealed for SetId {} - impl State for SetId { - type Id = Set; - type CreatedAt = S::CreatedAt; - type Subject = S::Subject; - type UpdatedAt = S::UpdatedAt; - type ReviewState = S::ReviewState; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Id = S::Id; - type CreatedAt = Set; - type Subject = S::Subject; - type UpdatedAt = S::UpdatedAt; - type ReviewState = S::ReviewState; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Id = S::Id; - type CreatedAt = S::CreatedAt; - type Subject = Set; - type UpdatedAt = S::UpdatedAt; - type ReviewState = S::ReviewState; + type Subject = Unset; + type Id = Unset; + type CreatedAt = Unset; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { - type Id = S::Id; - type CreatedAt = S::CreatedAt; - type Subject = S::Subject; type UpdatedAt = Set; type ReviewState = S::ReviewState; + type Subject = S::Subject; + type Id = S::Id; + type CreatedAt = S::CreatedAt; } ///State transition - sets the `review_state` field to Set pub struct SetReviewState(PhantomData S>); impl sealed::Sealed for SetReviewState {} impl State for SetReviewState { + type UpdatedAt = S::UpdatedAt; + type ReviewState = Set; + type Subject = S::Subject; + type Id = S::Id; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type UpdatedAt = S::UpdatedAt; + type ReviewState = S::ReviewState; + type Subject = Set; type Id = S::Id; type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `id` field to Set + pub struct SetId(PhantomData S>); + impl sealed::Sealed for SetId {} + impl State for SetId { + type UpdatedAt = S::UpdatedAt; + type ReviewState = S::ReviewState; type Subject = S::Subject; + type Id = Set; + type CreatedAt = S::CreatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { type UpdatedAt = S::UpdatedAt; - type ReviewState = Set; + type ReviewState = S::ReviewState; + type Subject = S::Subject; + type Id = S::Id; + type CreatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `id` field - pub struct id(()); - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `updated_at` field pub struct updated_at(()); ///Marker type for the `review_state` field pub struct review_state(()); + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `id` field + pub struct id(()); + ///Marker type for the `created_at` field + pub struct created_at(()); } } @@ -13230,11 +13230,11 @@ where impl<'a, S> SubjectStatusViewBuilder<'a, S> where S: subject_status_view_state::State, - S::Id: subject_status_view_state::IsSet, - S::CreatedAt: subject_status_view_state::IsSet, - S::Subject: subject_status_view_state::IsSet, S::UpdatedAt: subject_status_view_state::IsSet, S::ReviewState: subject_status_view_state::IsSet, + S::Subject: subject_status_view_state::IsSet, + S::Id: subject_status_view_state::IsSet, + S::CreatedAt: subject_status_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SubjectStatusView<'a> { @@ -13746,51 +13746,51 @@ pub mod video_details_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Height; type Length; type Width; + type Height; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Height = Unset; type Length = Unset; type Width = Unset; - } - ///State transition - sets the `height` field to Set - pub struct SetHeight(PhantomData S>); - impl sealed::Sealed for SetHeight {} - impl State for SetHeight { - type Height = Set; - type Length = S::Length; - type Width = S::Width; + type Height = Unset; } ///State transition - sets the `length` field to Set pub struct SetLength(PhantomData S>); impl sealed::Sealed for SetLength {} impl State for SetLength { - type Height = S::Height; type Length = Set; type Width = S::Width; + type Height = S::Height; } ///State transition - sets the `width` field to Set pub struct SetWidth(PhantomData S>); impl sealed::Sealed for SetWidth {} impl State for SetWidth { - type Height = S::Height; type Length = S::Length; type Width = Set; + type Height = S::Height; + } + ///State transition - sets the `height` field to Set + pub struct SetHeight(PhantomData S>); + impl sealed::Sealed for SetHeight {} + impl State for SetHeight { + type Length = S::Length; + type Width = S::Width; + type Height = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `height` field - pub struct height(()); ///Marker type for the `length` field pub struct length(()); ///Marker type for the `width` field pub struct width(()); + ///Marker type for the `height` field + pub struct height(()); } } @@ -13883,9 +13883,9 @@ where impl<'a, S> VideoDetailsBuilder<'a, S> where S: video_details_state::State, - S::Height: video_details_state::IsSet, S::Length: video_details_state::IsSet, S::Width: video_details_state::IsSet, + S::Height: video_details_state::IsSet, { /// Build the final struct pub fn build(self) -> VideoDetails<'a> { diff --git a/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs b/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs index 4e31137..44efe9f 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/emit_event.rs @@ -47,51 +47,51 @@ pub mod emit_event_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type CreatedBy; type Event; type Subject; - type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type CreatedBy = Unset; type Event = Unset; type Subject = Unset; - type CreatedBy = Unset; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type CreatedBy = Set; + type Event = S::Event; + type Subject = S::Subject; } ///State transition - sets the `event` field to Set pub struct SetEvent(PhantomData S>); impl sealed::Sealed for SetEvent {} impl State for SetEvent { + type CreatedBy = S::CreatedBy; type Event = Set; type Subject = S::Subject; - type CreatedBy = S::CreatedBy; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { - type Event = S::Event; - type Subject = Set; type CreatedBy = S::CreatedBy; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { type Event = S::Event; - type Subject = S::Subject; - type CreatedBy = Set; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `created_by` field + pub struct created_by(()); ///Marker type for the `event` field pub struct event(()); ///Marker type for the `subject` field pub struct subject(()); - ///Marker type for the `created_by` field - pub struct created_by(()); } } @@ -244,9 +244,9 @@ impl<'a, S: emit_event_state::State> EmitEventBuilder<'a, S> { impl<'a, S> EmitEventBuilder<'a, S> where S: emit_event_state::State, + S::CreatedBy: emit_event_state::IsSet, S::Event: emit_event_state::IsSet, S::Subject: emit_event_state::IsSet, - S::CreatedBy: emit_event_state::IsSet, { /// Build the final struct pub fn build(self) -> EmitEvent<'a> { diff --git a/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs b/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs index 301799a..f604561 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/get_account_timeline.rs @@ -575,49 +575,49 @@ pub mod timeline_item_summary_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type EventType; type EventSubjectType; + type EventType; type Count; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type EventType = Unset; type EventSubjectType = Unset; + type EventType = Unset; type Count = Unset; } - ///State transition - sets the `event_type` field to Set - pub struct SetEventType(PhantomData S>); - impl sealed::Sealed for SetEventType {} - impl State for SetEventType { - type EventType = Set; - type EventSubjectType = S::EventSubjectType; - type Count = S::Count; - } ///State transition - sets the `event_subject_type` field to Set pub struct SetEventSubjectType(PhantomData S>); impl sealed::Sealed for SetEventSubjectType {} impl State for SetEventSubjectType { - type EventType = S::EventType; type EventSubjectType = Set; + type EventType = S::EventType; + type Count = S::Count; + } + ///State transition - sets the `event_type` field to Set + pub struct SetEventType(PhantomData S>); + impl sealed::Sealed for SetEventType {} + impl State for SetEventType { + type EventSubjectType = S::EventSubjectType; + type EventType = Set; type Count = S::Count; } ///State transition - sets the `count` field to Set pub struct SetCount(PhantomData S>); impl sealed::Sealed for SetCount {} impl State for SetCount { - type EventType = S::EventType; type EventSubjectType = S::EventSubjectType; + type EventType = S::EventType; type Count = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `event_type` field - pub struct event_type(()); ///Marker type for the `event_subject_type` field pub struct event_subject_type(()); + ///Marker type for the `event_type` field + pub struct event_type(()); ///Marker type for the `count` field pub struct count(()); } @@ -715,8 +715,8 @@ where impl<'a, S> TimelineItemSummaryBuilder<'a, S> where S: timeline_item_summary_state::State, - S::EventType: timeline_item_summary_state::IsSet, S::EventSubjectType: timeline_item_summary_state::IsSet, + S::EventType: timeline_item_summary_state::IsSet, S::Count: timeline_item_summary_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs b/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs index 9548aa4..a695bc3 100644 --- a/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs +++ b/crates/weaver-api/src/tools_ozone/moderation/schedule_action.rs @@ -36,37 +36,37 @@ pub mod failed_scheduling_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type Error; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type Error = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type Error = S::Error; + type Subject = Unset; } ///State transition - sets the `error` field to Set pub struct SetError(PhantomData S>); impl sealed::Sealed for SetError {} impl State for SetError { - type Subject = S::Subject; type Error = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Error = S::Error; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `error` field pub struct error(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -159,8 +159,8 @@ where impl<'a, S> FailedSchedulingBuilder<'a, S> where S: failed_scheduling_state::State, - S::Subject: failed_scheduling_state::IsSet, S::Error: failed_scheduling_state::IsSet, + S::Subject: failed_scheduling_state::IsSet, { /// Build the final struct pub fn build(self) -> FailedScheduling<'a> { @@ -762,66 +762,66 @@ pub mod schedule_action_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Action; - type Subjects; - type CreatedBy; type Scheduling; + type CreatedBy; + type Subjects; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Action = Unset; - type Subjects = Unset; - type CreatedBy = Unset; type Scheduling = Unset; + type CreatedBy = Unset; + type Subjects = Unset; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { type Action = Set; - type Subjects = S::Subjects; - type CreatedBy = S::CreatedBy; type Scheduling = S::Scheduling; + type CreatedBy = S::CreatedBy; + type Subjects = S::Subjects; } - ///State transition - sets the `subjects` field to Set - pub struct SetSubjects(PhantomData S>); - impl sealed::Sealed for SetSubjects {} - impl State for SetSubjects { + ///State transition - sets the `scheduling` field to Set + pub struct SetScheduling(PhantomData S>); + impl sealed::Sealed for SetScheduling {} + impl State for SetScheduling { type Action = S::Action; - type Subjects = Set; + type Scheduling = Set; type CreatedBy = S::CreatedBy; - type Scheduling = S::Scheduling; + type Subjects = S::Subjects; } ///State transition - sets the `created_by` field to Set pub struct SetCreatedBy(PhantomData S>); impl sealed::Sealed for SetCreatedBy {} impl State for SetCreatedBy { type Action = S::Action; - type Subjects = S::Subjects; - type CreatedBy = Set; type Scheduling = S::Scheduling; + type CreatedBy = Set; + type Subjects = S::Subjects; } - ///State transition - sets the `scheduling` field to Set - pub struct SetScheduling(PhantomData S>); - impl sealed::Sealed for SetScheduling {} - impl State for SetScheduling { + ///State transition - sets the `subjects` field to Set + pub struct SetSubjects(PhantomData S>); + impl sealed::Sealed for SetSubjects {} + impl State for SetSubjects { type Action = S::Action; - type Subjects = S::Subjects; + type Scheduling = S::Scheduling; type CreatedBy = S::CreatedBy; - type Scheduling = Set; + type Subjects = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `action` field pub struct action(()); - ///Marker type for the `subjects` field - pub struct subjects(()); - ///Marker type for the `created_by` field - pub struct created_by(()); ///Marker type for the `scheduling` field pub struct scheduling(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `subjects` field + pub struct subjects(()); } } @@ -961,9 +961,9 @@ impl<'a, S> ScheduleActionBuilder<'a, S> where S: schedule_action_state::State, S::Action: schedule_action_state::IsSet, - S::Subjects: schedule_action_state::IsSet, - S::CreatedBy: schedule_action_state::IsSet, S::Scheduling: schedule_action_state::IsSet, + S::CreatedBy: schedule_action_state::IsSet, + S::Subjects: schedule_action_state::IsSet, { /// Build the final struct pub fn build(self) -> ScheduleAction<'a> { diff --git a/crates/weaver-api/src/tools_ozone/safelink.rs b/crates/weaver-api/src/tools_ozone/safelink.rs index 0a343b9..a0ff395 100644 --- a/crates/weaver-api/src/tools_ozone/safelink.rs +++ b/crates/weaver-api/src/tools_ozone/safelink.rs @@ -139,150 +139,150 @@ pub mod event_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type Reason; - type CreatedBy; - type EventType; - type Action; - type Id; type Url; - type Pattern; + type Id; type CreatedAt; + type Action; + type CreatedBy; + type Pattern; + type EventType; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type Reason = Unset; - type CreatedBy = Unset; - type EventType = Unset; - type Action = Unset; - type Id = Unset; type Url = Unset; - type Pattern = Unset; + type Id = Unset; type CreatedAt = Unset; + type Action = Unset; + type CreatedBy = Unset; + type Pattern = Unset; + type EventType = Unset; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); impl sealed::Sealed for SetReason {} impl State for SetReason { type Reason = Set; - type CreatedBy = S::CreatedBy; - type EventType = S::EventType; - type Action = S::Action; - type Id = S::Id; type Url = S::Url; - type Pattern = S::Pattern; + type Id = S::Id; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type Reason = S::Reason; - type CreatedBy = Set; - type EventType = S::EventType; type Action = S::Action; - type Id = S::Id; - type Url = S::Url; + type CreatedBy = S::CreatedBy; type Pattern = S::Pattern; - type CreatedAt = S::CreatedAt; + type EventType = S::EventType; } - ///State transition - sets the `event_type` field to Set - pub struct SetEventType(PhantomData S>); - impl sealed::Sealed for SetEventType {} - impl State for SetEventType { + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { type Reason = S::Reason; - type CreatedBy = S::CreatedBy; - type EventType = Set; - type Action = S::Action; + type Url = Set; type Id = S::Id; - type Url = S::Url; - type Pattern = S::Pattern; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData S>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type Reason = S::Reason; + type Action = S::Action; type CreatedBy = S::CreatedBy; - type EventType = S::EventType; - type Action = Set; - type Id = S::Id; - type Url = S::Url; type Pattern = S::Pattern; - type CreatedAt = S::CreatedAt; + type EventType = S::EventType; } ///State transition - sets the `id` field to Set pub struct SetId(PhantomData S>); impl sealed::Sealed for SetId {} impl State for SetId { type Reason = S::Reason; + type Url = S::Url; + type Id = Set; + type CreatedAt = S::CreatedAt; + type Action = S::Action; type CreatedBy = S::CreatedBy; + type Pattern = S::Pattern; type EventType = S::EventType; - type Action = S::Action; - type Id = Set; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type Reason = S::Reason; type Url = S::Url; + type Id = S::Id; + type CreatedAt = Set; + type Action = S::Action; + type CreatedBy = S::CreatedBy; type Pattern = S::Pattern; - type CreatedAt = S::CreatedAt; + type EventType = S::EventType; } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData S>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { type Reason = S::Reason; + type Url = S::Url; + type Id = S::Id; + type CreatedAt = S::CreatedAt; + type Action = Set; type CreatedBy = S::CreatedBy; + type Pattern = S::Pattern; type EventType = S::EventType; - type Action = S::Action; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type Reason = S::Reason; + type Url = S::Url; type Id = S::Id; - type Url = Set; - type Pattern = S::Pattern; type CreatedAt = S::CreatedAt; + type Action = S::Action; + type CreatedBy = Set; + type Pattern = S::Pattern; + type EventType = S::EventType; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { type Reason = S::Reason; - type CreatedBy = S::CreatedBy; - type EventType = S::EventType; - type Action = S::Action; - type Id = S::Id; type Url = S::Url; - type Pattern = Set; + type Id = S::Id; type CreatedAt = S::CreatedAt; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Reason = S::Reason; + type Action = S::Action; type CreatedBy = S::CreatedBy; + type Pattern = Set; type EventType = S::EventType; - type Action = S::Action; - type Id = S::Id; + } + ///State transition - sets the `event_type` field to Set + pub struct SetEventType(PhantomData S>); + impl sealed::Sealed for SetEventType {} + impl State for SetEventType { + type Reason = S::Reason; type Url = S::Url; + type Id = S::Id; + type CreatedAt = S::CreatedAt; + type Action = S::Action; + type CreatedBy = S::CreatedBy; type Pattern = S::Pattern; - type CreatedAt = Set; + type EventType = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `reason` field pub struct reason(()); - ///Marker type for the `created_by` field - pub struct created_by(()); - ///Marker type for the `event_type` field - pub struct event_type(()); - ///Marker type for the `action` field - pub struct action(()); - ///Marker type for the `id` field - pub struct id(()); ///Marker type for the `url` field pub struct url(()); - ///Marker type for the `pattern` field - pub struct pattern(()); + ///Marker type for the `id` field + pub struct id(()); ///Marker type for the `created_at` field pub struct created_at(()); + ///Marker type for the `action` field + pub struct action(()); + ///Marker type for the `created_by` field + pub struct created_by(()); + ///Marker type for the `pattern` field + pub struct pattern(()); + ///Marker type for the `event_type` field + pub struct event_type(()); } } @@ -503,13 +503,13 @@ impl<'a, S> EventBuilder<'a, S> where S: event_state::State, S::Reason: event_state::IsSet, - S::CreatedBy: event_state::IsSet, - S::EventType: event_state::IsSet, - S::Action: event_state::IsSet, - S::Id: event_state::IsSet, S::Url: event_state::IsSet, - S::Pattern: event_state::IsSet, + S::Id: event_state::IsSet, S::CreatedAt: event_state::IsSet, + S::Action: event_state::IsSet, + S::CreatedBy: event_state::IsSet, + S::Pattern: event_state::IsSet, + S::EventType: event_state::IsSet, { /// Build the final struct pub fn build(self) -> Event<'a> { @@ -1233,127 +1233,127 @@ pub mod url_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedBy; - type Action; - type Reason; type CreatedAt; type Url; - type UpdatedAt; type Pattern; + type Action; + type UpdatedAt; + type Reason; + type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedBy = Unset; - type Action = Unset; - type Reason = Unset; type CreatedAt = Unset; type Url = Unset; - type UpdatedAt = Unset; type Pattern = Unset; + type Action = Unset; + type UpdatedAt = Unset; + type Reason = Unset; + type CreatedBy = Unset; } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type CreatedBy = Set; + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type CreatedAt = Set; + type Url = S::Url; + type Pattern = S::Pattern; type Action = S::Action; + type UpdatedAt = S::UpdatedAt; type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type CreatedAt = S::CreatedAt; + type Url = Set; + type Pattern = S::Pattern; + type Action = S::Action; + type UpdatedAt = S::UpdatedAt; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `pattern` field to Set + pub struct SetPattern(PhantomData S>); + impl sealed::Sealed for SetPattern {} + impl State for SetPattern { type CreatedAt = S::CreatedAt; type Url = S::Url; + type Pattern = Set; + type Action = S::Action; type UpdatedAt = S::UpdatedAt; - type Pattern = S::Pattern; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { - type CreatedBy = S::CreatedBy; + type CreatedAt = S::CreatedAt; + type Url = S::Url; + type Pattern = S::Pattern; type Action = Set; + type UpdatedAt = S::UpdatedAt; type Reason = S::Reason; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `updated_at` field to Set + pub struct SetUpdatedAt(PhantomData S>); + impl sealed::Sealed for SetUpdatedAt {} + impl State for SetUpdatedAt { type CreatedAt = S::CreatedAt; type Url = S::Url; - type UpdatedAt = S::UpdatedAt; type Pattern = S::Pattern; + type Action = S::Action; + type UpdatedAt = Set; + type Reason = S::Reason; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `reason` field to Set pub struct SetReason(PhantomData S>); impl sealed::Sealed for SetReason {} impl State for SetReason { - type CreatedBy = S::CreatedBy; - type Action = S::Action; - type Reason = Set; type CreatedAt = S::CreatedAt; type Url = S::Url; - type UpdatedAt = S::UpdatedAt; type Pattern = S::Pattern; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type CreatedBy = S::CreatedBy; type Action = S::Action; - type Reason = S::Reason; - type CreatedAt = Set; - type Url = S::Url; type UpdatedAt = S::UpdatedAt; - type Pattern = S::Pattern; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { + type Reason = Set; type CreatedBy = S::CreatedBy; - type Action = S::Action; - type Reason = S::Reason; - type CreatedAt = S::CreatedAt; - type Url = Set; - type UpdatedAt = S::UpdatedAt; - type Pattern = S::Pattern; } - ///State transition - sets the `updated_at` field to Set - pub struct SetUpdatedAt(PhantomData S>); - impl sealed::Sealed for SetUpdatedAt {} - impl State for SetUpdatedAt { - type CreatedBy = S::CreatedBy; - type Action = S::Action; - type Reason = S::Reason; + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { type CreatedAt = S::CreatedAt; type Url = S::Url; - type UpdatedAt = Set; type Pattern = S::Pattern; - } - ///State transition - sets the `pattern` field to Set - pub struct SetPattern(PhantomData S>); - impl sealed::Sealed for SetPattern {} - impl State for SetPattern { - type CreatedBy = S::CreatedBy; type Action = S::Action; - type Reason = S::Reason; - type CreatedAt = S::CreatedAt; - type Url = S::Url; type UpdatedAt = S::UpdatedAt; - type Pattern = Set; + type Reason = S::Reason; + type CreatedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_by` field - pub struct created_by(()); - ///Marker type for the `action` field - pub struct action(()); - ///Marker type for the `reason` field - pub struct reason(()); ///Marker type for the `created_at` field pub struct created_at(()); ///Marker type for the `url` field pub struct url(()); - ///Marker type for the `updated_at` field - pub struct updated_at(()); ///Marker type for the `pattern` field pub struct pattern(()); + ///Marker type for the `action` field + pub struct action(()); + ///Marker type for the `updated_at` field + pub struct updated_at(()); + ///Marker type for the `reason` field + pub struct reason(()); + ///Marker type for the `created_by` field + pub struct created_by(()); } } @@ -1543,13 +1543,13 @@ where impl<'a, S> UrlRuleBuilder<'a, S> where S: url_rule_state::State, - S::CreatedBy: url_rule_state::IsSet, - S::Action: url_rule_state::IsSet, - S::Reason: url_rule_state::IsSet, S::CreatedAt: url_rule_state::IsSet, S::Url: url_rule_state::IsSet, - S::UpdatedAt: url_rule_state::IsSet, S::Pattern: url_rule_state::IsSet, + S::Action: url_rule_state::IsSet, + S::UpdatedAt: url_rule_state::IsSet, + S::Reason: url_rule_state::IsSet, + S::CreatedBy: url_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> UrlRule<'a> { diff --git a/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs index c14b765..83eb139 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/add_rule.rs @@ -46,65 +46,65 @@ pub mod add_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Action; - type Pattern; type Reason; + type Pattern; + type Action; type Url; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Action = Unset; - type Pattern = Unset; type Reason = Unset; + type Pattern = Unset; + type Action = Unset; type Url = Unset; } - ///State transition - sets the `action` field to Set - pub struct SetAction(PhantomData S>); - impl sealed::Sealed for SetAction {} - impl State for SetAction { - type Action = Set; + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { + type Reason = Set; type Pattern = S::Pattern; - type Reason = S::Reason; + type Action = S::Action; type Url = S::Url; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { - type Action = S::Action; - type Pattern = Set; type Reason = S::Reason; + type Pattern = Set; + type Action = S::Action; type Url = S::Url; } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type Action = S::Action; + ///State transition - sets the `action` field to Set + pub struct SetAction(PhantomData S>); + impl sealed::Sealed for SetAction {} + impl State for SetAction { + type Reason = S::Reason; type Pattern = S::Pattern; - type Reason = Set; + type Action = Set; type Url = S::Url; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { - type Action = S::Action; - type Pattern = S::Pattern; type Reason = S::Reason; + type Pattern = S::Pattern; + type Action = S::Action; type Url = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `action` field - pub struct action(()); - ///Marker type for the `pattern` field - pub struct pattern(()); ///Marker type for the `reason` field pub struct reason(()); + ///Marker type for the `pattern` field + pub struct pattern(()); + ///Marker type for the `action` field + pub struct action(()); ///Marker type for the `url` field pub struct url(()); } @@ -256,9 +256,9 @@ where impl<'a, S> AddRuleBuilder<'a, S> where S: add_rule_state::State, - S::Action: add_rule_state::IsSet, - S::Pattern: add_rule_state::IsSet, S::Reason: add_rule_state::IsSet, + S::Pattern: add_rule_state::IsSet, + S::Action: add_rule_state::IsSet, S::Url: add_rule_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs index 2fc4176..c7be4c7 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/remove_rule.rs @@ -42,37 +42,37 @@ pub mod remove_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Url; type Pattern; + type Url; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Url = Unset; type Pattern = Unset; - } - ///State transition - sets the `url` field to Set - pub struct SetUrl(PhantomData S>); - impl sealed::Sealed for SetUrl {} - impl State for SetUrl { - type Url = Set; - type Pattern = S::Pattern; + type Url = Unset; } ///State transition - sets the `pattern` field to Set pub struct SetPattern(PhantomData S>); impl sealed::Sealed for SetPattern {} impl State for SetPattern { - type Url = S::Url; type Pattern = Set; + type Url = S::Url; + } + ///State transition - sets the `url` field to Set + pub struct SetUrl(PhantomData S>); + impl sealed::Sealed for SetUrl {} + impl State for SetUrl { + type Pattern = S::Pattern; + type Url = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `url` field - pub struct url(()); ///Marker type for the `pattern` field pub struct pattern(()); + ///Marker type for the `url` field + pub struct url(()); } } @@ -182,8 +182,8 @@ where impl<'a, S> RemoveRuleBuilder<'a, S> where S: remove_rule_state::State, - S::Url: remove_rule_state::IsSet, S::Pattern: remove_rule_state::IsSet, + S::Url: remove_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> RemoveRule<'a> { diff --git a/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs b/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs index a832dc3..fd668e2 100644 --- a/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs +++ b/crates/weaver-api/src/tools_ozone/safelink/update_rule.rs @@ -46,67 +46,67 @@ pub mod update_rule_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Pattern; - type Reason; type Url; + type Pattern; type Action; + type Reason; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Pattern = Unset; - type Reason = Unset; type Url = Unset; + type Pattern = Unset; type Action = Unset; - } - ///State transition - sets the `pattern` field to Set - pub struct SetPattern(PhantomData S>); - impl sealed::Sealed for SetPattern {} - impl State for SetPattern { - type Pattern = Set; - type Reason = S::Reason; - type Url = S::Url; - type Action = S::Action; - } - ///State transition - sets the `reason` field to Set - pub struct SetReason(PhantomData S>); - impl sealed::Sealed for SetReason {} - impl State for SetReason { - type Pattern = S::Pattern; - type Reason = Set; - type Url = S::Url; - type Action = S::Action; + type Reason = Unset; } ///State transition - sets the `url` field to Set pub struct SetUrl(PhantomData S>); impl sealed::Sealed for SetUrl {} impl State for SetUrl { + type Url = Set; type Pattern = S::Pattern; + type Action = S::Action; type Reason = S::Reason; - type Url = Set; + } + ///State transition - sets the `pattern` field to Set + pub struct SetPattern(PhantomData S>); + impl sealed::Sealed for SetPattern {} + impl State for SetPattern { + type Url = S::Url; + type Pattern = Set; type Action = S::Action; + type Reason = S::Reason; } ///State transition - sets the `action` field to Set pub struct SetAction(PhantomData S>); impl sealed::Sealed for SetAction {} impl State for SetAction { + type Url = S::Url; type Pattern = S::Pattern; + type Action = Set; type Reason = S::Reason; + } + ///State transition - sets the `reason` field to Set + pub struct SetReason(PhantomData S>); + impl sealed::Sealed for SetReason {} + impl State for SetReason { type Url = S::Url; - type Action = Set; + type Pattern = S::Pattern; + type Action = S::Action; + type Reason = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `pattern` field - pub struct pattern(()); - ///Marker type for the `reason` field - pub struct reason(()); ///Marker type for the `url` field pub struct url(()); + ///Marker type for the `pattern` field + pub struct pattern(()); ///Marker type for the `action` field pub struct action(()); + ///Marker type for the `reason` field + pub struct reason(()); } } @@ -256,10 +256,10 @@ where impl<'a, S> UpdateRuleBuilder<'a, S> where S: update_rule_state::State, - S::Pattern: update_rule_state::IsSet, - S::Reason: update_rule_state::IsSet, S::Url: update_rule_state::IsSet, + S::Pattern: update_rule_state::IsSet, S::Action: update_rule_state::IsSet, + S::Reason: update_rule_state::IsSet, { /// Build the final struct pub fn build(self) -> UpdateRule<'a> { diff --git a/crates/weaver-api/src/tools_ozone/set.rs b/crates/weaver-api/src/tools_ozone/set.rs index b0634a8..6e389a9 100644 --- a/crates/weaver-api/src/tools_ozone/set.rs +++ b/crates/weaver-api/src/tools_ozone/set.rs @@ -300,67 +300,67 @@ pub mod set_view_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { + type SetSize; + type CreatedAt; type Name; type UpdatedAt; - type CreatedAt; - type SetSize; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { + type SetSize = Unset; + type CreatedAt = Unset; type Name = Unset; type UpdatedAt = Unset; - type CreatedAt = Unset; - type SetSize = Unset; + } + ///State transition - sets the `set_size` field to Set + pub struct SetSetSize(PhantomData S>); + impl sealed::Sealed for SetSetSize {} + impl State for SetSetSize { + type SetSize = Set; + type CreatedAt = S::CreatedAt; + type Name = S::Name; + type UpdatedAt = S::UpdatedAt; + } + ///State transition - sets the `created_at` field to Set + pub struct SetCreatedAt(PhantomData S>); + impl sealed::Sealed for SetCreatedAt {} + impl State for SetCreatedAt { + type SetSize = S::SetSize; + type CreatedAt = Set; + type Name = S::Name; + type UpdatedAt = S::UpdatedAt; } ///State transition - sets the `name` field to Set pub struct SetName(PhantomData S>); impl sealed::Sealed for SetName {} impl State for SetName { + type SetSize = S::SetSize; + type CreatedAt = S::CreatedAt; type Name = Set; type UpdatedAt = S::UpdatedAt; - type CreatedAt = S::CreatedAt; - type SetSize = S::SetSize; } ///State transition - sets the `updated_at` field to Set pub struct SetUpdatedAt(PhantomData S>); impl sealed::Sealed for SetUpdatedAt {} impl State for SetUpdatedAt { - type Name = S::Name; - type UpdatedAt = Set; - type CreatedAt = S::CreatedAt; - type SetSize = S::SetSize; - } - ///State transition - sets the `created_at` field to Set - pub struct SetCreatedAt(PhantomData S>); - impl sealed::Sealed for SetCreatedAt {} - impl State for SetCreatedAt { - type Name = S::Name; - type UpdatedAt = S::UpdatedAt; - type CreatedAt = Set; type SetSize = S::SetSize; - } - ///State transition - sets the `set_size` field to Set - pub struct SetSetSize(PhantomData S>); - impl sealed::Sealed for SetSetSize {} - impl State for SetSetSize { - type Name = S::Name; - type UpdatedAt = S::UpdatedAt; type CreatedAt = S::CreatedAt; - type SetSize = Set; + type Name = S::Name; + type UpdatedAt = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { + ///Marker type for the `set_size` field + pub struct set_size(()); + ///Marker type for the `created_at` field + pub struct created_at(()); ///Marker type for the `name` field pub struct name(()); ///Marker type for the `updated_at` field pub struct updated_at(()); - ///Marker type for the `created_at` field - pub struct created_at(()); - ///Marker type for the `set_size` field - pub struct set_size(()); } } @@ -493,10 +493,10 @@ where impl<'a, S> SetViewBuilder<'a, S> where S: set_view_state::State, + S::SetSize: set_view_state::IsSet, + S::CreatedAt: set_view_state::IsSet, S::Name: set_view_state::IsSet, S::UpdatedAt: set_view_state::IsSet, - S::CreatedAt: set_view_state::IsSet, - S::SetSize: set_view_state::IsSet, { /// Build the final struct pub fn build(self) -> SetView<'a> { diff --git a/crates/weaver-api/src/tools_ozone/setting.rs b/crates/weaver-api/src/tools_ozone/setting.rs index 1b3df5d..e5fa5b9 100644 --- a/crates/weaver-api/src/tools_ozone/setting.rs +++ b/crates/weaver-api/src/tools_ozone/setting.rs @@ -55,105 +55,105 @@ pub mod defs_option_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type CreatedBy; + type Key; type Scope; - type Value; type LastUpdatedBy; + type Value; type Did; - type Key; + type CreatedBy; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type CreatedBy = Unset; + type Key = Unset; type Scope = Unset; - type Value = Unset; type LastUpdatedBy = Unset; + type Value = Unset; type Did = Unset; - type Key = Unset; + type CreatedBy = Unset; } - ///State transition - sets the `created_by` field to Set - pub struct SetCreatedBy(PhantomData S>); - impl sealed::Sealed for SetCreatedBy {} - impl State for SetCreatedBy { - type CreatedBy = Set; + ///State transition - sets the `key` field to Set + pub struct SetKey(PhantomData S>); + impl sealed::Sealed for SetKey {} + impl State for SetKey { + type Key = Set; type Scope = S::Scope; - type Value = S::Value; type LastUpdatedBy = S::LastUpdatedBy; + type Value = S::Value; type Did = S::Did; - type Key = S::Key; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `scope` field to Set pub struct SetScope(PhantomData S>); impl sealed::Sealed for SetScope {} impl State for SetScope { - type CreatedBy = S::CreatedBy; + type Key = S::Key; type Scope = Set; - type Value = S::Value; type LastUpdatedBy = S::LastUpdatedBy; + type Value = S::Value; type Did = S::Did; - type Key = S::Key; - } - ///State transition - sets the `value` field to Set - pub struct SetValue(PhantomData S>); - impl sealed::Sealed for SetValue {} - impl State for SetValue { type CreatedBy = S::CreatedBy; - type Scope = S::Scope; - type Value = Set; - type LastUpdatedBy = S::LastUpdatedBy; - type Did = S::Did; - type Key = S::Key; } ///State transition - sets the `last_updated_by` field to Set pub struct SetLastUpdatedBy(PhantomData S>); impl sealed::Sealed for SetLastUpdatedBy {} impl State for SetLastUpdatedBy { - type CreatedBy = S::CreatedBy; + type Key = S::Key; type Scope = S::Scope; - type Value = S::Value; type LastUpdatedBy = Set; + type Value = S::Value; type Did = S::Did; + type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `value` field to Set + pub struct SetValue(PhantomData S>); + impl sealed::Sealed for SetValue {} + impl State for SetValue { type Key = S::Key; + type Scope = S::Scope; + type LastUpdatedBy = S::LastUpdatedBy; + type Value = Set; + type Did = S::Did; + type CreatedBy = S::CreatedBy; } ///State transition - sets the `did` field to Set pub struct SetDid(PhantomData S>); impl sealed::Sealed for SetDid {} impl State for SetDid { - type CreatedBy = S::CreatedBy; + type Key = S::Key; type Scope = S::Scope; - type Value = S::Value; type LastUpdatedBy = S::LastUpdatedBy; + type Value = S::Value; type Did = Set; - type Key = S::Key; - } - ///State transition - sets the `key` field to Set - pub struct SetKey(PhantomData S>); - impl sealed::Sealed for SetKey {} - impl State for SetKey { type CreatedBy = S::CreatedBy; + } + ///State transition - sets the `created_by` field to Set + pub struct SetCreatedBy(PhantomData S>); + impl sealed::Sealed for SetCreatedBy {} + impl State for SetCreatedBy { + type Key = S::Key; type Scope = S::Scope; - type Value = S::Value; type LastUpdatedBy = S::LastUpdatedBy; + type Value = S::Value; type Did = S::Did; - type Key = Set; + type CreatedBy = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `created_by` field - pub struct created_by(()); + ///Marker type for the `key` field + pub struct key(()); ///Marker type for the `scope` field pub struct scope(()); - ///Marker type for the `value` field - pub struct value(()); ///Marker type for the `last_updated_by` field pub struct last_updated_by(()); + ///Marker type for the `value` field + pub struct value(()); ///Marker type for the `did` field pub struct did(()); - ///Marker type for the `key` field - pub struct key(()); + ///Marker type for the `created_by` field + pub struct created_by(()); } } @@ -397,12 +397,12 @@ where impl<'a, S> DefsOptionBuilder<'a, S> where S: defs_option_state::State, - S::CreatedBy: defs_option_state::IsSet, + S::Key: defs_option_state::IsSet, S::Scope: defs_option_state::IsSet, - S::Value: defs_option_state::IsSet, S::LastUpdatedBy: defs_option_state::IsSet, + S::Value: defs_option_state::IsSet, S::Did: defs_option_state::IsSet, - S::Key: defs_option_state::IsSet, + S::CreatedBy: defs_option_state::IsSet, { /// Build the final struct pub fn build(self) -> DefsOption<'a> { diff --git a/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs b/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs index 131b34c..5651b97 100644 --- a/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs +++ b/crates/weaver-api/src/tools_ozone/setting/upsert_option.rs @@ -41,49 +41,49 @@ pub mod upsert_option_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Key; type Scope; + type Key; type Value; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Key = Unset; type Scope = Unset; + type Key = Unset; type Value = Unset; } - ///State transition - sets the `key` field to Set - pub struct SetKey(PhantomData S>); - impl sealed::Sealed for SetKey {} - impl State for SetKey { - type Key = Set; - type Scope = S::Scope; - type Value = S::Value; - } ///State transition - sets the `scope` field to Set pub struct SetScope(PhantomData S>); impl sealed::Sealed for SetScope {} impl State for SetScope { - type Key = S::Key; type Scope = Set; + type Key = S::Key; + type Value = S::Value; + } + ///State transition - sets the `key` field to Set + pub struct SetKey(PhantomData S>); + impl sealed::Sealed for SetKey {} + impl State for SetKey { + type Scope = S::Scope; + type Key = Set; type Value = S::Value; } ///State transition - sets the `value` field to Set pub struct SetValue(PhantomData S>); impl sealed::Sealed for SetValue {} impl State for SetValue { - type Key = S::Key; type Scope = S::Scope; + type Key = S::Key; type Value = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `key` field - pub struct key(()); ///Marker type for the `scope` field pub struct scope(()); + ///Marker type for the `key` field + pub struct key(()); ///Marker type for the `value` field pub struct value(()); } @@ -218,8 +218,8 @@ where impl<'a, S> UpsertOptionBuilder<'a, S> where S: upsert_option_state::State, - S::Key: upsert_option_state::IsSet, S::Scope: upsert_option_state::IsSet, + S::Key: upsert_option_state::IsSet, S::Value: upsert_option_state::IsSet, { /// Build the final struct diff --git a/crates/weaver-api/src/tools_ozone/team/add_member.rs b/crates/weaver-api/src/tools_ozone/team/add_member.rs index 0697889..13a8670 100644 --- a/crates/weaver-api/src/tools_ozone/team/add_member.rs +++ b/crates/weaver-api/src/tools_ozone/team/add_member.rs @@ -33,37 +33,37 @@ pub mod add_member_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Did; type Role; + type Did; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Did = Unset; type Role = Unset; - } - ///State transition - sets the `did` field to Set - pub struct SetDid(PhantomData S>); - impl sealed::Sealed for SetDid {} - impl State for SetDid { - type Did = Set; - type Role = S::Role; + type Did = Unset; } ///State transition - sets the `role` field to Set pub struct SetRole(PhantomData S>); impl sealed::Sealed for SetRole {} impl State for SetRole { - type Did = S::Did; type Role = Set; + type Did = S::Did; + } + ///State transition - sets the `did` field to Set + pub struct SetDid(PhantomData S>); + impl sealed::Sealed for SetDid {} + impl State for SetDid { + type Role = S::Role; + type Did = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `did` field - pub struct did(()); ///Marker type for the `role` field pub struct role(()); + ///Marker type for the `did` field + pub struct did(()); } } @@ -136,8 +136,8 @@ where impl<'a, S> AddMemberBuilder<'a, S> where S: add_member_state::State, - S::Did: add_member_state::IsSet, S::Role: add_member_state::IsSet, + S::Did: add_member_state::IsSet, { /// Build the final struct pub fn build(self) -> AddMember<'a> { diff --git a/crates/weaver-api/src/tools_ozone/verification.rs b/crates/weaver-api/src/tools_ozone/verification.rs index a0d688b..b85896b 100644 --- a/crates/weaver-api/src/tools_ozone/verification.rs +++ b/crates/weaver-api/src/tools_ozone/verification.rs @@ -75,104 +75,104 @@ pub mod verification_view_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type CreatedAt; - type Issuer; - type Subject; type DisplayName; - type Handle; type Uri; + type Subject; + type Issuer; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type CreatedAt = Unset; - type Issuer = Unset; - type Subject = Unset; type DisplayName = Unset; - type Handle = Unset; type Uri = Unset; + type Subject = Unset; + type Issuer = Unset; + type Handle = Unset; } ///State transition - sets the `created_at` field to Set pub struct SetCreatedAt(PhantomData S>); impl sealed::Sealed for SetCreatedAt {} impl State for SetCreatedAt { type CreatedAt = Set; - type Issuer = S::Issuer; - type Subject = S::Subject; type DisplayName = S::DisplayName; - type Handle = S::Handle; type Uri = S::Uri; + type Subject = S::Subject; + type Issuer = S::Issuer; + type Handle = S::Handle; } - ///State transition - sets the `issuer` field to Set - pub struct SetIssuer(PhantomData S>); - impl sealed::Sealed for SetIssuer {} - impl State for SetIssuer { + ///State transition - sets the `display_name` field to Set + pub struct SetDisplayName(PhantomData S>); + impl sealed::Sealed for SetDisplayName {} + impl State for SetDisplayName { type CreatedAt = S::CreatedAt; - type Issuer = Set; + type DisplayName = Set; + type Uri = S::Uri; type Subject = S::Subject; + type Issuer = S::Issuer; + type Handle = S::Handle; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type CreatedAt = S::CreatedAt; type DisplayName = S::DisplayName; + type Uri = Set; + type Subject = S::Subject; + type Issuer = S::Issuer; type Handle = S::Handle; - type Uri = S::Uri; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { type CreatedAt = S::CreatedAt; - type Issuer = S::Issuer; - type Subject = Set; type DisplayName = S::DisplayName; - type Handle = S::Handle; type Uri = S::Uri; + type Subject = Set; + type Issuer = S::Issuer; + type Handle = S::Handle; } - ///State transition - sets the `display_name` field to Set - pub struct SetDisplayName(PhantomData S>); - impl sealed::Sealed for SetDisplayName {} - impl State for SetDisplayName { + ///State transition - sets the `issuer` field to Set + pub struct SetIssuer(PhantomData S>); + impl sealed::Sealed for SetIssuer {} + impl State for SetIssuer { type CreatedAt = S::CreatedAt; - type Issuer = S::Issuer; + type DisplayName = S::DisplayName; + type Uri = S::Uri; type Subject = S::Subject; - type DisplayName = Set; + type Issuer = Set; type Handle = S::Handle; - type Uri = S::Uri; } ///State transition - sets the `handle` field to Set pub struct SetHandle(PhantomData S>); impl sealed::Sealed for SetHandle {} impl State for SetHandle { type CreatedAt = S::CreatedAt; - type Issuer = S::Issuer; - type Subject = S::Subject; type DisplayName = S::DisplayName; - type Handle = Set; type Uri = S::Uri; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type CreatedAt = S::CreatedAt; - type Issuer = S::Issuer; type Subject = S::Subject; - type DisplayName = S::DisplayName; - type Handle = S::Handle; - type Uri = Set; + type Issuer = S::Issuer; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `created_at` field pub struct created_at(()); - ///Marker type for the `issuer` field - pub struct issuer(()); - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `uri` field pub struct uri(()); + ///Marker type for the `subject` field + pub struct subject(()); + ///Marker type for the `issuer` field + pub struct issuer(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -480,11 +480,11 @@ impl<'a, S> VerificationViewBuilder<'a, S> where S: verification_view_state::State, S::CreatedAt: verification_view_state::IsSet, - S::Issuer: verification_view_state::IsSet, - S::Subject: verification_view_state::IsSet, S::DisplayName: verification_view_state::IsSet, - S::Handle: verification_view_state::IsSet, S::Uri: verification_view_state::IsSet, + S::Subject: verification_view_state::IsSet, + S::Issuer: verification_view_state::IsSet, + S::Handle: verification_view_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationView<'a> { diff --git a/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs b/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs index fbcc08c..ceff4a4 100644 --- a/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs +++ b/crates/weaver-api/src/tools_ozone/verification/grant_verifications.rs @@ -36,37 +36,37 @@ pub mod grant_error_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Subject; type Error; + type Subject; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Subject = Unset; type Error = Unset; - } - ///State transition - sets the `subject` field to Set - pub struct SetSubject(PhantomData S>); - impl sealed::Sealed for SetSubject {} - impl State for SetSubject { - type Subject = Set; - type Error = S::Error; + type Subject = Unset; } ///State transition - sets the `error` field to Set pub struct SetError(PhantomData S>); impl sealed::Sealed for SetError {} impl State for SetError { - type Subject = S::Subject; type Error = Set; + type Subject = S::Subject; + } + ///State transition - sets the `subject` field to Set + pub struct SetSubject(PhantomData S>); + impl sealed::Sealed for SetSubject {} + impl State for SetSubject { + type Error = S::Error; + type Subject = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `subject` field - pub struct subject(()); ///Marker type for the `error` field pub struct error(()); + ///Marker type for the `subject` field + pub struct subject(()); } } @@ -139,8 +139,8 @@ where impl<'a, S> GrantErrorBuilder<'a, S> where S: grant_error_state::State, - S::Subject: grant_error_state::IsSet, S::Error: grant_error_state::IsSet, + S::Subject: grant_error_state::IsSet, { /// Build the final struct pub fn build(self) -> GrantError<'a> { @@ -641,50 +641,50 @@ pub mod verification_input_state { /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { type DisplayName; - type Handle; type Subject; + type Handle; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { type DisplayName = Unset; - type Handle = Unset; type Subject = Unset; + type Handle = Unset; } ///State transition - sets the `display_name` field to Set pub struct SetDisplayName(PhantomData S>); impl sealed::Sealed for SetDisplayName {} impl State for SetDisplayName { type DisplayName = Set; - type Handle = S::Handle; - type Subject = S::Subject; - } - ///State transition - sets the `handle` field to Set - pub struct SetHandle(PhantomData S>); - impl sealed::Sealed for SetHandle {} - impl State for SetHandle { - type DisplayName = S::DisplayName; - type Handle = Set; type Subject = S::Subject; + type Handle = S::Handle; } ///State transition - sets the `subject` field to Set pub struct SetSubject(PhantomData S>); impl sealed::Sealed for SetSubject {} impl State for SetSubject { type DisplayName = S::DisplayName; - type Handle = S::Handle; type Subject = Set; + type Handle = S::Handle; + } + ///State transition - sets the `handle` field to Set + pub struct SetHandle(PhantomData S>); + impl sealed::Sealed for SetHandle {} + impl State for SetHandle { + type DisplayName = S::DisplayName; + type Subject = S::Subject; + type Handle = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { ///Marker type for the `display_name` field pub struct display_name(()); - ///Marker type for the `handle` field - pub struct handle(()); ///Marker type for the `subject` field pub struct subject(()); + ///Marker type for the `handle` field + pub struct handle(()); } } @@ -798,8 +798,8 @@ impl<'a, S> VerificationInputBuilder<'a, S> where S: verification_input_state::State, S::DisplayName: verification_input_state::IsSet, - S::Handle: verification_input_state::IsSet, S::Subject: verification_input_state::IsSet, + S::Handle: verification_input_state::IsSet, { /// Build the final struct pub fn build(self) -> VerificationInput<'a> { diff --git a/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs b/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs index 107233c..85f9888 100644 --- a/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs +++ b/crates/weaver-api/src/tools_ozone/verification/revoke_verifications.rs @@ -236,37 +236,37 @@ pub mod revoke_error_state { } /// State trait tracking which required fields have been set pub trait State: sealed::Sealed { - type Uri; type Error; + type Uri; } /// Empty state - all required fields are unset pub struct Empty(()); impl sealed::Sealed for Empty {} impl State for Empty { - type Uri = Unset; type Error = Unset; - } - ///State transition - sets the `uri` field to Set - pub struct SetUri(PhantomData S>); - impl sealed::Sealed for SetUri {} - impl State for SetUri { - type Uri = Set; - type Error = S::Error; + type Uri = Unset; } ///State transition - sets the `error` field to Set pub struct SetError(PhantomData S>); impl sealed::Sealed for SetError {} impl State for SetError { - type Uri = S::Uri; type Error = Set; + type Uri = S::Uri; + } + ///State transition - sets the `uri` field to Set + pub struct SetUri(PhantomData S>); + impl sealed::Sealed for SetUri {} + impl State for SetUri { + type Error = S::Error; + type Uri = Set; } /// Marker types for field names #[allow(non_camel_case_types)] pub mod members { - ///Marker type for the `uri` field - pub struct uri(()); ///Marker type for the `error` field pub struct error(()); + ///Marker type for the `uri` field + pub struct uri(()); } } @@ -339,8 +339,8 @@ where impl<'a, S> RevokeErrorBuilder<'a, S> where S: revoke_error_state::State, - S::Uri: revoke_error_state::IsSet, S::Error: revoke_error_state::IsSet, + S::Uri: revoke_error_state::IsSet, { /// Build the final struct pub fn build(self) -> RevokeError<'a> { diff --git a/lexicons/actor/defs.json b/lexicons/actor/defs.json index 4ceca1e..a683977 100644 --- a/lexicons/actor/defs.json +++ b/lexicons/actor/defs.json @@ -97,6 +97,47 @@ } } }, + "subscribedNotebook": { + "type": "object", + "description": "A notebook the viewer subscribes to without a global follow.", + "required": ["uri"], + "properties": { + "uri": { "type": "string", "format": "at-uri" }, + "title": { "type": "string" }, + "path": { "type": "string" } + } + }, + "viewerState": { + "type": "object", + "description": "Viewer's relationship state with an actor (detailed version).", + "properties": { + "following": { "type": "string", "format": "at-uri" }, + "followedBy": { "type": "string", "format": "at-uri" }, + "followRequested": { "type": "string", "format": "at-uri" }, + "followRequestedBy": { "type": "string", "format": "at-uri" }, + "subscribedNotebooks": { + "type": "array", + "items": { "type": "ref", "ref": "#subscribedNotebook" } + }, + "muted": { "type": "string", "format": "at-uri" }, + "blocked": { "type": "string", "format": "at-uri" }, + "blockedBy": { "type": "boolean" } + } + }, + "viewerStateBasic": { + "type": "object", + "description": "Viewer's relationship state with an actor (basic version).", + "properties": { + "following": { "type": "string", "format": "at-uri" }, + "followedBy": { "type": "string", "format": "at-uri" }, + "followRequested": { "type": "string", "format": "at-uri" }, + "followRequestedBy": { "type": "string", "format": "at-uri" }, + "subscribedNotebookCount": { "type": "integer" }, + "muted": { "type": "string", "format": "at-uri" }, + "blocked": { "type": "string", "format": "at-uri" }, + "blockedBy": { "type": "boolean" } + } + }, "profileDataView": { "type": "object", "required": ["inner"], @@ -104,7 +145,13 @@ "inner": { "type": "union", "refs": ["#profileView", "app.bsky.actor.defs#profileViewDetailed", "#tangledProfileView"] - } + }, + "viewer": { "type": "ref", "ref": "#viewerState" }, + "notebookCount": { "type": "integer" }, + "entryCount": { "type": "integer" }, + "collaborationCount": { "type": "integer" }, + "followerCount": { "type": "integer" }, + "followingCount": { "type": "integer" } } }, "profileDataViewBasic": { @@ -114,7 +161,10 @@ "inner": { "type": "union", "refs": ["#profileViewBasic", "app.bsky.actor.defs#profileViewBasic", "#tangledProfileView"] - } + }, + "viewer": { "type": "ref", "ref": "#viewerStateBasic" }, + "followerCount": { "type": "integer" }, + "followingCount": { "type": "integer" } } }, "author": { diff --git a/lexicons/actor/getActorProfile.json b/lexicons/actor/getActorProfile.json deleted file mode 100644 index ee1719f..0000000 --- a/lexicons/actor/getActorProfile.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "lexicon": 1, - "id": "sh.weaver.actor.getActorProfile", - "defs": { - "main": { - "type": "query", - "description": "Get a Weaver profile with notebook/entry statistics.", - "parameters": { - "type": "params", - "required": ["actor"], - "properties": { - "actor": { "type": "string", "format": "at-identifier" } - } - }, - "output": { - "encoding": "application/json", - "schema": { - "type": "object", - "required": ["profile", "notebookCount", "entryCount"], - "properties": { - "profile": { "type": "ref", "ref": "sh.weaver.actor.defs#profileView" }, - "notebookCount": { "type": "integer" }, - "entryCount": { "type": "integer" }, - "collaborationCount": { "type": "integer" }, - "followerCount": { "type": "integer" }, - "followingCount": { "type": "integer" }, - "viewerFollowing": { "type": "string", "format": "at-uri" }, - "viewerFollowedBy": { "type": "string", "format": "at-uri" } - } - } - } - } - } -} diff --git a/lexicons/notebook/book.json b/lexicons/notebook/book.json index 9a442be..c9e5b68 100644 --- a/lexicons/notebook/book.json +++ b/lexicons/notebook/book.json @@ -42,7 +42,11 @@ "description": "Client-declared timestamp of last modification. Used for canonicality tiebreaking in multi-author scenarios." }, "contentWarnings": { "type": "ref", "ref": "sh.weaver.notebook.defs#contentWarnings" }, - "rating": { "type": "ref", "ref": "sh.weaver.notebook.defs#contentRating" } + "rating": { "type": "ref", "ref": "sh.weaver.notebook.defs#contentRating" }, + "publishGlobal": { + "type": "boolean", + "description": "Notebook opts into accessiblity by path only without identity scoping. Path must be globally unique." + } } } }